Search completed in 1.00 seconds.
2 results for "onshippingaoptionchange":
PaymentRequest.shippingOption - Web APIs
Web › API › PaymentRequest › shippingOption
ructor is called with the requestshipping flag set to true. if requestshipping was false (or missing), shippingoption returns null, even the developer provides a selected a shipping option. syntax // returns the id of the selected paymentshippingoption var shippingoption = request.shippingoption; example in the example below, the paymentrequest.onshippingoptionchange and the paymentrequest.onshippingaoptionchange events are dispatched. in each calls to updatedetails() are made, one using a promise, and the other with a plain js object. this demotrates synchrounous and asynchronous updates to a payment sheet. const request = new paymentrequest(methoddata, details, options); // async update to details request.onshippingaddresschange = ev => { ev.updatewith(checkshipping(request)); }; // sync update to ...
PaymentResponse.shippingOption - Web APIs
Web › API › PaymentResponse › shippingOption
the shippingoption read-only property of the paymentrequest interface returns the id attribute of the shipping option selected by the user. this option is only present when the requestshipping option is set to true in the paymentoptions object passed to the paymentrequest constructor. syntax var shippingoption = paymentrequest.shippingoption; example in the example below, the paymentrequest.onshippingaoptionchange event is called. it calls updatedetails() to toggle the shipping method between "standard" and "express". // initialization of paymentrequest arguments are excerpted for brevity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(resolve, reject) { updatedetails(deta...