Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PaymentRequest

PaymentRequest

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.

ThePayment Request API'sPaymentRequest interface is the primary access point into the API, and lets web content and apps accept payments from the end user on behalf of the operator of the site or the publisher of the app.

EventTarget PaymentRequest

Constructor

PaymentRequest()

Creates a newPaymentRequest object.

Instance properties

PaymentRequest.idRead only

A unique identifier for a particularPaymentRequest, which can be set viadetails.id. When none is set, it defaults to a UUID.

PaymentRequest.shippingAddressRead onlyDeprecatedNon-standard

If requested via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping. This property is only populated if the constructor is called with therequestShipping flag set to true. Additionally, in some browsers, the parts of the address will be redacted for privacy until the user indicates they are ready to complete the transaction (i.e., they hit "Pay").

PaymentRequest.shippingOptionRead onlyDeprecatedNon-standard

Returns the identifier of the selected shipping option. This property is only populated if the constructor is called with therequestShipping flag set to true.

PaymentRequest.shippingTypeRead onlyDeprecatedNon-standard

Returns the type of shipping used to fulfill the transaction. This will be one ofshipping,delivery,pickup, ornull if a value was not provided in the constructor.

Static methods

PaymentRequest.securePaymentConfirmationAvailability()Experimental

Indicates whether theSecure payment confirmation feature is available.

Instance methods

PaymentRequest.canMakePayment()

Indicates whether thePaymentRequest object can make a payment before callingshow().

PaymentRequest.show()

Causes the user agent to begin the user interaction for the payment request.

PaymentRequest.abort()

Causes the user agent to end the payment request and to remove any user interface that might be shown.

Events

merchantvalidationDeprecated

With some payment handlers (e.g., Apple Pay), this event handler is called to handle themerchantvalidation event, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate.

paymentmethodchange

With some payment handlers (e.g., Apple Pay), dispatched whenever the user changes payment instrument, like switching from a credit card to a debit card.

shippingaddresschangeDeprecatedNon-standard

Dispatched whenever the user changes their shipping address.

shippingoptionchangeDeprecatedNon-standard

Dispatched whenever the user changes a shipping option.

Specifications

Specification
Payment Request API
# paymentrequest-interface

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp