Search completed in 1.17 seconds.
Using the Payment Request API - Web APIs
so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(buildsupported
paymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupported
paymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] }...
...it returns a promise that fulfills with a boolean indicating whether it is or not, for example: // dummy payment request to check whether payment can be made new paymentrequest(buildsupported
paymentmethoddata(), {total: {label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { if(result) { // real payment request var request = new paymentrequest(buildsupported
paymentmethoddata(), checkoutobject); request.show().then(function(paymentresponse) { // ...
... the code looks something like this: checkoutbutton.addeventlistener('click', function() { var request = new paymentrequest(buildsupported
paymentmethoddata(), buildshoppingcartdetails()); request.show().then(function(paymentresponse) { // here we would process the payment.
PaymentRequestEvent.methodData - Web APIs
the methoddata read-only property of the paymentrequestevent interface returns an array of
paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
... syntax var methoddata[] = paymentrequestevent.methoddata value an array of
paymentmethoddata objects.
AddressErrors - Web APIs
javascript payment request data first, we declare the variables supportedhandlers, which is compatible with
paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object.
Index - Web APIs
2945 paymentrequestevent.methoddata the methoddata read-only property of the paymentrequestevent interface returns an array of
paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.