const supportedPaymentMethods = [
{
"supportedMethods": "basic-card"
}
];
const paymentDetails = {
"title": "Tickets to Venice x2",
"total": {
"label": "Total",
"amount": {
"currency": "USD",
"value": 2000
}
},
"displayItems": [],
"shippingOptions": []
};
const options = {
"requestShipping": false,
"shippingType": "delivery"
};
const request = new PaymentRequest(
supportedPaymentMethods,
paymentDetails,
options
);
request.show()
.then((paymentResponse) => {
console.info(paymentResponse);
paymentResponse.complete();
})
.catch((err) => {
console.error(err);
});