Use an object based on PaymentDetailsUpdate
to represent the new payment details and any errors after the customer makes changes in the payment sheet in an PaymentDetailsChangedEvent.
For example, if an error is identified while handling the PaymentDetailsChangedEvent
the PaymentDetailsUpdate
should include a PaymentDataError in the errors
array as well as the updated paymentDetails
like this:
{ "paymentDetails": { "displayItems": [...], "summaryItems": [...], "total": {...}, "shippingOptions": [...] }, "errors": [ { "reason": "INVALID_OFFER_CODE", "message": "SPRING20 has expired", "field": "offers" } ] }
Property | Type | Description | Required |
---|---|---|---|
| Payment details to replace data on the payment sheet. | Yes | |
| Array<PaymentDataError> | An optional list of errors to present to the user related to the changes made in the PaymentDetailsChangedEvent | No |
[deprecated] | { [k: String]: PaymentDataError; } | This property is deprecated, please use Error information about the shipping address to display to the user. Each key is a property from the W3C PaymentAddress object and the corresponding value indicates the error for that property. You can also use | No |