Search completed in 1.65 seconds.
1 results for "onpaymentrequest":
Using the Payment Request API - Web APIs
WebAPIPayment Request APIUsing the Payment Request API
let shouldcallpaymentrequest = true; let fallbacktolegacyonpaymentrequestfailure = false; (new paymentrequest(supportedpaymentmethods, {total: {label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { shouldcallpaymentrequest = result; }).catch(function(error) { console.log(error); // the user may have turned off query ability in their privacy settings.
... shouldcallpaymentrequest = true; fallbacktolegacyonpaymentrequestfailure = true; }); // user has clicked on the checkout button.
... }).catch(function(error) { console.log(error); if (fallbacktolegacyonpaymentrequestfailure) { window.location.href = '/legacy-web-form-checkout'; } else { showcheckouterrortouser(); } }); } else { window.location.href = '/legacy-web-form-checkout'; } } note: see our checking user can make payments before prices are known demo for the full code.