SaveCard Request
If you do not want to perform a pre-authorisation check on a customer's account, use this call to tokenise the card information into an encrypted string.
Do you have a stored card wallet for existing customers? If validation is successful, a card token is returned as part of the response object.
This token can then be stored and used for a payments / preauths request in the future, using the Web SDK’s Token Payment functionality.
- Make sure you are using Web SDK Version 0.0.43 (or higher).
- Make sure you have implemented the following:
- From the Web SDK integration guide, you have completed the following:
- You do not need to include the amount or currency fields in your request body.
- Define the saveCardConfiguration object.
Ensure the details used when creating the paymentSession match the values set in the saveCardConfiguration object.
See below for more details on the parameters that create the saveCardConfiguration object:
Parameter | Description |
---|---|
judoId String Required | Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
yourConsumerReference String Required | Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
currency String Optional | The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cardHolderName String Optional | The card name of the consumer If the cardHolderName field is displayed to the user in the payment form (isCardHolderNameVisible: true is set in the iFrame config), the value entered in the payment form will overwrite this value. |
billingAddress Object Optional | Card holder's billing address. Properties:
If the billingAddress is provided, the postcode is required. |
2. In a function, add the invokeSaveCard call. This will make a Save Card request using the paymentSession and saveCardConfiguration.
3. To call the invokeSaveCard function (in step 2 above) to make the Save Card request, add the onclick attribute to the payment button <div>: <button id="submit-payment-button" onclick="handleSaveCardButtonClick()"> Save Card</button>
This is the same button that is used for payments, however you can update the button label to reflect it’s functionality. For example: Save Card instead of Pay Now.