PaymentResponse

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The PaymentResponse interface of the Payment Request API is returned after a user selects a payment method and approves a payment request.

Properties

PaymentResponse.details Read only Secure context
Returns a JSON-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer. This data is returned by the payment app that satisfies the payment request, and must conform to the structure defined in the BasicCardResponse dictionary.
PaymentResponse.methodName Read only Secure context
Returns the payment method identifier for the payment method that the user selected, for example, Visa, Mastercard, Paypal, etc.. 
PaymentResponse.payerEmail Read only Secure context
Returns the email address supplied by the user. This option is only present when the requestPayerEmail option is set to true in the options parameter of the PaymentRequest() constructor.
PaymentResponse.payerName Read only Secure context
Returns the name supplied by the user. This option is only present when the requestPayerName option is set to true in the options parameter of the PaymentRequest() constructor.
PaymentResponse.payerPhone Read only Secure context
Returns the phone number supplied by the user. This option is only present when the requestPayerPhone option is set to true in the options parameter of the PaymentRequest() constructor.
PaymentResponse.requestId Read only Secure context
Returns the identifier of the PaymentRequest that produced the current response. This is the same value supplied in the PaymentRequest() constructor by details.id.
PaymentResponse.shippingAddress Read only Secure context
Returns the shipping Address supplied by the user. This option is only present when the requestShipping option is set to true in the options parameter of the PaymentRequest() constructor.
PaymentResponse.shippingOption Read only Secure context
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 options parameter of the PaymentRequest() constructor.

Methods

PaymentResponse.complete() Secure context
Notifies the user agent that the user interaction is over. This causes any remaining user interface to be closed. This method should only be called after the Promise returned by the PaymentRequest.show() method.

Specifications

Specification Status Comment
Payment Request API
The definition of 'PaymentResponse' in that specification.
Candidate Recommendation Initial definition.

Browser Compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support61 Yes561 No No ?
details6115561 No No ?
methodName6115561 No No ?
payerEmail6115561 No No ?
payerName6115561 No No ?
payerPhone6115561 No No ?
requestId6116561 No No ?
shippingAddress6115561 No No ?
shippingOption6115561 No No ?
complete6115561 No No ?
toJSON ? ? ? ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No53 Yes561 No ?6.0
details No53 Yes561 No ?6.0
methodName No53 Yes561 No ?6.0
payerEmail No53 Yes561 No ?6.0
payerName No58 Yes561 No ?7.0
payerPhone No53 Yes561 No ?6.0
requestId No60 Yes561 No ? No
shippingAddress No53 Yes561 No ?6.0
shippingOption No53 Yes561 No ?6.0
complete No53 Yes561 No ?6.0
toJSON ? ? ? ? ? ? ?

1. From version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Document Tags and Contributors

 Contributors to this page: fscholz, jpmedley, chrisdavidmills, libbymc, pyoor, dgashmdn
 Last updated by: fscholz,