@stripe/stripe-js 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pure.esm.js +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/elements/apple-pay.d.ts +156 -0
- package/types/stripe-js/elements/express-checkout.d.ts +2 -23
- package/types/stripe-js/elements/payment.d.ts +6 -0
- package/types/stripe-js/payment-request.d.ts +16 -0
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export type ApplePayRecurringPaymentRequestIntervalUnit =
|
|
2
|
+
| 'year'
|
|
3
|
+
| 'month'
|
|
4
|
+
| 'day'
|
|
5
|
+
| 'hour'
|
|
6
|
+
| 'minute';
|
|
7
|
+
|
|
8
|
+
export interface ApplePayLineItem {
|
|
9
|
+
/**
|
|
10
|
+
* A short, localized description of the line item.
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The amount in the currency's subunit (e.g. cents, yen, etc.)
|
|
16
|
+
*/
|
|
17
|
+
amount: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ApplePayRegularBilling = ApplePayLineItem & {
|
|
21
|
+
/**
|
|
22
|
+
* The date of the first payment.
|
|
23
|
+
*/
|
|
24
|
+
recurringPaymentStartDate?: Date;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The date of the final payment.
|
|
28
|
+
*/
|
|
29
|
+
recurringPaymentEndDate?: Date;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval.
|
|
33
|
+
*/
|
|
34
|
+
recurringPaymentIntervalUnit?: ApplePayRecurringPaymentRequestIntervalUnit;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The number of interval units that make up the total payment interval.
|
|
38
|
+
*/
|
|
39
|
+
recurringPaymentIntervalCount?: number;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export interface ApplePayRecurringPaymentRequest {
|
|
43
|
+
/**
|
|
44
|
+
* The description of the payment that the customer will see in their Apple Pay wallet.
|
|
45
|
+
*/
|
|
46
|
+
paymentDescription: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The URL to manage items related to the recurring payment on your website.
|
|
50
|
+
*/
|
|
51
|
+
managementURL: string;
|
|
52
|
+
regularBilling: ApplePayRegularBilling;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
|
|
56
|
+
*/
|
|
57
|
+
billingAgreement?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type ApplePayAutomaticReloadBilling = ApplePayLineItem & {
|
|
61
|
+
/**
|
|
62
|
+
* The balance an account reaches before the merchant applies the automatic reload amount.
|
|
63
|
+
*/
|
|
64
|
+
automaticReloadPaymentThresholdAmount: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export interface ApplePayAutomaticReloadPaymentRequest {
|
|
68
|
+
/**
|
|
69
|
+
* The description of the payment that the customer will see in their Apple Pay wallet.
|
|
70
|
+
*/
|
|
71
|
+
paymentDescription: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The URL to manage items related to the automatic reload payment on your website.
|
|
75
|
+
*/
|
|
76
|
+
managementURL: string;
|
|
77
|
+
automaticReloadBilling: ApplePayAutomaticReloadBilling;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
|
|
81
|
+
*/
|
|
82
|
+
billingAgreement?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type ApplePayDeferredBilling = ApplePayLineItem & {
|
|
86
|
+
/**
|
|
87
|
+
* The date, in the future, of the payment.
|
|
88
|
+
*/
|
|
89
|
+
deferredPaymentDate: Date;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export interface ApplePayDeferredPaymentRequest {
|
|
93
|
+
/**
|
|
94
|
+
* The description of the payment that the customer will see in their Apple Pay wallet.
|
|
95
|
+
*/
|
|
96
|
+
paymentDescription: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The URL to manage items related to the deferred payment on your website.
|
|
100
|
+
*/
|
|
101
|
+
managementURL: string;
|
|
102
|
+
deferredBilling: ApplePayDeferredBilling;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
|
|
106
|
+
*/
|
|
107
|
+
billingAgreement?: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The future date before which the customer can cancel the deferred payment for free.
|
|
111
|
+
*/
|
|
112
|
+
freeCancellationDate?: Date;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The time zone of the free cancellation date.
|
|
116
|
+
*
|
|
117
|
+
* These are [tz](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezones such as `America/Los_Angeles`, `Europe/Dublin`, and `Asia/Singapore`.
|
|
118
|
+
*/
|
|
119
|
+
freeCancellationDateTimeZone?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type ApplePayOption =
|
|
123
|
+
| {
|
|
124
|
+
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
|
|
125
|
+
deferredPaymentRequest?: null;
|
|
126
|
+
automaticReloadPaymentRequest?: null;
|
|
127
|
+
}
|
|
128
|
+
| {
|
|
129
|
+
recurringPaymentRequest?: null;
|
|
130
|
+
deferredPaymentRequest: ApplePayDeferredPaymentRequest;
|
|
131
|
+
automaticReloadPaymentRequest?: null;
|
|
132
|
+
}
|
|
133
|
+
| {
|
|
134
|
+
recurringPaymentRequest?: null;
|
|
135
|
+
deferredPaymentRequest?: null;
|
|
136
|
+
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
|
|
137
|
+
}
|
|
138
|
+
| {
|
|
139
|
+
recurringPaymentRequest?: null;
|
|
140
|
+
deferredPaymentRequest?: null;
|
|
141
|
+
automaticReloadPaymentRequest?: null;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type ApplePayUpdateOption =
|
|
145
|
+
| {
|
|
146
|
+
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
|
|
147
|
+
automaticReloadPaymentRequest?: null;
|
|
148
|
+
}
|
|
149
|
+
| {
|
|
150
|
+
recurringPaymentRequest?: null;
|
|
151
|
+
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
|
|
152
|
+
}
|
|
153
|
+
| {
|
|
154
|
+
recurringPaymentRequest?: null;
|
|
155
|
+
automaticReloadPaymentRequest?: null;
|
|
156
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
|
+
import {ApplePayOption, ApplePayUpdateOption} from './apple-pay';
|
|
3
4
|
|
|
4
5
|
export type StripeExpressCheckoutElement = StripeElementBase & {
|
|
5
6
|
/**
|
|
@@ -362,29 +363,6 @@ export interface StripeExpressCheckoutElementReadyEvent {
|
|
|
362
363
|
availablePaymentMethods: undefined | AvailablePaymentMethods;
|
|
363
364
|
}
|
|
364
365
|
|
|
365
|
-
export type RecurringPaymentIntervalUnit =
|
|
366
|
-
| 'year'
|
|
367
|
-
| 'month'
|
|
368
|
-
| 'day'
|
|
369
|
-
| 'hour'
|
|
370
|
-
| 'minute';
|
|
371
|
-
|
|
372
|
-
export type ApplePayOption = {
|
|
373
|
-
recurringPaymentRequest?: {
|
|
374
|
-
paymentDescription: string;
|
|
375
|
-
managementURL: string;
|
|
376
|
-
regularBilling: {
|
|
377
|
-
amount: number;
|
|
378
|
-
label: string;
|
|
379
|
-
recurringPaymentStartDate?: Date;
|
|
380
|
-
recurringPaymentEndDate?: Date;
|
|
381
|
-
recurringPaymentIntervalUnit?: RecurringPaymentIntervalUnit;
|
|
382
|
-
recurringPaymentIntervalCount?: number;
|
|
383
|
-
};
|
|
384
|
-
billingAgreement?: string;
|
|
385
|
-
};
|
|
386
|
-
};
|
|
387
|
-
|
|
388
366
|
export type ClickResolveDetails = {
|
|
389
367
|
/**
|
|
390
368
|
* An array of two-letter ISO country codes representing which countries
|
|
@@ -451,6 +429,7 @@ export interface StripeExpressCheckoutElementConfirmEvent {
|
|
|
451
429
|
export type ChangeResolveDetails = {
|
|
452
430
|
lineItems?: Array<LineItem>;
|
|
453
431
|
shippingRates?: Array<ShippingRate>;
|
|
432
|
+
applePay?: ApplePayUpdateOption;
|
|
454
433
|
};
|
|
455
434
|
|
|
456
435
|
export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
|
+
import {ApplePayOption} from './apple-pay';
|
|
3
4
|
|
|
4
5
|
export type StripePaymentElement = StripeElementBase & {
|
|
5
6
|
/**
|
|
@@ -239,6 +240,11 @@ export interface StripePaymentElementOptions {
|
|
|
239
240
|
* Specify a layout to use when rendering a Payment Element.
|
|
240
241
|
*/
|
|
241
242
|
layout?: Layout | LayoutObject;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Specify the options to be used when the Apple Pay payment interface opens.
|
|
246
|
+
*/
|
|
247
|
+
applePay?: ApplePayOption;
|
|
242
248
|
}
|
|
243
249
|
|
|
244
250
|
export interface StripePaymentElementChangeEvent {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {Token, PaymentMethod, Source} from '../api';
|
|
2
|
+
import {ApplePayOption, ApplePayUpdateOption} from './elements/apple-pay';
|
|
2
3
|
|
|
3
4
|
export interface PaymentRequest {
|
|
4
5
|
/**
|
|
@@ -154,6 +155,11 @@ export interface PaymentRequestUpdateOptions {
|
|
|
154
155
|
*/
|
|
155
156
|
|
|
156
157
|
shippingOptions?: PaymentRequestShippingOption[];
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Specify the options to be used when the Apple Pay payment interface opens.
|
|
161
|
+
*/
|
|
162
|
+
applePay?: ApplePayOption;
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
/**
|
|
@@ -226,6 +232,11 @@ export interface PaymentRequestOptions {
|
|
|
226
232
|
*/
|
|
227
233
|
disableWallets?: PaymentRequestWallet[];
|
|
228
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Specify the options to be used when the Apple Pay payment interface opens.
|
|
237
|
+
*/
|
|
238
|
+
applePay?: ApplePayOption;
|
|
239
|
+
|
|
229
240
|
/**
|
|
230
241
|
* @deprecated
|
|
231
242
|
* Use disableWallets instead.
|
|
@@ -497,6 +508,11 @@ export interface PaymentRequestUpdateDetails {
|
|
|
497
508
|
* The first shipping option listed appears in the browser payment interface as the default option.
|
|
498
509
|
*/
|
|
499
510
|
shippingOptions?: PaymentRequestShippingOption[];
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Specify new options to refresh the Apple Pay payment interface.
|
|
514
|
+
*/
|
|
515
|
+
applePay?: ApplePayUpdateOption;
|
|
500
516
|
}
|
|
501
517
|
|
|
502
518
|
export interface PaymentRequestShippingOptionEvent {
|