Jump to content

Replacing credit card form with own

Recommended Posts

I am developing a module for Stripe that uses the Elements Stripe.js version that would require less PCI requirements and support of other Stripe payment features.  The WHMCS stripe module uses Stripe.js v2 which requires more PCI requirements and it is deprecated.  Stripe uses "off site tokenization" by using their own forms.   There is a request to switch to Elements but has been there for a year and not ETAs as well as only supporting cards and not other stripe payment options (beyond apple pay) 


I need to replace the credit card form that WHMCS uses with my own form / Stripe's Elements form so that the information is saved at Stripe and the token saved in WHMCS.  Using WHMCS's form for cards wont work here as it needs to use Stripe's.  I found _remoteinput in WHMCS doc,, but that does not fire in 7.6 and support has said it is no longer available and sent me this direction for further help.  However, WHMCS's own Stripe module replaces the form with the Stripe.js form so it must be using that function or another hidden one.   _storeremote wont work because it uses WHMCS's form .


Does anyone know of a way to replace the WHMCS credit card form in the admin area and orders pages?  The remoteupdate function appears to still work for the manage credit card page, though waiting on a confirmation it wont be removed later on. 

Share this post

Link to post
Share on other sites

I found that _remoteinput was on the credit card checkout page only and remoteupdate was on the manage card page and both only fire on the client side.  However, remoteinput does not work for me as it includes the 3dsecure stuff even when _3dsecure() is not given.  This causes the 3dsecure iframe to post to the stripe card enter form before any card information is done and thus causes an error that no card was given.  Do you know of a switch to prevent that behavior or should I just presume such request is for the 3dauth without a flag? 

Share this post

Link to post
Share on other sites

In 2016 I have questioned the WHMCS team about this function, I found the reply:



That option is not mentioned in the codebase once. It appears there might have been some desire to implement it, but its never been used. Right now we don’t use the metadata array you highlighted to control this, instead we look to see if the module has implemented one of two different functions:

  • modulename_remoteupdate - returns a chunk of html to be insert into the page via the clientareacreditcard.tpl. If the function is defined and does not return anything, we populate the $remoteupdatecode variable with the language string defined for that client with the key: creditcardupdatenotpossible. In english the message is: "Credit Card Details cannot be updated at the current time. Please try again later."
  • modulename_remoteUpdateWithTemplate - if you implement this function you need to return an array w/key value pairs we map into Smarty variables. We then load modules/gateways/templates/module_name/creditcard.tpl and display the page with that template instead of the themes template page. This allows you to use templates to make your code easier to maintain.

I would recommend using the second function.

If we can be of any more assistance, please don't hesitate to get back in contact.


  • Thanks 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

By using this site, you agree to our Terms of Use & Guidelines