Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PaymentResponse

PaymentResponse

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

ThePaymentResponse interface of thePayment Request API is returned after a user selects a payment method and approves a payment request.

EventTarget PaymentResponse

Instance properties

PaymentResponse.detailsRead only

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. The contents of the object depend on the payment method being used. Developers need to consult whomever controls the URL for the expected shape of the details object.

PaymentResponse.methodNameRead only

Returns the payment method identifier for the payment method that the user selected, for example, Visa, Mastercard, PayPal, etc.

PaymentResponse.payerEmailRead only

Returns the email address supplied by the user. This option is only present when therequestPayerEmail option is set totrue in theoptions parameter of thePaymentRequest() constructor.

PaymentResponse.payerNameRead only

Returns the name supplied by the user. This option is only present when therequestPayerName option is set to true in theoptions parameter of thePaymentRequest() constructor.

PaymentResponse.payerPhoneRead only

Returns the phone number supplied by the user. This option is only present when therequestPayerPhone option is set totrue in theoptions parameter of thePaymentRequest() constructor.

PaymentResponse.requestIdRead only

Returns the identifier of thePaymentRequest that produced the current response. This is the same value supplied in thePaymentRequest() constructor bydetails.id.

PaymentResponse.shippingAddressRead only

Returns the shipping Address supplied by the user. This option is only present when therequestShipping option is set totrue in theoptions parameter of thePaymentRequest() constructor.

PaymentResponse.shippingOptionRead only

Returns the ID attribute of the shipping option selected by the user. This option is only present when therequestShipping option is set totrue in theoptions parameter of thePaymentRequest() constructor.

Instance methods

PaymentResponse.retry()

If something is wrong with the payment response's data (and there is a recoverable error), this method allows a merchant to request that the user retry the payment. The method takes an object as argument, which is used to signal to the user exactly what is wrong with the payment response so they can try to correct any issues.

PaymentResponse.complete()

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 thePaymentRequest.show() method.

PaymentResponse.toJSON()

Returns aJSON object representing thisPaymentResponse object.

Events

Listen to this event usingaddEventListener() or by assigning an event listener to theoneventname property of this interface.

payerdetailchange

Fired during a retry when the user makes changes to their personal information while filling out a payment request form. Allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes.

Specifications

Specification
Payment Request API
# paymentresponse-interface

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp