PaymentRequest
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Want more browser support for this feature? Tell us why.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Payment Request API's PaymentRequest interface 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.
ÐонÑÑÑÑкÑоÑ
PaymentRequest()Secure context-
СоздаÑÑ Ð½Ð¾Ð²Ñй
PaymentRequestобÑекÑ.
СвойÑÑва
PaymentRequest.idТолÑко Ð´Ð»Ñ ÑÑÐµÐ½Ð¸Ñ Secure context-
УникалÑнÑй иденÑиÑикаÑÐ¾Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑеÑного запÑоÑа
PaymentRequest, коÑоÑÑй можно задаÑÑ ÑеÑезdetails.id. ÐÑли ниÑего не задано, по ÑмолÑÐ°Ð½Ð¸Ñ Ð¸ÑполÑзÑеÑÑÑ UUID. PaymentRequest.shippingAddressТолÑко Ð´Ð»Ñ ÑÑÐµÐ½Ð¸Ñ Secure context-
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 the
requestShippingflag 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.shippingOptionТолÑко Ð´Ð»Ñ ÑÑÐµÐ½Ð¸Ñ Secure context-
ÐозвÑаÑÐ°ÐµÑ Ð¸Ð´ÐµÐ½ÑиÑикаÑÐ¾Ñ Ð²ÑбÑанного ваÑианÑа доÑÑавки. ÐÑо ÑвойÑÑво заполнÑеÑÑÑ ÑолÑко в Ñом ÑлÑÑае, еÑли конÑÑÑÑкÑÐ¾Ñ Ð²ÑзÑваеÑÑÑ Ñ Ñлагом
requestShipping, ÑÑÑановленнÑм в знаÑение true. PaymentRequest.shippingTypeТолÑко Ð´Ð»Ñ ÑÑÐµÐ½Ð¸Ñ Secure context-
Returns the type of shipping used to fulfill the transaction. This will be one of
shipping,delivery,pickup, ornullif a value was not provided in the constructor.
ÐеÑодÑ
PaymentRequest.canMakePayment()Secure context-
Indicates whether the
PaymentRequestobject can make a payment before callingshow().
PaymentRequest.show()Secure context-
Causes the user agent to begin the user interaction for the payment request.
PaymentRequest.abort()Secure context-
Causes the user agent to end the payment request and to remove any user interface that might be shown.
СобÑÑиÑ
merchantvalidationSecure context-
With some payment handlers (e.g., Apple Pay), this event handler is called to handle the
merchantvalidationevent, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate. Also available using theonmerchantvalidationevent handler property. paymentmethodchangeSecure context-
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. Also available using the
onpaymentmethodchangeevent handler property. shippingaddresschangeSecure context-
СÑабаÑÑÐ²Ð°ÐµÑ ÐºÐ°Ð¶Ð´Ñй Ñаз, когда полÑзоваÑÐµÐ»Ñ Ð¼ÐµÐ½ÑÐµÑ Ð²Ð°ÑÐ¸Ð°Ð½Ñ Ð´Ð¾ÑÑавки. Также доÑÑÑпно Ñ Ð¸ÑполÑзованием HTML аÑÑибÑÑа
onshippingaddresschange. shippingoptionchangeSecure context-
СÑабаÑÑÐ²Ð°ÐµÑ ÐºÐ°Ð¶Ð´Ñй Ñаз, когда полÑзоваÑÐµÐ»Ñ Ð¼ÐµÐ½ÑÐµÑ Ð²Ð°ÑÐ¸Ð°Ð½Ñ Ð´Ð¾ÑÑавки. Также доÑÑÑпно Ñ Ð¸ÑполÑзованием HTML аÑÑибÑÑа
onshippingoptionchange.
СпеÑиÑикаÑии
| Specification |
|---|
| Payment Request API > # paymentrequest-interface > |