Jump to content

Credit Card Token not saved on client


souzadavi

Recommended Posts

I was testing the function of credit card in WHMCS with token. Every thing works fine, but some thing wrong happen.

If the customer profile has another default payment gateway defined that isnt credit card payment, when this customers goes to save the credit card in client area in (/clientarea.php?action=creditcard) the WHMCS doesn't save the token of credit card, the whmcs save all information about the credit card but doesn't save the token of credit card....

 

Looks like the method doesnt call the function _storeremote() of the creditcard payment... My question is how to force the form in /clientarea.php?action=creditcard call the function _storeremote() of the credit card payment gateway?

 

thanks...

 

 

 

 

Link to comment
Share on other sites

I did a hook, to fix it, so when the user access: /clientarea.php?action=creditcard  I just update the user to creditcard payment.

add_hook('ClientAreaPageCreditCard', 1, function($vars) {

	$command = 'UpdateClient';
	$postData = array(
	    'clientid' => $vars['clientsdetails']['userid'],
	    'paymentmethod' => 'CreditCardModuleName',
	);
	$results = localAPI($command, $postData, $adminUsername);

});

 

Link to comment
Share on other sites

This is a good temporary workaround, but could possibly cause an issue for those who have monthly reoccurring invoices that do not use the credit card gateway this hook forces.  WHMCS needs to fix this, as it is a security issue where you could end up with full credit cards numbers in your database without even knowing it.  If your server is not PCI compliant, and instead you are relying on a token payment gateway to alleviate the need for PCI compliance on your end, this is an issue.

Link to comment
Share on other sites

Even with tokens, if any card info is given over your server your need to have more PCI requirements than if the token was generated at the client side via javascript.  Stripe's Elements is a good example of this setup where the token is generated off server completely and you get no card details beyond expiration and last 4.  

If your gateway offers remote / client side token generation, then you want to use _remoteinput and you need to use your own input forms or however the gateway does it.  Return your html in that function and that will show on the invoice payment page.   Use _remoteupdate in similar fashion to do the credit card manage page.  However, do note that according to WHMCS support those functions are depreciated and at this point no functions exist to replace them as well as they appear to be removed from docs.  

Edited by steven99
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