@stripe/stripe-js
Advanced tools
Comparing version 1.13.2 to 1.14.0
@@ -57,3 +57,3 @@ function _typeof(obj) { | ||
name: 'stripe-js', | ||
version: "1.13.2", | ||
version: "1.14.0", | ||
startTime: startTime | ||
@@ -60,0 +60,0 @@ }); |
@@ -61,3 +61,3 @@ 'use strict'; | ||
name: 'stripe-js', | ||
version: "1.13.2", | ||
version: "1.14.0", | ||
startTime: startTime | ||
@@ -64,0 +64,0 @@ }); |
@@ -41,3 +41,3 @@ var V3_URL = 'https://js.stripe.com/v3'; | ||
name: 'stripe-js', | ||
version: "1.13.2", | ||
version: "1.14.0", | ||
startTime: startTime | ||
@@ -44,0 +44,0 @@ }); |
@@ -45,3 +45,3 @@ 'use strict'; | ||
name: 'stripe-js', | ||
version: "1.13.2", | ||
version: "1.14.0", | ||
startTime: startTime | ||
@@ -48,0 +48,0 @@ }); |
{ | ||
"name": "@stripe/stripe-js", | ||
"version": "1.13.2", | ||
"version": "1.14.0", | ||
"description": "Stripe.js loading utility", | ||
@@ -15,3 +15,3 @@ "main": "dist/stripe.js", | ||
"test:types": "tsc -p ./tests/types", | ||
"lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-list-different", | ||
"lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-check", | ||
"typecheck": "tsc", | ||
@@ -22,3 +22,3 @@ "build": "yarn clean && yarn rollup -c", | ||
"prettier": "prettier './**/*.{js,ts,md,html,css}' --write", | ||
"prettier-list-different": "prettier './**/*.{js,ts,md,html,css}' --list-different" | ||
"prettier-check": "prettier './**/*.{js,ts,md,html,css}' --check" | ||
}, | ||
@@ -25,0 +25,0 @@ "keywords": [ |
@@ -58,2 +58,6 @@ declare module '@stripe/stripe-js' { | ||
type: string; | ||
afterpay_clearpay?: PaymentMethod.AfterpayClearpay; | ||
acss_debit?: PaymentMethod.AcssDebit; | ||
} | ||
@@ -242,2 +246,21 @@ | ||
} | ||
interface AfterpayClearpay {} | ||
interface AcssDebit { | ||
/** | ||
* Customer’s bank account number. | ||
*/ | ||
account_number: string; | ||
/** | ||
* Institution number of the customer’s bank. | ||
*/ | ||
institution_number: string; | ||
/** | ||
* Transit number of the customer’s bank. | ||
*/ | ||
transit_number: string; | ||
} | ||
} | ||
@@ -244,0 +267,0 @@ |
@@ -148,2 +148,3 @@ declare module '@stripe/stripe-js' { | ||
| 'sv' | ||
| 'th' | ||
| 'tr' | ||
@@ -150,0 +151,0 @@ | 'zh' |
@@ -285,2 +285,3 @@ ///<reference path='./elements/card.d.ts' /> | ||
| 'fr-FR' | ||
| 'hu' | ||
| 'he' | ||
@@ -294,2 +295,3 @@ | 'id' | ||
| 'ms' | ||
| 'mt' | ||
| 'nb' | ||
@@ -301,2 +303,3 @@ | 'nl' | ||
| 'pt-BR' | ||
| 'ro' | ||
| 'ru' | ||
@@ -307,3 +310,6 @@ | 'sk' | ||
| 'th' | ||
| 'zh'; | ||
| 'tr' | ||
| 'zh' | ||
| 'zh-HK' | ||
| 'zh-TW'; | ||
@@ -310,0 +316,0 @@ /** |
@@ -44,2 +44,19 @@ ///<reference path='./checkout.d.ts' /> | ||
/** | ||
* Use `stripe.confirmAcssDebitPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow when the customer submits your payment form. | ||
* When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) when the user submits the form. | ||
* | ||
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). | ||
* `stripe.confirmAcssDebitPayment` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. | ||
* It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. | ||
* If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment | ||
*/ | ||
confirmAcssDebitPayment( | ||
clientSecret: string, | ||
data?: ConfirmAcssDebitPaymentData, | ||
options?: ConfirmAcssDebitPaymentOptions | ||
): Promise<PaymentIntentResult>; | ||
/** | ||
* Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form. | ||
@@ -199,2 +216,22 @@ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
* | ||
* Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form. | ||
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. | ||
* Once authorization is complete, the customer will be redirected back to your specified `return_url`. | ||
* | ||
* When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). | ||
* In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. | ||
* If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment | ||
*/ | ||
confirmKlarnaPayment( | ||
clientSecret: string, | ||
data?: ConfirmKlarnaPaymentData, | ||
options?: ConfirmKlarnaPaymentOptions | ||
): Promise<PaymentIntentResult>; | ||
/** | ||
* Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form. | ||
@@ -284,5 +321,16 @@ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. | ||
/** | ||
* Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow | ||
* to verify a customer's bank account with micro-deposits. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment | ||
*/ | ||
verifyMicrodepositsForPayment( | ||
clientSecret: string, | ||
data?: VerifyMicrodepositsForPaymentData | ||
): Promise<PaymentIntentResult>; | ||
/** | ||
* Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/create_payment_method | ||
* @docs https://stripe.com/docs/js/payment_methods/create_payment_method | ||
*/ | ||
@@ -307,2 +355,19 @@ createPaymentMethod( | ||
/** | ||
* Use `stripe.confirmAcssDebitSetup` to [save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment). | ||
* When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) when the user submits the form. | ||
* | ||
* When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). | ||
* `stripe.confirmAcssDebitSetup` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. | ||
* It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. | ||
* If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. | ||
* | ||
* @docs https://stripe.com/docs/js/setup_intents/confirm_acss_debit_setup | ||
*/ | ||
confirmAcssDebitSetup( | ||
clientSecret: string, | ||
data?: ConfirmAcssDebitSetupData, | ||
options?: ConfirmAcssDebitSetupOptions | ||
): Promise<SetupIntentResult>; | ||
/** | ||
* Requires beta access: | ||
@@ -430,2 +495,27 @@ * Contact [Stripe support](https://support.stripe.com/) for more information. | ||
/** | ||
* Use `stripe.confirmAfterpayClearpayPayment` in the [Afterpay / Clearpay payments](https://stripe.com/docs/payments/afterpay-clearpay) flow when the customer submits your payment form. | ||
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). | ||
* Refer to our [integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment) for more details. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/confirm_afterpay_clearpay_payment | ||
*/ | ||
confirmAfterpayClearpayPayment( | ||
clientSecret: string, | ||
data?: ConfirmAfterpayClearpayPaymentData, | ||
options?: ConfirmAfterpayClearpayPaymentOptions | ||
): Promise<{paymentIntent?: PaymentIntent; error?: StripeError}>; | ||
/** | ||
* Use `stripe.verifyMicrodepositsForSetup` in the [Save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment) flow | ||
* to verify customer's bank account with micro-deposits. | ||
* | ||
* @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_setup | ||
*/ | ||
verifyMicrodepositsForSetup( | ||
clientSecret: string, | ||
data?: VerifyMicrodepositsForSetupData | ||
): Promise<PaymentIntentResult>; | ||
/** | ||
* Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret. | ||
@@ -432,0 +522,0 @@ * |
@@ -6,2 +6,4 @@ declare module '@stripe/stripe-js' { | ||
type CreatePaymentMethodData = | ||
| CreatePaymentMethodAcssDebitData | ||
| CreatePaymentMethodAfterpayClearpayData | ||
| CreatePaymentMethodAlipayData | ||
@@ -15,2 +17,3 @@ | CreatePaymentMethodAuBecsDebitData | ||
| CreatePaymentMethodIdealData | ||
| CreatePaymentMethodKlarnaData | ||
| CreatePaymentMethodP24Data | ||
@@ -25,2 +28,12 @@ | CreatePaymentMethodFpxData | ||
interface CreatePaymentMethodAfterpayClearpayData | ||
extends PaymentMethodCreateParams { | ||
type: 'afterpay_clearpay'; | ||
/** | ||
* Can be omitted as there are no AfterpayClearpay-specific fields. | ||
*/ | ||
afterpay_clearpay?: {}; // eslint-disable-line @typescript-eslint/ban-types | ||
} | ||
interface CreatePaymentMethodBancontactData | ||
@@ -119,2 +132,22 @@ extends PaymentMethodCreateParams { | ||
interface CreatePaymentMethodKlarnaData extends PaymentMethodCreateParams { | ||
/** | ||
* Requires beta access: | ||
* Contact [Stripe support](https://support.stripe.com/) for more information. | ||
*/ | ||
type: 'klarna'; | ||
/** | ||
* The customer's billing details. | ||
* `address.country` is required. | ||
* | ||
* @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details | ||
*/ | ||
billing_details: PaymentMethodCreateParams.BillingDetails & { | ||
address: PaymentMethodCreateParams.BillingDetails.Address & { | ||
country: string; | ||
}; | ||
}; | ||
} | ||
interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams { | ||
@@ -270,3 +303,35 @@ type: 'oxxo'; | ||
} | ||
interface CreatePaymentMethodAcssDebitData extends PaymentMethodCreateParams { | ||
type: 'acss_debit'; | ||
/** | ||
* Can be omitted as Stripe will help to collect bank account details and verification. | ||
* Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details. | ||
*/ | ||
acss_debit?: { | ||
/** | ||
* Customer’s bank account number. | ||
*/ | ||
account_number: string; | ||
/** | ||
* Institution number of the customer’s bank. | ||
*/ | ||
institution_number: string; | ||
/** | ||
* Transit number of the customer’s bank. | ||
*/ | ||
transit_number: string; | ||
}; | ||
/** | ||
* The customer's billing details. | ||
* `name`, `email`, and `address` are required. | ||
* | ||
* @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details | ||
*/ | ||
billing_details: PaymentMethodCreateParams.BillingDetails; | ||
} | ||
/** | ||
@@ -557,2 +622,34 @@ * Data to be sent with a `stripe.confirmBancontactPayment` request. | ||
/** | ||
* Data to be sent with a `stripe.confirmKlarnaPayment` request. | ||
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. | ||
*/ | ||
interface ConfirmKlarnaPaymentData extends PaymentIntentConfirmParams { | ||
/** | ||
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. | ||
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. | ||
* | ||
* @recommended | ||
*/ | ||
payment_method?: string | Omit<CreatePaymentMethodKlarnaData, 'type'>; | ||
/** | ||
* The url your customer will be directed to after they complete authentication. | ||
* | ||
* @recommended | ||
*/ | ||
return_url?: string; | ||
} | ||
/** | ||
* An options object to control the behavior of `stripe.confirmKlarnaPayment`. | ||
*/ | ||
interface ConfirmKlarnaPaymentOptions { | ||
/** | ||
* Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/klarna#handle-redirect). | ||
* Default is `true`. | ||
*/ | ||
handleActions?: boolean; | ||
} | ||
/** | ||
* Data to be sent with a `stripe.confirmOxxoPayment` request. | ||
@@ -672,2 +769,69 @@ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. | ||
} | ||
/** | ||
* Data to be sent with a `stripe.confirmAfterpayClearpayPayment` request. | ||
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. | ||
*/ | ||
interface ConfirmAfterpayClearpayPaymentData | ||
extends PaymentIntentConfirmParams { | ||
/** | ||
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. | ||
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. | ||
* | ||
* @recommended | ||
*/ | ||
payment_method?: | ||
| string | ||
| Omit<CreatePaymentMethodAfterpayClearpayData, 'type'>; | ||
/** | ||
* The url your customer will be directed to after they complete authentication. | ||
*/ | ||
return_url?: string; | ||
} | ||
/** | ||
* An options object to control the behavior of `stripe.confirmAfterpayClearpayPayment`. | ||
*/ | ||
interface ConfirmAfterpayClearpayPaymentOptions { | ||
/** | ||
* Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Afterpay / Clearpay integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment#handle-redirect) | ||
* for more info. Default is `true`. | ||
*/ | ||
handleActions?: boolean; | ||
} | ||
/** | ||
* Data to be sent with a `stripe.confirmAcssDebitPayment` request. | ||
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. | ||
*/ | ||
interface ConfirmAcssDebitPaymentData extends PaymentIntentConfirmParams { | ||
/** | ||
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. | ||
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. | ||
* | ||
* @recommended | ||
*/ | ||
payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; | ||
} | ||
/** | ||
* An options object to control the behavior of `stripe.confirmAcssDebitPayment`. | ||
*/ | ||
interface ConfirmAcssDebitPaymentOptions { | ||
/** | ||
* Set `skipMandate` to `true` if you want to skip displaying the mandate confirmation screen. | ||
*/ | ||
skipMandate?: boolean; | ||
} | ||
/** | ||
* Data to be sent with a `stripe.verifyMicrodepositsForPayment` request. | ||
*/ | ||
interface VerifyMicrodepositsForPaymentData { | ||
/** | ||
* An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. | ||
*/ | ||
amounts?: Array<number>; | ||
} | ||
} |
@@ -217,8 +217,11 @@ declare module '@stripe/stripe-js' { | ||
/** | ||
* An array of `PaymentRequestWallet` strings. | ||
* | ||
* By default, if no `wallets` option is passed in, all wallets will be enabled. | ||
* If you use this property, only wallets passed in will be enabled. | ||
* If an empty array is specified, all wallets will be disabled. | ||
* An array of wallet strings. | ||
* Use this option to disable Google Pay and/or Apple Pay. | ||
*/ | ||
disableWallets?: PaymentRequestWallet[]; | ||
/** | ||
* @deprecated | ||
* Use disableWallets instead. | ||
*/ | ||
wallets?: PaymentRequestWallet[]; | ||
@@ -225,0 +228,0 @@ } |
@@ -110,2 +110,36 @@ declare module '@stripe/stripe-js' { | ||
} | ||
/** | ||
* Data to be sent with a `stripe.confirmAcssDebitSetup` request. | ||
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. | ||
*/ | ||
interface ConfirmAcssDebitSetupData extends SetupIntentConfirmParams { | ||
/** | ||
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. | ||
* This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. | ||
* | ||
* @recommended | ||
*/ | ||
payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; | ||
} | ||
/** | ||
* An options object to control the behavior of `stripe.confirmAcssDebitSetup`. | ||
*/ | ||
interface ConfirmAcssDebitSetupOptions { | ||
/** | ||
* Set this to true if you want to skip displaying the mandate confirmation. | ||
*/ | ||
skipMandate?: boolean; | ||
} | ||
/** | ||
* Data to be sent with a `stripe.verifyMicrodepositsForSetup` request. | ||
*/ | ||
interface VerifyMicrodepositsForSetupData { | ||
/** | ||
* An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. | ||
*/ | ||
amounts?: Array<number>; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
283395
7027