Creating a PayPal component
You can enable this by calling addPaypal():
window.addEventListener('load', function () {
xpanse.init('sandbox', '<public key>')
.addPaypal('iframeContainer', '<amount>', '<3-letters currency code>', '<PayPal Provider Id (optional)>', 'options (optional)');
});
options is an optional object that can contain the following properties:
hideShipping: redact the shipping address from the PayPal sitepaypalButtonStyle: modify the PayPal buttons to change the colour of the button (can begold,blue,silver,white,black). The default button colour isgoldpaypalEnablePayIn4: enable PayPal Pay in 4 (can betrueorfalse)transfer:account: the merchant who receives payment for this transactionamount: the total order amountmetadata: additional metadata to send with the payment request (optional), sent as key/value pairs (eg metadata : {key1 : 'value1', key2 : 'value2'})