#
PaymentRequestUpdate
#
Interface that describes the object argument of the paymentRequest.addEventListener
method
return value.
Use this interface to create an object that contains payment request properties that are to be updated in the digital wallet payment sheet after recalculating fees or catching buyer input errors.
Properties
#
Replaces the current list of line items.
#
Allows for more granular messages when a shipping address is not valid.
#
Replaces the current list of shipping line items.
#
Replaces the current list of shipping options.
#
Replaces the current list of tax line items.
#
Replaces the current total.
paymentRequestUpdate.js
JS
JavaScript
Copy
req.addEventListener('shippingcontactchanged', (contact) => {
const shippingErrors = "shippingErrors": {
"addressLines": "1234 Nth Main Street",
"city": "New Bork",
"country": "XSA",
"postalCode": "9468x",
"MY"
};
const shippingLineItems = "shippingLineItems":[
{
"label": "Shipping charges",
"amount": "15.69",
"pending": true
}
];
const taxLineItems = "taxLineItems":[
{
"label": "State Tax",
"amount": "8.95",
"pending": true
}
];
const total = "total": "412.00";
return { shippingErrors, shippingLineItems, taxLineItems, total };
});