Jump to content

Use API to update credit card


bhorton

Recommended Posts

Hello All,

 

I'm setting up a custom order form as we're using WHMCS for something other than hosting. I used the API to create the client record but now I'm trying to add the client's credit card information.

 

I saw in another post that this should be done through the updateclient API but I can't get it to work.

 

My code is:

 

$postfields["username"] = $whmcs_user;

$postfields["password"] = md5($pw);

$postfields["action"] = "updateclient";

$postfields["clientid"]="$whmcs_client_id";

$postfields["cardtype"] = "$card_type";

$postfields["cardnum"] = "$card_num";

$postfields["expdate"] = "$exp_month/$exp_year";

 

It returns a success message and the card type is set but the card number and expiration date is blank.

 

Please don't let this question turn into a debate on whether or not cards should be stored in the database. We're not permanently storing them. This is just part of the initial setup process we need.

 

Thanks for your help!

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

Did you guys find the solution?

We use 4.3.1 and update_client API function works pretty good but we cannot update cc number.

 

For example:

When we try to save cc number through API and the card # is 378282246310005 after it's saved. I login to WHMCS, enter hash to see full card number and I get "¯a)-ØîéX•è ᪥n"

 

Very weird. Please help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated