← Back to release summary

PaymentDetails.error

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 57)
Intent stage
None

Summary

When the payment request is updated using updateWith, the PaymentDetails can contain a message in the error field that will be displayed to the user. For example, this might commonly be used to explain why goods cannot be shipped to the chosen shipping address. The error field cannot be passed to the PaymentRequest constructor. Doing so will cause a TypeError to be thrown.

Standards & signals

Docs: https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequestUpdateEvent/PaymentRequestUpdateEvent

Samples: https://rsolomakhin.github.io/pr/us/

View on chromestatus.com