Search completed in 1.65 seconds.
Using the Payment Request API - Web APIs
let shouldcallpaymentrequest = true; let fallbacktolegacy
onpaymentrequestfailure = 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; fallbacktolegacy
onpaymentrequestfailure = true; }); // user has clicked on the checkout button.
... }).catch(function(error) { console.log(error); if (fallbacktolegacy
onpaymentrequestfailure) { 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.