aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/paymentrequest/index.html
blob: 8f3f1eca7fb1492099275df4644901e79b70e31e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: PaymentRequest
slug: Web/API/PaymentRequest
tags:
  - API
  - Payment Request API
  - PaymentRequest
  - Деньги
  - Интерфейс
  - Коммерция
  - Оплата
  - Платежи
translation_of: Web/API/PaymentRequest
---
<div>{{securecontext_header}}{{APIRef("Payment Request API")}}</div>

<p>The <a href="/en-US/docs/Web/API/Payment_Request_API">Payment Request API's</a> <strong><code>PaymentRequest</code></strong> 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.</p>

<h2 id="Конструктор">Конструктор</h2>

<dl>
 <dt>{{domxref('PaymentRequest.PaymentRequest()','PaymentRequest()')}} {{securecontext_inline}}</dt>
 <dd>Создаёт новый <code>PaymentRequest</code> объект.</dd>
</dl>

<h2 id="Свойства">Свойства</h2>

<dl>
 <dt>{{domxref('PaymentRequest.id')}} {{readonlyinline}}{{securecontext_inline}}</dt>
 <dd>Уникальный идентификатор для конкретного запроса <code>PaymentRequest</code>, который можно задать через <code>details.id</code>. Если ничего не задано, по умолчанию используется UUID.</dd>
 <dt>{{domxref('PaymentRequest.shippingAddress')}} {{readonlyinline}} {{securecontext_inline}}</dt>
 <dd>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 <code>requestShipping</code> 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").</dd>
 <dt>{{domxref('PaymentRequest.shippingOption')}} {{readonlyinline}} {{securecontext_inline}}</dt>
 <dd>Возвращает идентификатор выбранного варианта доставки. Это свойство заполняется только в том случае, если конструктор вызывается с флагом <code>requestShipping</code>, установленным в значение true.</dd>
 <dt>{{domxref('PaymentRequest.shippingType')}} {{readonlyinline}} {{securecontext_inline}}</dt>
 <dd>Returns the type of shipping used to fulfill the transaction. This will be one of <code>shipping</code>, <code>delivery</code>, <code>pickup</code>, or <code>null</code> if a value was not provided in the constructor.</dd>
</dl>

<dl>
</dl>

<h2 id="Методы">Методы</h2>

<dl>
 <dt>{{domxref('PaymentRequest.canMakePayment()')}} {{securecontext_inline}}</dt>
 <dd>Indicates whether the <code>PaymentRequest</code> object can make a payment before calling <code>show()</code>.</dd>
</dl>

<dl>
 <dt>{{domxref('PaymentRequest.show()')}} {{securecontext_inline}}</dt>
 <dd>Causes the user agent to begin the user interaction for the payment request.</dd>
 <dt>{{domxref('PaymentRequest.abort()')}} {{securecontext_inline}}</dt>
 <dd>Causes the user agent to end the payment request and to remove any user interface that might be shown.</dd>
</dl>

<h2 id="События">События</h2>

<dl>
 <dt>{{domxref("PaymentRequest.merchantvalidation_event", "merchantvalidation")}} {{securecontext_inline}}</dt>
 <dd>With some payment handlers (e.g., Apple Pay), this event handler is called to handle the {{event("merchantvalidation")}} event, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate.<br>
 Also available using the {{domxref("PaymentRequest.onmerchantvalidation", "onmerchantvalidation")}} event handler property.</dd>
 <dt>{{domxref("PaymentRequest.paymentmethodchange_event", "paymentmethodchange")}} {{securecontext_inline}}</dt>
 <dd>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.<br>
 Also available using the {{domxref("PaymentRequest.onpaymentmethodchange", "onpaymentmethodchange")}} event handler property.</dd>
 <dt>{{domxref("PaymentRequest.shippingaddresschange_event", "shippingaddresschange")}} {{securecontext_inline}}</dt>
 <dd>Срабатывает каждый раз, когда пользователь меняет вариант доставки.<br>
 Также доступно с использованием HTML атрибута {{domxref("PaymentRequest.onshippingaddresschange", "onshippingaddresschange")}}.</dd>
 <dt>{{domxref("PaymentRequest.shippingoptionchange_event", "shippingoptionchange")}} {{securecontext_inline}}</dt>
 <dd>Срабатывает каждый раз, когда пользователь меняет вариант доставки.<br>
 Также доступно с использованием HTML атрибута {{domxref("PaymentRequest.onshippingoptionchange", "onshippingoptionchange")}}.</dd>
</dl>

<h2 id="Характеристики">Характеристики</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Payment','#paymentrequest-interface','PaymentRequest')}}</td>
   <td>{{Spec2('Payment')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>

<div>


<p>{{Compat("api.PaymentRequest")}}</p>
</div>

<div id="gtx-anchor" style="position: absolute; left: 40px; top: 2184px; width: 409.484px; height: 17px;"></div>

<div class="jfk-bubble gtx-bubble" style="">
<div class="jfk-bubble-content-id" id="bubble-20">
<div id="gtx-host" style="max-width: 400px;"></div>
</div>

<div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"></div>

<div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowdown" style="left: 184.5px;">
<div class="jfk-bubble-arrowimplbefore"></div>

<div class="jfk-bubble-arrowimplafter"></div>
</div>
</div>