Configuring the Add Payment Method Button
Last updated
Last updated
To configure the Add payment method button on your website to save a card token without processing a transaction:
Copy the following example code.
Paste it into your web page.
The Add payment method button appears on your website to allow customers to add a payment method for future purchases.
When customers select the Add payment method button, a hosted page opens to save their card information. The hosted page includes fields for card details and an optional billing address section.
You can provide saved payment methods to your customers for easier checkout process:
Call the ClearentOnSuccess
function, including the following parameters:
Token: The token returned from a sale request, or the token returned from a sale request with the save card option.
Card Type: The type of card used in the previous transaction.
Description: The description returned from a sale request with the save card option.
You can provide the below saved card options to your customers using the Clearent.addToken()
method:
Enter Card Manually: This option allows your customers to enter card information manually if they do not want to use a saved card.
Card Description: This option displays the card description provided from the addToken
method.
Card type ending in [last four digits of card]: This option displays the card type and card number (last four digits) from the addToken
method if the description was not provided for a saved card.
Card ending in [last four digits of card]: This option displays the card number (last four digits) from the addToken
method if the description was not provided for a saved card.
The following payment popup with the saved card options dropdown list will be displayed for the Card Number field on your website.