Creating a Least Cost Card component
You can add a card component with least-cost routing.
You can enable this by calling addCardLeastCost():
window.addEventListener('load', function () {
xpanse.init('sandbox', '<public key>')
.addCardLeastCost('iframeContainer', '<amount>', '<3-letters currency code>', 'options');
});
options is an object that can contain the following properties:
threeDSEmail: email address to use for 3DS authenticationclickToPayEnabled: enable Click To Pay feature (can betrueorfalse)clickToPayOptions: Click to Pay options:dpaId: DPA IddpaName: DPA namecardBrands: card brands which you want to support (can bevisa,mastercard,amex,discover,maestro)dpaBillingPreference: billing preference (can bePOSTAL_COUNTRY,NONE,FULL)
vault: force store card details in the vault (can betrueorfalseas default)verifyCard: enable card verification (can betrueorfalseas default), which will check the card, expiry date and CCV are valid with the provider. Not all providers support this.metadata: additional metadata to send with the payment request (optional), sent as key/value pairs (eg metadata : {key1 : 'value1', key2 : 'value2'})