iFrame recache
API docs for version 1 of the Spreedly iFrame Javascript API
Recache
Update the CVV on an already tokenized credit card.
Note: A credit card must be retained in your environment in order to recache its CVV
setRecache
Configure the iFrame to operate in recache mode. When iFrame has received and displayed the existing payment method information, the recacheReady event will be fired.
Spreedly.on('ready', function(){
Spreedly.setRecache("56wyNnSmuA6CWYP7w0MiYCVIbW6" , {
'card_type': 'visa',
'last_four_digits': '1234'
});
});Signature
setRecache(token, options)
Arguments
| Name | Description |
|---|---|
token | Token of existing payment method in Spreedly environment |
options | Map of display options for existing payment method. Set card_type to support CVV validation, and last_four_digits to show the last four digits in the number field. |
Events
| Name | Occurs |
|---|---|
| recacheReady | When the iFrame has been properly configured for recache |
recache
Trigger recache on an existing payment method. Requires that setRecache has already been called.
On successful recache, the recache event will be triggered. On failure, the errors event will be triggered.
Spreedly.recache();Signature
recache()
Events
| Name | Occurs |
|---|---|
recache | When a payment method is successfully recached |
errors | When a payment method is not successfully tokenized |
Updated 6 days ago
