Creating a Checkout component
You can enable this by calling addCheckout():
window.addEventListener('load', function () {
xpanse.init('sandbox', '<public key>')
.addCheckout('iframeContainer', '<amount>', '<3-letters currency code>', '<Checkout Provider Type>', '<Checkout Provider Id>', 'options', 'checkoutOptions' );
});
options is an optional object that can contain the following properties:
taxAmount: tax amountshippingAmount: amount of shippingdiscountAmount: amount of discountorderItems: array of products:name: name of productquantity: quantity of productsku: sku of productunitPrice: unit price of producttotalAmount: total cost of product
customer: inforamtion about customerfirstName: first name of customerlastName: last name of customeremail: email of customerphoneNumber: phone number of customer
billingAddress: billinng addressfirstNamelastNameemailphoneNumberstreetAddressstreetAddress2citycountryregionpostalCodestate
checkoutOptions: object that contain checkout metadatametadata: additional metadata to send with the payment request (optional), sent as key/value pairs (eg metadata : {key1 : 'value1', key2 : 'value2'})