FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

21
node_modules/@stripe/stripe-js/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Stripe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

156
node_modules/@stripe/stripe-js/README.md generated vendored Normal file
View File

@@ -0,0 +1,156 @@
# Stripe.js as a CommonJS module or ES module
This package allows [Stripe.js](https://stripe.com/docs/stripe-js) to be
imported as a CommonJS module or ES module.
**Note**: To be
[PCI compliant](https://stripe.com/docs/security/guide#validating-pci-compliance),
you must load Stripe.js directly from `https://js.stripe.com`. You cannot
include it in a bundle or host it yourself. This package wraps the global
`Stripe` function provided by the Stripe.js script as an ES module.
Calling `loadStripe` always loads the latest version of Stripe.js, regardless of
which version of `@stripe/stripe-js` you use. Updates for this package only
impact tooling around the `loadStripe` helper itself and the TypeScript type
definitions provided for Stripe.js. Updates do not affect runtime availability
of features of Stripe.js.
[![npm version](https://img.shields.io/npm/v/@stripe/stripe-js.svg?style=flat-square)](https://www.npmjs.com/package/@stripe/stripe-js)
## Minimum requirements
- Node.js: v12.16
- TypeScript: v.3.1.1
## Installation
Use `npm` to install the Stripe.js module:
```sh
npm install @stripe/stripe-js
```
## Usage
### `loadStripe`
This function returns a `Promise` that resolves with a newly created `Stripe`
object once Stripe.js has loaded. It takes the same parameters passed when
directly
[initializing a `Stripe` instance](https://stripe.com/docs/js/initializing). If
necessary, it will load Stripe.js for you by inserting the Stripe.js script tag.
If you call `loadStripe` in a server environment it will resolve to `null`.
```js
import {loadStripe} from '@stripe/stripe-js';
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
```
Weve placed a random API key in this example. Replace it with your
[actual publishable API keys](https://dashboard.stripe.com/account/apikeys) to
test this code through your Stripe account.
For more information on how to use Stripe.js, please refer to the
[Stripe.js API reference](https://stripe.com/docs/js) or learn to
[accept a payment](https://stripe.com/docs/payments/accept-a-payment) with
Stripe.
If you have deployed a
[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP),
make sure to
[include Stripe.js in your directives](https://stripe.com/docs/security/guide#content-security-policy).
## TypeScript support
This package includes TypeScript declarations for Stripe.js. We support projects
using TypeScript versions >= 3.1.
Some methods in Stripe.js accept and return objects from the
[Stripe API](https://stripe.com/docs/api). The type declarations in
`@stripe/stripe-js` for these objects in will always track the
[latest version](https://stripe.com/docs/api/versioning) of the Stripe API. If
you would like to use these types but are using an older version of the Stripe
API, we recommend
[updating to the latest version](https://stripe.com/docs/upgrades#how-can-i-upgrade-my-api),
or ignoring and overriding the type definitions as necessary.
Note that we may release new [minor and patch](https://semver.org/) versions of
`@stripe/stripe-js` with small but backwards-incompatible fixes to the type
declarations. These changes will not affect Stripe.js itself.
## Ensuring Stripe.js is available everywhere
To best leverage Stripes advanced fraud functionality, ensure that Stripe.js is
loaded on every page, not just your checkout page. This
[allows Stripe to detect suspicious behavior](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection)
that may be indicative of fraud as customers browse your website.
By default, this module will insert a `<script>` tag that loads Stripe.js from
`https://js.stripe.com`. This happens as a side effect immediately upon
importing this module. If you utilize code splitting or only include your
JavaScript app on your checkout page, the Stripe.js script will only be
available in parts of your site. To ensure Stripe.js is available everywhere,
you can perform either of the following steps:
### Import as a side effect
Import `@stripe/stripe-js` as a side effect in code that will be included
throughout your site (e.g. your root module). This will make sure the Stripe.js
script tag is inserted immediately upon page load.
```js
import '@stripe/stripe-js';
```
### Manually include the script tag
Manually add the Stripe.js script tag to the `<head>` of each page on your site.
If an existing script tag is already present, this module will not insert a new
one. When you call `loadStripe`, it will use the existing script tag.
```html
<!-- Somewhere in your site's <head> -->
<script src="https://js.stripe.com/v3" async></script>
```
### Importing `loadStripe` without side effects
If you would like to use `loadStripe` in your application, but defer loading the
Stripe.js script until `loadStripe` is first called, use the alternative
`@stripe/stripe-js/pure` import module:
```js
// CommonJS module import
const {loadStripe} = require('@stripe/stripe-js/pure');
// ES module import
import {loadStripe} from '@stripe/stripe-js/pure';
// Stripe.js will not be loaded until `loadStripe` is called
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
```
### Disabling advanced fraud detection signals
If you would like to
[disable advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection#disabling-advanced-fraud-detection)
altogether, use `loadStripe.setLoadParameters`:
```js
// CommonJS module import
const {loadStripe} = require('@stripe/stripe-js/pure');
// ES module import
import {loadStripe} from '@stripe/stripe-js/pure';
loadStripe.setLoadParameters({advancedFraudSignals: false});
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
```
The `loadStripe.setLoadParameters` function is only available when importing
`loadStripe` from `@stripe/stripe-js/pure`.
## Stripe.js Documentation
- [Stripe.js Docs](https://stripe.com/docs/stripe-js)
- [Stripe.js Reference](https://stripe.com/docs/js)
- [React Stripe.js Docs](https://stripe.com/docs/stripe-js/react)

View File

@@ -0,0 +1,61 @@
/**
* The BankAccount object.
*/
export interface BankAccount {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'bank_account';
/**
* The name of the person or business that owns the bank account.
*/
account_holder_name: string | null;
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type: string | null;
/**
* Name of the bank associated with the routing number (e.g., `WELLS FARGO`).
*/
bank_name: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string;
/**
* Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
*/
currency: string;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* The last four digits of the bank account number.
*/
last4: string;
/**
* The routing transit number for the bank account.
*/
routing_number: string | null;
/**
* For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated.
*
* For external accounts, possible values are `new` and `errored`. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated.
*/
status: string;
}

View File

@@ -0,0 +1,61 @@
/**
* The BankAccount object.
*/
export interface BankAccount {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'bank_account';
/**
* The name of the person or business that owns the bank account.
*/
account_holder_name: string | null;
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type: string | null;
/**
* Name of the bank associated with the routing number (e.g., `WELLS FARGO`).
*/
bank_name: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string;
/**
* Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
*/
currency: string;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* The last four digits of the bank account number.
*/
last4: string;
/**
* The routing transit number for the bank account.
*/
routing_number: string | null;
/**
* For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated.
*
* For external accounts, possible values are `new` and `errored`. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated.
*/
status: string;
}

130
node_modules/@stripe/stripe-js/dist/api/cards.d.mts generated vendored Normal file
View File

@@ -0,0 +1,130 @@
import {Metadata} from './shared';
/**
* The Card object.
*/
export interface Card {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'card';
/**
* City/District/Suburb/Town/Village.
*/
address_city: string | null;
/**
* Billing address country, if provided when creating card.
*/
address_country: string | null;
/**
* Address line 1 (Street address/PO Box/Company name).
*/
address_line1: string | null;
/**
* If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_line1_check: string | null;
/**
* Address line 2 (Apartment/Suite/Unit/Building).
*/
address_line2: string | null;
/**
* State/County/Province/Region.
*/
address_state: string | null;
/**
* ZIP or postal code.
*/
address_zip: string | null;
/**
* If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_zip_check: string | null;
/**
* Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
*/
brand: string;
/**
* Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
*/
country: string | null;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency?: string | null;
/**
* The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
*/
customer?: string | null;
/**
* If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
cvc_check: string | null;
/**
* (For tokenized numbers only.) The last four digits of the device account number.
*/
dynamic_last4: string | null;
/**
* Two-digit number representing the card's expiration month.
*/
exp_month: number;
/**
* Four-digit number representing the card's expiration year.
*/
exp_year: number;
/**
* Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example.
*/
fingerprint?: string | null;
/**
* Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
*/
funding: string;
/**
* The last four digits of the card.
*/
last4: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Metadata;
/**
* Cardholder name.
*/
name: string | null;
/**
* If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`.
*/
tokenization_method: string | null;
}
export namespace Card {
export type AvailablePayoutMethod = 'instant' | 'standard';
}

130
node_modules/@stripe/stripe-js/dist/api/cards.d.ts generated vendored Normal file
View File

@@ -0,0 +1,130 @@
import {Metadata} from './shared';
/**
* The Card object.
*/
export interface Card {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'card';
/**
* City/District/Suburb/Town/Village.
*/
address_city: string | null;
/**
* Billing address country, if provided when creating card.
*/
address_country: string | null;
/**
* Address line 1 (Street address/PO Box/Company name).
*/
address_line1: string | null;
/**
* If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_line1_check: string | null;
/**
* Address line 2 (Apartment/Suite/Unit/Building).
*/
address_line2: string | null;
/**
* State/County/Province/Region.
*/
address_state: string | null;
/**
* ZIP or postal code.
*/
address_zip: string | null;
/**
* If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_zip_check: string | null;
/**
* Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
*/
brand: string;
/**
* Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
*/
country: string | null;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency?: string | null;
/**
* The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
*/
customer?: string | null;
/**
* If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`.
*/
cvc_check: string | null;
/**
* (For tokenized numbers only.) The last four digits of the device account number.
*/
dynamic_last4: string | null;
/**
* Two-digit number representing the card's expiration month.
*/
exp_month: number;
/**
* Four-digit number representing the card's expiration year.
*/
exp_year: number;
/**
* Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example.
*/
fingerprint?: string | null;
/**
* Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
*/
funding: string;
/**
* The last four digits of the card.
*/
last4: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Metadata;
/**
* Cardholder name.
*/
name: string | null;
/**
* If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`.
*/
tokenization_method: string | null;
}
export namespace Card {
export type AvailablePayoutMethod = 'instant' | 'standard';
}

View File

@@ -0,0 +1,188 @@
import {StripeElements} from '../stripe-js';
import {Address} from './shared';
import {PaymentMethod, PaymentMethodCreateParams} from './payment-methods';
import {PaymentIntent} from './payment-intents';
/**
* The ConfirmationToken object.
*/
export interface ConfirmationToken {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'confirmation_token';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. Measured in seconds since the Unix epoch.
*/
expires_at: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
*/
payment_intent: null | string;
/**
* Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
*/
payment_method_preview: ConfirmationToken.PaymentMethodPreview;
/**
* The URL your customer is redirected to after they complete the payment.
*/
return_url: string | null;
/**
* Indicates that you intend to make future payments with this ConfirmationTokens payment method.
*
* The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntents Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*/
setup_future_usage: PaymentIntent.SetupFutureUsage | null;
/**
* ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
*/
setup_intent: null | string;
/**
* Shipping information for this ConfirmationToken.
*/
shipping: PaymentIntent.Shipping | null;
/**
* Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
*/
use_stripe_sdk: boolean;
}
export interface ConfirmationTokenCreateParams {
/**
* Data used to create a new payment method.
*
*/
payment_method_data?: {
/**
* The customer's billing details.
*/
billing_details?: PaymentMethodCreateParams.BillingDetails;
/**
* Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
*/
allow_redisplay?: 'always' | 'limited' | 'unspecified';
};
/**
* Shipping information.
*/
shipping?: ConfirmationToken.Shipping;
/**
* The url your customer will be directed to after they complete authentication.
*/
return_url?: string | null;
}
export interface CreateConfirmationToken {
/**
* The Elements instance.
*
* @docs https://stripe.com/docs/js/elements_object
*/
elements: StripeElements;
/**
* Parameters for creating the ConfirmationToken.
* Details collected by Elements will be overriden by values passed here.
*/
params?: ConfirmationTokenCreateParams;
}
export namespace ConfirmationToken {
export interface Shipping {
/**
* Recipient address.
*/
address: Address;
/**
* Recipient name.
*/
name: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
}
export interface PaymentMethodPreview {
/**
* The type of the PaymentMethod. An additional hash is included on payment_method_preview with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
type: string;
billing_details: PaymentMethod.BillingDetails;
acss_debit?: PaymentMethod.AcssDebit;
affirm?: PaymentMethod.Affirm;
afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
au_becs_debit?: PaymentMethod.AuBecsDebit;
card?: PaymentMethod.Card;
card_present?: PaymentMethod.CardPresent;
eps?: PaymentMethod.Eps;
fpx?: PaymentMethod.Fpx;
grabpay?: PaymentMethod.GrabPay;
ideal?: PaymentMethod.Ideal;
p24?: PaymentMethod.P24;
sepa_debit?: PaymentMethod.SepaDebit;
us_bank_account?: PaymentMethod.UsBankAccount;
}
export interface MandateData {
customer_acceptance: {
type: 'online';
online?: {
/**
* The IP address from which the Mandate was accepted by the customer.
*/
ip_address: string;
/**
* The user agent of the browser from which the Mandate was accepted by the customer.
*/
user_agent: string;
};
};
}
}

View File

@@ -0,0 +1,188 @@
import {StripeElements} from '../stripe-js';
import {Address} from './shared';
import {PaymentMethod, PaymentMethodCreateParams} from './payment-methods';
import {PaymentIntent} from './payment-intents';
/**
* The ConfirmationToken object.
*/
export interface ConfirmationToken {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'confirmation_token';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. Measured in seconds since the Unix epoch.
*/
expires_at: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
*/
payment_intent: null | string;
/**
* Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
*/
payment_method_preview: ConfirmationToken.PaymentMethodPreview;
/**
* The URL your customer is redirected to after they complete the payment.
*/
return_url: string | null;
/**
* Indicates that you intend to make future payments with this ConfirmationTokens payment method.
*
* The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntents Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*/
setup_future_usage: PaymentIntent.SetupFutureUsage | null;
/**
* ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
*/
setup_intent: null | string;
/**
* Shipping information for this ConfirmationToken.
*/
shipping: PaymentIntent.Shipping | null;
/**
* Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions.
*/
use_stripe_sdk: boolean;
}
export interface ConfirmationTokenCreateParams {
/**
* Data used to create a new payment method.
*
*/
payment_method_data?: {
/**
* The customer's billing details.
*/
billing_details?: PaymentMethodCreateParams.BillingDetails;
/**
* Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
*/
allow_redisplay?: 'always' | 'limited' | 'unspecified';
};
/**
* Shipping information.
*/
shipping?: ConfirmationToken.Shipping;
/**
* The url your customer will be directed to after they complete authentication.
*/
return_url?: string | null;
}
export interface CreateConfirmationToken {
/**
* The Elements instance.
*
* @docs https://stripe.com/docs/js/elements_object
*/
elements: StripeElements;
/**
* Parameters for creating the ConfirmationToken.
* Details collected by Elements will be overriden by values passed here.
*/
params?: ConfirmationTokenCreateParams;
}
export namespace ConfirmationToken {
export interface Shipping {
/**
* Recipient address.
*/
address: Address;
/**
* Recipient name.
*/
name: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
}
export interface PaymentMethodPreview {
/**
* The type of the PaymentMethod. An additional hash is included on payment_method_preview with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
type: string;
billing_details: PaymentMethod.BillingDetails;
acss_debit?: PaymentMethod.AcssDebit;
affirm?: PaymentMethod.Affirm;
afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
au_becs_debit?: PaymentMethod.AuBecsDebit;
card?: PaymentMethod.Card;
card_present?: PaymentMethod.CardPresent;
eps?: PaymentMethod.Eps;
fpx?: PaymentMethod.Fpx;
grabpay?: PaymentMethod.GrabPay;
ideal?: PaymentMethod.Ideal;
p24?: PaymentMethod.P24;
sepa_debit?: PaymentMethod.SepaDebit;
us_bank_account?: PaymentMethod.UsBankAccount;
}
export interface MandateData {
customer_acceptance: {
type: 'online';
online?: {
/**
* The IP address from which the Mandate was accepted by the customer.
*/
ip_address: string;
/**
* The user agent of the browser from which the Mandate was accepted by the customer.
*/
user_agent: string;
};
};
}
}

View File

@@ -0,0 +1,232 @@
type SupportedPaymentMethodType = 'us_bank_account' | 'link';
interface CommonBalance {
/**
* The time that the external institution calculated this balance. Measured
* in seconds since the Unix epoch.
*/
as_of: number;
/**
* The balances owed to (or by) the account holder.
*
* Each key is a three-letter ISO currency code, in lowercase.
*
* Each value is a integer amount. A positive amount indicates money owed to
* the account holder. A negative amount indicates money owed by the account
* holder.
*/
current: {
[key: string]: number | undefined;
};
}
interface CashBalance {
/**
* Information on a `cash` balance. Only set if `balance.type` is `cash`.
*/
cash: {
/**
* The funds available to the account holder. Typically this is the
* current balance less any holds.
*
* Each key is a three-letter ISO currency code, in lowercase.
*
* Each value is a integer amount. A positive amount indicates money owed
* to the account holder. A negative amount indicates money owed by the
* account holder.
*/
available: {[key: string]: number | undefined};
};
type: 'cash';
}
interface CreditBalance {
/**
* Information on a `credit` balance. Only set if `balance.type` is `credit`.
*/
credit: {
/**
* The credit that has been used by the account holder.
*
* Each key is a three-letter ISO currency code, in lowercase
*
* Each value is a integer amount. A positive amount indicates money owed
* to the account holder. A negative amount indicates money owed by the
* account holder.
*/
used: {[key: string]: number | undefined};
};
type: 'credit';
}
type Balance = (CommonBalance & CashBalance) | (CommonBalance & CreditBalance);
interface BalanceRefresh {
/**
* The status of the Balance Refresh
*/
status: 'pending' | 'succeeded' | 'failed';
/**
* Time at which the Balance Refresh was attempted. Measured in seconds since the Unix epoch.
*/
last_attempted_at: number;
}
interface OwnershipRefresh {
/**
* The status of the Ownership Refresh
*/
status: 'pending' | 'succeeded' | 'failed';
/**
* Time at which the Ownersip Refresh was attempted. Measured in seconds since the Unix epoch.
*/
last_attempted_at: number;
}
/**
* The Financial Connections Session object
*/
export interface FinancialConnectionsSession {
/**
* Unique identifier for the object.
*/
id: string;
/**
* List of accounts collected by the Session
*/
accounts: FinancialConnectionsSession.Account[];
/**
* Filters applied to the Session
*/
filters?: FinancialConnectionsSession.Filters;
/**
* List of data permissions requested in the Session
*/
permissions?: FinancialConnectionsSession.Permission[];
/**
* For webview integrations only. The user will be redirected to this URL to return to your app.
*/
return_url?: string;
}
export namespace FinancialConnectionsSession {
/**
* The Financial Connections Account object
*/
export interface Account {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. `'linked_account'` is present for backwards-compatibility.
*/
object: 'linked_account' | 'financial_connections.account';
/**
* The balance for this Account
*/
balance: null | Balance;
/**
* The most recent Balance Refresh for this Account
*/
balance_refresh: null | BalanceRefresh;
/**
* The type of the account.
*/
category: 'cash' | 'credit' | 'investment' | 'other';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* A human-readable name that has been assigned to this account, either by the account holder or by the institution.
*/
display_name: string;
/**
* The name of the institution that holds this account.
*/
institution_name: string;
/**
* The last 4 digits of the account number. If present, this will be 4 numeric characters.
*/
last4: string | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* The ID of this account's Ownership resource.
*/
ownership: string | null;
/**
* The most recent Ownership Refresh for this Account
*/
ownership_refresh: null | OwnershipRefresh;
/**
* Permissions granted on this Account
*/
permissions: Permission[];
/**
* The status of the Account
*/
status: 'active' | 'inactive' | 'disconnected';
/**
* The sub-category of the Account
*/
subcategory:
| 'checking'
| 'savings'
| 'mortgage'
| 'line_of_credit'
| 'credit_card'
| 'other';
/**
* The types of Payment Methods which can be set up by this Account
*/
supported_payment_method_types: SupportedPaymentMethodType[];
}
/**
* Filters to restrict the kinds of accounts to collect.
*/
export interface Filters {
/**
* List of countries from which to collect accounts.
*/
countries?: string[];
}
/**
* Data features to which access can be requested
*/
export type Permission =
| 'payment_method'
| 'balances'
| 'transactions'
| 'ownership'
| 'account_numbers';
}

View File

@@ -0,0 +1,232 @@
type SupportedPaymentMethodType = 'us_bank_account' | 'link';
interface CommonBalance {
/**
* The time that the external institution calculated this balance. Measured
* in seconds since the Unix epoch.
*/
as_of: number;
/**
* The balances owed to (or by) the account holder.
*
* Each key is a three-letter ISO currency code, in lowercase.
*
* Each value is a integer amount. A positive amount indicates money owed to
* the account holder. A negative amount indicates money owed by the account
* holder.
*/
current: {
[key: string]: number | undefined;
};
}
interface CashBalance {
/**
* Information on a `cash` balance. Only set if `balance.type` is `cash`.
*/
cash: {
/**
* The funds available to the account holder. Typically this is the
* current balance less any holds.
*
* Each key is a three-letter ISO currency code, in lowercase.
*
* Each value is a integer amount. A positive amount indicates money owed
* to the account holder. A negative amount indicates money owed by the
* account holder.
*/
available: {[key: string]: number | undefined};
};
type: 'cash';
}
interface CreditBalance {
/**
* Information on a `credit` balance. Only set if `balance.type` is `credit`.
*/
credit: {
/**
* The credit that has been used by the account holder.
*
* Each key is a three-letter ISO currency code, in lowercase
*
* Each value is a integer amount. A positive amount indicates money owed
* to the account holder. A negative amount indicates money owed by the
* account holder.
*/
used: {[key: string]: number | undefined};
};
type: 'credit';
}
type Balance = (CommonBalance & CashBalance) | (CommonBalance & CreditBalance);
interface BalanceRefresh {
/**
* The status of the Balance Refresh
*/
status: 'pending' | 'succeeded' | 'failed';
/**
* Time at which the Balance Refresh was attempted. Measured in seconds since the Unix epoch.
*/
last_attempted_at: number;
}
interface OwnershipRefresh {
/**
* The status of the Ownership Refresh
*/
status: 'pending' | 'succeeded' | 'failed';
/**
* Time at which the Ownersip Refresh was attempted. Measured in seconds since the Unix epoch.
*/
last_attempted_at: number;
}
/**
* The Financial Connections Session object
*/
export interface FinancialConnectionsSession {
/**
* Unique identifier for the object.
*/
id: string;
/**
* List of accounts collected by the Session
*/
accounts: FinancialConnectionsSession.Account[];
/**
* Filters applied to the Session
*/
filters?: FinancialConnectionsSession.Filters;
/**
* List of data permissions requested in the Session
*/
permissions?: FinancialConnectionsSession.Permission[];
/**
* For webview integrations only. The user will be redirected to this URL to return to your app.
*/
return_url?: string;
}
export namespace FinancialConnectionsSession {
/**
* The Financial Connections Account object
*/
export interface Account {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. `'linked_account'` is present for backwards-compatibility.
*/
object: 'linked_account' | 'financial_connections.account';
/**
* The balance for this Account
*/
balance: null | Balance;
/**
* The most recent Balance Refresh for this Account
*/
balance_refresh: null | BalanceRefresh;
/**
* The type of the account.
*/
category: 'cash' | 'credit' | 'investment' | 'other';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* A human-readable name that has been assigned to this account, either by the account holder or by the institution.
*/
display_name: string;
/**
* The name of the institution that holds this account.
*/
institution_name: string;
/**
* The last 4 digits of the account number. If present, this will be 4 numeric characters.
*/
last4: string | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* The ID of this account's Ownership resource.
*/
ownership: string | null;
/**
* The most recent Ownership Refresh for this Account
*/
ownership_refresh: null | OwnershipRefresh;
/**
* Permissions granted on this Account
*/
permissions: Permission[];
/**
* The status of the Account
*/
status: 'active' | 'inactive' | 'disconnected';
/**
* The sub-category of the Account
*/
subcategory:
| 'checking'
| 'savings'
| 'mortgage'
| 'line_of_credit'
| 'credit_card'
| 'other';
/**
* The types of Payment Methods which can be set up by this Account
*/
supported_payment_method_types: SupportedPaymentMethodType[];
}
/**
* Filters to restrict the kinds of accounts to collect.
*/
export interface Filters {
/**
* List of countries from which to collect accounts.
*/
countries?: string[];
}
/**
* Data features to which access can be requested
*/
export type Permission =
| 'payment_method'
| 'balances'
| 'transactions'
| 'ownership'
| 'account_numbers';
}

12
node_modules/@stripe/stripe-js/dist/api/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export * from './shared';
export * from './payment-methods';
export * from './confirmation-tokens';
export * from './payment-intents';
export * from './orders';
export * from './setup-intents';
export * from './sources';
export * from './tokens';
export * from './bank-accounts';
export * from './cards';
export * from './verification-sessions';
export * from './financial-connections';

12
node_modules/@stripe/stripe-js/dist/api/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export * from './shared';
export * from './payment-methods';
export * from './confirmation-tokens';
export * from './payment-intents';
export * from './orders';
export * from './setup-intents';
export * from './sources';
export * from './tokens';
export * from './bank-accounts';
export * from './cards';
export * from './verification-sessions';
export * from './financial-connections';

122
node_modules/@stripe/stripe-js/dist/api/orders.d.mts generated vendored Normal file
View File

@@ -0,0 +1,122 @@
import {Address} from './shared';
import {PaymentIntent} from './payment-intents';
/**
* The Order object.
*/
export interface Order {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'order';
/**
* Total order cost after discounts and taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
*/
amount_total: number;
/**
* Order cost before any discounts or taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
*/
amount_subtotal: number;
/**
* Customer billing details associated with the order.
*/
billing_details: Order.Billing | null;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Customer shipping information associated with the order.
*/
shipping_details: Order.Shipping | null;
/**
* Payment information associated with the order.
*/
payment: Order.Payment;
/**
* The overall status of the order.
*/
status: Order.Status;
}
export namespace Order {
export interface Billing {
/**
* Billing address for the order.
*/
address?: Address;
/**
* Email address for the order.
*/
email?: string | null;
/**
* Full name for the order.
*/
name?: string | null;
/**
* Billing phone number for the order (including extension).
*/
phone?: string | null;
}
export interface Shipping {
/**
* Recipient shipping address. Required if the order includes products that are shippable.
*/
address?: Address;
/**
* Recipient name.
*/
name?: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
}
export interface Payment {
/**
* Payment intent associated with this order. Null when the order is `open`.
*/
payment_intent?: PaymentIntent | null;
/**
* The status of the underlying payment associated with this order, if any. Null when the order is `open`.
*/
status?: PaymentIntent.Status | null;
}
export type Status =
| 'open'
| 'submitted'
| 'processing'
| 'complete'
| 'canceled';
}

122
node_modules/@stripe/stripe-js/dist/api/orders.d.ts generated vendored Normal file
View File

@@ -0,0 +1,122 @@
import {Address} from './shared';
import {PaymentIntent} from './payment-intents';
/**
* The Order object.
*/
export interface Order {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'order';
/**
* Total order cost after discounts and taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
*/
amount_total: number;
/**
* Order cost before any discounts or taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
*/
amount_subtotal: number;
/**
* Customer billing details associated with the order.
*/
billing_details: Order.Billing | null;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Customer shipping information associated with the order.
*/
shipping_details: Order.Shipping | null;
/**
* Payment information associated with the order.
*/
payment: Order.Payment;
/**
* The overall status of the order.
*/
status: Order.Status;
}
export namespace Order {
export interface Billing {
/**
* Billing address for the order.
*/
address?: Address;
/**
* Email address for the order.
*/
email?: string | null;
/**
* Full name for the order.
*/
name?: string | null;
/**
* Billing phone number for the order (including extension).
*/
phone?: string | null;
}
export interface Shipping {
/**
* Recipient shipping address. Required if the order includes products that are shippable.
*/
address?: Address;
/**
* Recipient name.
*/
name?: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
}
export interface Payment {
/**
* Payment intent associated with this order. Null when the order is `open`.
*/
payment_intent?: PaymentIntent | null;
/**
* The status of the underlying payment associated with this order, if any. Null when the order is `open`.
*/
status?: PaymentIntent.Status | null;
}
export type Status =
| 'open'
| 'submitted'
| 'processing'
| 'complete'
| 'canceled';
}

View File

@@ -0,0 +1,360 @@
import {Address, AddressParam} from './shared';
import {PaymentMethod} from './payment-methods';
/**
* The PaymentIntent object.
*/
export interface PaymentIntent {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_intent';
/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
*/
amount: number;
/**
* Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
*/
canceled_at: number | null;
/**
* Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).
*/
cancellation_reason: PaymentIntent.CancellationReason | null;
/**
* Controls when the funds will be captured from the customer's account.
*/
capture_method: PaymentIntent.CaptureMethod;
/**
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*
* Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment) and learn about how `client_secret` should be handled.
*/
client_secret: string | null;
confirmation_method: PaymentIntent.ConfirmationMethod;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string | null;
/**
* The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
*/
last_payment_error: PaymentIntent.LastPaymentError | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
*/
next_action: PaymentIntent.NextAction | null;
/**
* ID of the payment method used in this PaymentIntent, or the PaymentMethod itself if this field is expanded.
*/
payment_method: string | null | PaymentMethod;
/**
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
*/
payment_method_types: Array<string>;
/**
* Email address that the receipt for the resulting payment will be sent to.
*/
receipt_email: string | null;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes.
*
* For more, learn to [save card details after a payment](https://stripe.com/docs/payments/save-after-payment).
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*/
setup_future_usage: PaymentIntent.SetupFutureUsage | null;
/**
* Shipping information for this PaymentIntent.
*/
shipping: PaymentIntent.Shipping | null;
/**
* Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses).
*/
status: PaymentIntent.Status;
}
export namespace PaymentIntent {
export type CancellationReason =
| 'abandoned'
| 'automatic'
| 'duplicate'
| 'failed_invoice'
| 'fraudulent'
| 'requested_by_customer'
| 'void_invoice';
export type CaptureMethod = 'automatic' | 'manual';
export type ConfirmationMethod = 'automatic' | 'manual';
export interface LastPaymentError {
/**
* For card errors, the ID of the failed charge.
*/
charge?: string;
/**
* For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
*/
code?: string;
/**
* For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
*/
decline_code?: string;
/**
* A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
*/
doc_url?: string;
/**
* A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
*/
message?: string;
/**
* If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
*/
param?: string;
payment_method?: PaymentMethod;
/**
* The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error`
*/
type: LastPaymentError.Type;
}
export namespace LastPaymentError {
export type Type =
| 'api_connection_error'
| 'api_error'
| 'authentication_error'
| 'card_error'
| 'idempotency_error'
| 'invalid_request_error'
| 'rate_limit_error';
}
export interface NextAction {
/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `wechat_pay_display_qr_code`, or `verify_with_microdeposits`.
*/
type: string;
/**
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
*/
redirect_to_url?: NextAction.RedirectToUrl;
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
*/
use_stripe_sdk?: NextAction.UseStripeSdk;
/**
* Wechat Pay display qrcode
*/
wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode;
/**
* Contains details describing microdeposits verification flow.
*/
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
}
export namespace NextAction {
export interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate the payment.
*/
url: string | null;
}
export interface WechatPayDisplayQrCode {
/**
* Render and display `paymentIntent.next_action.wechat_pay_display_qr_code.data` as a QR code on your checkout page.
*/
data: string;
/**
* Use `paymentIntent.next_action.wechat_pay_display_qr_code.image_data_url` as an image source.
*/
image_data_url: string;
}
export interface UseStripeSdk {}
export interface VerifyWithMicrodeposits {
/**
* The timestamp when the microdeposits are expected to land.
*/
arrival_date: number;
/**
* The URL for the hosted verification page, which allows customers to verify their bank account.
*/
hosted_verification_url: string;
/**
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
*/
microdeposit_type: string | null;
}
}
export type SetupFutureUsage = 'off_session' | 'on_session';
export interface Shipping {
address?: Address;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
carrier?: string | null;
/**
* Recipient name.
*/
name?: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
*/
tracking_number?: string | null;
}
export type Status =
| 'canceled'
| 'processing'
| 'requires_action'
| 'requires_capture'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
}
export interface PaymentIntentConfirmParams {
/**
* This hash contains details about the Mandate to create
*/
mandate_data?: {[k: string]: any};
/**
* Email address that the receipt for the resulting payment will be sent to.
*/
receipt_email?: string | '';
/**
* The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
* If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
* This parameter is only used for cards and other redirect-based payment methods.
*/
return_url?: string;
/**
* If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save the payment method to the customer. Defaults to `false`.
*
* If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error.
*
* _Note that saving a payment method using this parameter does not guarantee that the payment method can be charged._ To ensure that only payment methods which can be charged are saved to a customer, you can [manually save](https://stripe.com/docs/api/customers/create#create_customer-source) the payment method in response to the [`payment_intent.succeeded` webhook](https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded).
*/
save_payment_method?: boolean;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes.
*
* Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow.
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*
* If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.
*/
setup_future_usage?: PaymentIntentConfirmParams.SetupFutureUsage | null;
/**
* Shipping information for this PaymentIntent.
*/
shipping?: PaymentIntentConfirmParams.Shipping | null;
}
export namespace PaymentIntentConfirmParams {
export type SetupFutureUsage = 'off_session' | 'on_session';
export interface Shipping {
/**
* Shipping address.
*/
address: AddressParam;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
carrier?: string;
/**
* Recipient name.
*/
name: string;
/**
* Recipient phone (including extension).
*/
phone?: string;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
*/
tracking_number?: string;
}
}

View File

@@ -0,0 +1,360 @@
import {Address, AddressParam} from './shared';
import {PaymentMethod} from './payment-methods';
/**
* The PaymentIntent object.
*/
export interface PaymentIntent {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_intent';
/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
*/
amount: number;
/**
* Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
*/
canceled_at: number | null;
/**
* Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).
*/
cancellation_reason: PaymentIntent.CancellationReason | null;
/**
* Controls when the funds will be captured from the customer's account.
*/
capture_method: PaymentIntent.CaptureMethod;
/**
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*
* Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment) and learn about how `client_secret` should be handled.
*/
client_secret: string | null;
confirmation_method: PaymentIntent.ConfirmationMethod;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string | null;
/**
* The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
*/
last_payment_error: PaymentIntent.LastPaymentError | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
*/
next_action: PaymentIntent.NextAction | null;
/**
* ID of the payment method used in this PaymentIntent, or the PaymentMethod itself if this field is expanded.
*/
payment_method: string | null | PaymentMethod;
/**
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
*/
payment_method_types: Array<string>;
/**
* Email address that the receipt for the resulting payment will be sent to.
*/
receipt_email: string | null;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes.
*
* For more, learn to [save card details after a payment](https://stripe.com/docs/payments/save-after-payment).
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*/
setup_future_usage: PaymentIntent.SetupFutureUsage | null;
/**
* Shipping information for this PaymentIntent.
*/
shipping: PaymentIntent.Shipping | null;
/**
* Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses).
*/
status: PaymentIntent.Status;
}
export namespace PaymentIntent {
export type CancellationReason =
| 'abandoned'
| 'automatic'
| 'duplicate'
| 'failed_invoice'
| 'fraudulent'
| 'requested_by_customer'
| 'void_invoice';
export type CaptureMethod = 'automatic' | 'manual';
export type ConfirmationMethod = 'automatic' | 'manual';
export interface LastPaymentError {
/**
* For card errors, the ID of the failed charge.
*/
charge?: string;
/**
* For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
*/
code?: string;
/**
* For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
*/
decline_code?: string;
/**
* A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
*/
doc_url?: string;
/**
* A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
*/
message?: string;
/**
* If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
*/
param?: string;
payment_method?: PaymentMethod;
/**
* The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error`
*/
type: LastPaymentError.Type;
}
export namespace LastPaymentError {
export type Type =
| 'api_connection_error'
| 'api_error'
| 'authentication_error'
| 'card_error'
| 'idempotency_error'
| 'invalid_request_error'
| 'rate_limit_error';
}
export interface NextAction {
/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `wechat_pay_display_qr_code`, or `verify_with_microdeposits`.
*/
type: string;
/**
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
*/
redirect_to_url?: NextAction.RedirectToUrl;
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
*/
use_stripe_sdk?: NextAction.UseStripeSdk;
/**
* Wechat Pay display qrcode
*/
wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode;
/**
* Contains details describing microdeposits verification flow.
*/
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
}
export namespace NextAction {
export interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate the payment.
*/
url: string | null;
}
export interface WechatPayDisplayQrCode {
/**
* Render and display `paymentIntent.next_action.wechat_pay_display_qr_code.data` as a QR code on your checkout page.
*/
data: string;
/**
* Use `paymentIntent.next_action.wechat_pay_display_qr_code.image_data_url` as an image source.
*/
image_data_url: string;
}
export interface UseStripeSdk {}
export interface VerifyWithMicrodeposits {
/**
* The timestamp when the microdeposits are expected to land.
*/
arrival_date: number;
/**
* The URL for the hosted verification page, which allows customers to verify their bank account.
*/
hosted_verification_url: string;
/**
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
*/
microdeposit_type: string | null;
}
}
export type SetupFutureUsage = 'off_session' | 'on_session';
export interface Shipping {
address?: Address;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
carrier?: string | null;
/**
* Recipient name.
*/
name?: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
*/
tracking_number?: string | null;
}
export type Status =
| 'canceled'
| 'processing'
| 'requires_action'
| 'requires_capture'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
}
export interface PaymentIntentConfirmParams {
/**
* This hash contains details about the Mandate to create
*/
mandate_data?: {[k: string]: any};
/**
* Email address that the receipt for the resulting payment will be sent to.
*/
receipt_email?: string | '';
/**
* The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site.
* If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
* This parameter is only used for cards and other redirect-based payment methods.
*/
return_url?: string;
/**
* If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save the payment method to the customer. Defaults to `false`.
*
* If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error.
*
* _Note that saving a payment method using this parameter does not guarantee that the payment method can be charged._ To ensure that only payment methods which can be charged are saved to a customer, you can [manually save](https://stripe.com/docs/api/customers/create#create_customer-source) the payment method in response to the [`payment_intent.succeeded` webhook](https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded).
*/
save_payment_method?: boolean;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes.
*
* Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow.
*
* Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer.
*
* If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.
*/
setup_future_usage?: PaymentIntentConfirmParams.SetupFutureUsage | null;
/**
* Shipping information for this PaymentIntent.
*/
shipping?: PaymentIntentConfirmParams.Shipping | null;
}
export namespace PaymentIntentConfirmParams {
export type SetupFutureUsage = 'off_session' | 'on_session';
export interface Shipping {
/**
* Shipping address.
*/
address: AddressParam;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
carrier?: string;
/**
* Recipient name.
*/
name: string;
/**
* Recipient phone (including extension).
*/
phone?: string;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
*/
tracking_number?: string;
}
}

View File

@@ -0,0 +1,467 @@
import {StripeElement, StripeElements} from '../stripe-js';
import {Metadata, MetadataParam, Address} from './shared';
/**
* The PaymentMethod object.
*/
export interface PaymentMethod {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_method';
billing_details: PaymentMethod.BillingDetails;
card?: PaymentMethod.Card;
card_present?: PaymentMethod.CardPresent;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
*/
customer: string | null;
eps?: PaymentMethod.Eps;
fpx?: PaymentMethod.Fpx;
grabpay?: PaymentMethod.GrabPay;
ideal?: PaymentMethod.Ideal;
p24?: PaymentMethod.P24;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Metadata;
sepa_debit?: PaymentMethod.SepaDebit;
/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
type: string;
affirm?: PaymentMethod.Affirm;
afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
acss_debit?: PaymentMethod.AcssDebit;
au_becs_debit?: PaymentMethod.AuBecsDebit;
us_bank_account?: PaymentMethod.UsBankAccount;
}
export namespace PaymentMethod {
export interface AuBecsDebit {
/**
* Bank State Branch
*/
bsb_number: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four characters of the account number.
*/
last4: string | null;
}
export interface BillingDetails {
/**
* Billing address.
*/
address: Address | null;
/**
* Email address.
*/
email: string | null;
/**
* Full name.
*/
name: string | null;
/**
* Billing phone number (including extension).
*/
phone: string | null;
}
export interface Card {
/**
* Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
*/
brand: string;
/**
* Checks on Card address and CVC if provided.
*/
checks: Card.Checks | null;
/**
* Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
*/
country: string | null;
/**
* Two-digit number representing the card's expiration month.
*/
exp_month: number;
/**
* Four-digit number representing the card's expiration year.
*/
exp_year: number;
/**
* Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number.
*/
fingerprint?: string | null;
/**
* Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
*/
funding: string;
/**
* The last four digits of the card.
*/
last4: string;
/**
* Contains information about card networks that can be used to process the payment.
*/
networks: {
/**
* The preferred network for co-branded cards.
*/
preferred: string | null;
/**
* All available networks for the card.
*/
available: string[];
} | null;
/**
* Contains details on how this Card maybe be used for 3D Secure authentication.
*/
three_d_secure_usage: Card.ThreeDSecureUsage | null;
/**
* If this Card is part of a card wallet, this contains the details of the card wallet.
*/
wallet: null | {[k: string]: any};
}
export namespace Card {
export interface Checks {
/**
* If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_line1_check: string | null;
/**
* If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_postal_code_check: string | null;
/**
* If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
cvc_check: string | null;
}
export interface ThreeDSecureUsage {
/**
* Whether 3D Secure is supported on this card.
*/
supported: boolean;
}
}
export interface CardPresent {}
export interface Eps {
/**
* The customer's bank.
*/
bank: string;
}
export interface Fpx {
/**
* The customer's bank.
*/
bank: string;
}
export interface GrabPay {}
export interface Ideal {
/**
* The customer's bank, if provided.
*/
bank: string | null;
/**
* The Bank Identifier Code of the customer's bank, if the bank was provided.
*/
bic: string | null;
}
export interface P24 {
/**
* The customer's bank.
*/
bank: string;
}
export interface SepaDebit {
/**
* Bank code of bank associated with the bank account.
*/
bank_code: string | null;
/**
* Branch code of bank associated with the bank account.
*/
branch_code: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four characters of the IBAN.
*/
last4: string | null;
}
export interface Affirm {}
export interface AfterpayClearpay {}
export interface AcssDebit {
/**
* Customers bank account number.
*/
account_number: string;
/**
* Institution number of the customers bank.
*/
institution_number: string;
/**
* Transit number of the customers bank.
*/
transit_number: string;
}
export interface UsBankAccount {
/**
* Customers bank account number.
*/
account_number: string;
/**
* The routing transit number for the bank account.
*/
routing_number: string;
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type: string;
/**
* Account type: checkings or savings. Defaults to checking if omitted.
*/
account_type: string;
/**
* The name of the bank.
*/
bank_name: string;
/**
* The ID of the Financial Connections Account used to create the payment method.
*/
financial_connections_account: string;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string;
/**
* Last four digits of the bank account number.
*/
last4: string;
/**
* Contains information about US bank account networks that can be used.
*/
networks: {
/**
* The preferred network.
*/
preferred: string;
/**
* All supported networks.
*/
supported: string[];
};
}
}
export interface PaymentMethodCreateParams {
/**
* Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
*/
billing_details?: PaymentMethodCreateParams.BillingDetails;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
/**
* The PaymentMethod to share.
*/
payment_method?: string;
/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Required unless `payment_method` is specified (see the [Cloning PaymentMethods](https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods) guide)
*/
type?: string;
}
export interface CreatePaymentMethodFromElements {
/**
* The Elements instance
*
* @docs https://stripe.com/docs/js/elements_object
*/
elements: StripeElements;
/**
* Parameters that will be passed on to the PaymentMethod API
*
* @docs https://stripe.com/docs/api/payment_methods/create
*/
params?: PaymentMethodCreateParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
}
export interface CreatePaymentMethodFromElement {
/**
* The specific Element used to collect payment details
*
* @docs https://stripe.com/docs/js/element
*/
element: StripeElement;
/**
* Parameters that will be passed on to the PaymentMethod API
*
* @docs https://stripe.com/docs/api/payment_methods/create
*/
params?: PaymentMethodCreateParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
}
export namespace PaymentMethodCreateParams {
export interface BillingDetails {
/**
* Billing address.
*/
address?: BillingDetails.Address;
/**
* Email address.
*/
email?: string | null;
/**
* Full name.
*/
name?: string | null;
/**
* Billing phone number (including extension).
*/
phone?: string | null;
}
export namespace BillingDetails {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string | null;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string | null;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string | null;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string | null;
/**
* ZIP or postal code.
*/
postal_code?: string | null;
/**
* State, county, province, or region.
*/
state?: string | null;
}
}
}

View File

@@ -0,0 +1,467 @@
import {StripeElement, StripeElements} from '../stripe-js';
import {Metadata, MetadataParam, Address} from './shared';
/**
* The PaymentMethod object.
*/
export interface PaymentMethod {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_method';
billing_details: PaymentMethod.BillingDetails;
card?: PaymentMethod.Card;
card_present?: PaymentMethod.CardPresent;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
*/
customer: string | null;
eps?: PaymentMethod.Eps;
fpx?: PaymentMethod.Fpx;
grabpay?: PaymentMethod.GrabPay;
ideal?: PaymentMethod.Ideal;
p24?: PaymentMethod.P24;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Metadata;
sepa_debit?: PaymentMethod.SepaDebit;
/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
type: string;
affirm?: PaymentMethod.Affirm;
afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
acss_debit?: PaymentMethod.AcssDebit;
au_becs_debit?: PaymentMethod.AuBecsDebit;
us_bank_account?: PaymentMethod.UsBankAccount;
}
export namespace PaymentMethod {
export interface AuBecsDebit {
/**
* Bank State Branch
*/
bsb_number: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four characters of the account number.
*/
last4: string | null;
}
export interface BillingDetails {
/**
* Billing address.
*/
address: Address | null;
/**
* Email address.
*/
email: string | null;
/**
* Full name.
*/
name: string | null;
/**
* Billing phone number (including extension).
*/
phone: string | null;
}
export interface Card {
/**
* Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
*/
brand: string;
/**
* Checks on Card address and CVC if provided.
*/
checks: Card.Checks | null;
/**
* Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
*/
country: string | null;
/**
* Two-digit number representing the card's expiration month.
*/
exp_month: number;
/**
* Four-digit number representing the card's expiration year.
*/
exp_year: number;
/**
* Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number.
*/
fingerprint?: string | null;
/**
* Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
*/
funding: string;
/**
* The last four digits of the card.
*/
last4: string;
/**
* Contains information about card networks that can be used to process the payment.
*/
networks: {
/**
* The preferred network for co-branded cards.
*/
preferred: string | null;
/**
* All available networks for the card.
*/
available: string[];
} | null;
/**
* Contains details on how this Card maybe be used for 3D Secure authentication.
*/
three_d_secure_usage: Card.ThreeDSecureUsage | null;
/**
* If this Card is part of a card wallet, this contains the details of the card wallet.
*/
wallet: null | {[k: string]: any};
}
export namespace Card {
export interface Checks {
/**
* If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_line1_check: string | null;
/**
* If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_postal_code_check: string | null;
/**
* If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
cvc_check: string | null;
}
export interface ThreeDSecureUsage {
/**
* Whether 3D Secure is supported on this card.
*/
supported: boolean;
}
}
export interface CardPresent {}
export interface Eps {
/**
* The customer's bank.
*/
bank: string;
}
export interface Fpx {
/**
* The customer's bank.
*/
bank: string;
}
export interface GrabPay {}
export interface Ideal {
/**
* The customer's bank, if provided.
*/
bank: string | null;
/**
* The Bank Identifier Code of the customer's bank, if the bank was provided.
*/
bic: string | null;
}
export interface P24 {
/**
* The customer's bank.
*/
bank: string;
}
export interface SepaDebit {
/**
* Bank code of bank associated with the bank account.
*/
bank_code: string | null;
/**
* Branch code of bank associated with the bank account.
*/
branch_code: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four characters of the IBAN.
*/
last4: string | null;
}
export interface Affirm {}
export interface AfterpayClearpay {}
export interface AcssDebit {
/**
* Customers bank account number.
*/
account_number: string;
/**
* Institution number of the customers bank.
*/
institution_number: string;
/**
* Transit number of the customers bank.
*/
transit_number: string;
}
export interface UsBankAccount {
/**
* Customers bank account number.
*/
account_number: string;
/**
* The routing transit number for the bank account.
*/
routing_number: string;
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type: string;
/**
* Account type: checkings or savings. Defaults to checking if omitted.
*/
account_type: string;
/**
* The name of the bank.
*/
bank_name: string;
/**
* The ID of the Financial Connections Account used to create the payment method.
*/
financial_connections_account: string;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string;
/**
* Last four digits of the bank account number.
*/
last4: string;
/**
* Contains information about US bank account networks that can be used.
*/
networks: {
/**
* The preferred network.
*/
preferred: string;
/**
* All supported networks.
*/
supported: string[];
};
}
}
export interface PaymentMethodCreateParams {
/**
* Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
*/
billing_details?: PaymentMethodCreateParams.BillingDetails;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
/**
* The PaymentMethod to share.
*/
payment_method?: string;
/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Required unless `payment_method` is specified (see the [Cloning PaymentMethods](https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods) guide)
*/
type?: string;
}
export interface CreatePaymentMethodFromElements {
/**
* The Elements instance
*
* @docs https://stripe.com/docs/js/elements_object
*/
elements: StripeElements;
/**
* Parameters that will be passed on to the PaymentMethod API
*
* @docs https://stripe.com/docs/api/payment_methods/create
*/
params?: PaymentMethodCreateParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
}
export interface CreatePaymentMethodFromElement {
/**
* The specific Element used to collect payment details
*
* @docs https://stripe.com/docs/js/element
*/
element: StripeElement;
/**
* Parameters that will be passed on to the PaymentMethod API
*
* @docs https://stripe.com/docs/api/payment_methods/create
*/
params?: PaymentMethodCreateParams;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam;
}
export namespace PaymentMethodCreateParams {
export interface BillingDetails {
/**
* Billing address.
*/
address?: BillingDetails.Address;
/**
* Email address.
*/
email?: string | null;
/**
* Full name.
*/
name?: string | null;
/**
* Billing phone number (including extension).
*/
phone?: string | null;
}
export namespace BillingDetails {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string | null;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string | null;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string | null;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string | null;
/**
* ZIP or postal code.
*/
postal_code?: string | null;
/**
* State, county, province, or region.
*/
state?: string | null;
}
}
}

View File

@@ -0,0 +1,209 @@
import {PaymentMethod} from './payment-methods';
/**
* The SetupIntent object.
*/
export interface SetupIntent {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'setup_intent';
/**
* Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
*/
cancellation_reason: SetupIntent.CancellationReason | null;
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*/
client_secret: string | null;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string | null;
/**
* The error encountered in the previous SetupIntent confirmation.
*/
last_setup_error: SetupIntent.LastSetupError | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
*/
next_action: SetupIntent.NextAction | null;
/**
* ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded.
*/
payment_method: string | null | PaymentMethod;
/**
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
*/
payment_method_types: Array<string>;
/**
* [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
*/
status: SetupIntent.Status;
/**
* Indicates how the payment method is intended to be used in the future.
*
* Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
*/
usage: string;
}
export namespace SetupIntent {
export type CancellationReason =
| 'abandoned'
| 'duplicate'
| 'requested_by_customer';
export interface LastSetupError {
/**
* For card errors, the ID of the failed charge.
*/
charge?: string;
/**
* For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
*/
code?: string;
/**
* For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
*/
decline_code?: string;
/**
* A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
*/
doc_url?: string;
/**
* A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
*/
message?: string;
/**
* If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
*/
param?: string;
payment_method?: PaymentMethod;
/**
* The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error`
*/
type: LastSetupError.Type;
}
export namespace LastSetupError {
export type Type =
| 'api_connection_error'
| 'api_error'
| 'authentication_error'
| 'card_error'
| 'idempotency_error'
| 'invalid_request_error'
| 'rate_limit_error';
}
export interface NextAction {
/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, or `verify_with_microdeposits`.
*/
type: string;
/**
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
*/
redirect_to_url?: NextAction.RedirectToUrl;
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
*/
use_stripe_sdk?: NextAction.UseStripeSdk;
/**
* Contains details describing microdeposits verification flow.
*/
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
}
export namespace NextAction {
export interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate.
*/
url: string | null;
}
export interface UseStripeSdk {}
export interface VerifyWithMicrodeposits {
/**
* The timestamp when the microdeposits are expected to land.
*/
arrival_date: number;
/**
* The URL for the hosted verification page, which allows customers to verify their bank account.
*/
hosted_verification_url: string;
/**
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
*/
microdeposit_type: string | null;
}
}
export type Status =
| 'canceled'
| 'processing'
| 'requires_action'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
}
export interface SetupIntentConfirmParams {
/**
* This hash contains details about the Mandate to create
*/
mandate_data?: {[k: string]: any};
/**
* The URL to redirect your customer back to after they authenticate on the payment method's app or site.
* If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
* This parameter is only used for cards and other redirect-based payment methods.
*/
return_url?: string;
}

View File

@@ -0,0 +1,209 @@
import {PaymentMethod} from './payment-methods';
/**
* The SetupIntent object.
*/
export interface SetupIntent {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'setup_intent';
/**
* Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
*/
cancellation_reason: SetupIntent.CancellationReason | null;
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*/
client_secret: string | null;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string | null;
/**
* The error encountered in the previous SetupIntent confirmation.
*/
last_setup_error: SetupIntent.LastSetupError | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
*/
next_action: SetupIntent.NextAction | null;
/**
* ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded.
*/
payment_method: string | null | PaymentMethod;
/**
* The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
*/
payment_method_types: Array<string>;
/**
* [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
*/
status: SetupIntent.Status;
/**
* Indicates how the payment method is intended to be used in the future.
*
* Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.
*/
usage: string;
}
export namespace SetupIntent {
export type CancellationReason =
| 'abandoned'
| 'duplicate'
| 'requested_by_customer';
export interface LastSetupError {
/**
* For card errors, the ID of the failed charge.
*/
charge?: string;
/**
* For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
*/
code?: string;
/**
* For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
*/
decline_code?: string;
/**
* A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
*/
doc_url?: string;
/**
* A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
*/
message?: string;
/**
* If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
*/
param?: string;
payment_method?: PaymentMethod;
/**
* The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error`
*/
type: LastSetupError.Type;
}
export namespace LastSetupError {
export type Type =
| 'api_connection_error'
| 'api_error'
| 'authentication_error'
| 'card_error'
| 'idempotency_error'
| 'invalid_request_error'
| 'rate_limit_error';
}
export interface NextAction {
/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, or `verify_with_microdeposits`.
*/
type: string;
/**
* Contains instructions for authenticating a payment by redirecting your customer to another page or application.
*/
redirect_to_url?: NextAction.RedirectToUrl;
/**
* When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
*/
use_stripe_sdk?: NextAction.UseStripeSdk;
/**
* Contains details describing microdeposits verification flow.
*/
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
}
export namespace NextAction {
export interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate.
*/
url: string | null;
}
export interface UseStripeSdk {}
export interface VerifyWithMicrodeposits {
/**
* The timestamp when the microdeposits are expected to land.
*/
arrival_date: number;
/**
* The URL for the hosted verification page, which allows customers to verify their bank account.
*/
hosted_verification_url: string;
/**
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
*/
microdeposit_type: string | null;
}
}
export type Status =
| 'canceled'
| 'processing'
| 'requires_action'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
}
export interface SetupIntentConfirmParams {
/**
* This hash contains details about the Mandate to create
*/
mandate_data?: {[k: string]: any};
/**
* The URL to redirect your customer back to after they authenticate on the payment method's app or site.
* If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
* This parameter is only used for cards and other redirect-based payment methods.
*/
return_url?: string;
}

125
node_modules/@stripe/stripe-js/dist/api/shared.d.mts generated vendored Normal file
View File

@@ -0,0 +1,125 @@
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
export interface Metadata {
[name: string]: string;
}
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* While you can send values as numbers, they will be returned as strings.
*/
export interface MetadataParam {
[name: string]: string | number | null;
}
/**
* The Address object.
*/
export interface Address {
/**
* City/District/Suburb/Town/Village.
*/
city: string | null;
/**
* 2-letter country code.
*/
country: string | null;
/**
* Address line 1 (Street address/PO Box/Company name).
*/
line1: string | null;
/**
* Address line 2 (Apartment/Suite/Unit/Building).
*/
line2: string | null;
/**
* ZIP or postal code.
*/
postal_code: string | null;
/**
* State/County/Province/Region.
*/
state: string | null;
}
export interface AccountAddressParam {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface AddressParam extends AccountAddressParam {
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1: string;
}
export interface JapanAddressParam {
/**
* City or ward.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Block or building number.
*/
line1?: string;
/**
* Building details.
*/
line2?: string;
/**
* Postal code.
*/
postal_code?: string;
/**
* Prefecture.
*/
state?: string;
/**
* Town or cho-me.
*/
town?: string;
}

125
node_modules/@stripe/stripe-js/dist/api/shared.d.ts generated vendored Normal file
View File

@@ -0,0 +1,125 @@
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
export interface Metadata {
[name: string]: string;
}
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* While you can send values as numbers, they will be returned as strings.
*/
export interface MetadataParam {
[name: string]: string | number | null;
}
/**
* The Address object.
*/
export interface Address {
/**
* City/District/Suburb/Town/Village.
*/
city: string | null;
/**
* 2-letter country code.
*/
country: string | null;
/**
* Address line 1 (Street address/PO Box/Company name).
*/
line1: string | null;
/**
* Address line 2 (Apartment/Suite/Unit/Building).
*/
line2: string | null;
/**
* ZIP or postal code.
*/
postal_code: string | null;
/**
* State/County/Province/Region.
*/
state: string | null;
}
export interface AccountAddressParam {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface AddressParam extends AccountAddressParam {
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1: string;
}
export interface JapanAddressParam {
/**
* City or ward.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Block or building number.
*/
line1?: string;
/**
* Building details.
*/
line2?: string;
/**
* Postal code.
*/
postal_code?: string;
/**
* Prefecture.
*/
state?: string;
/**
* Town or cho-me.
*/
town?: string;
}

1045
node_modules/@stripe/stripe-js/dist/api/sources.d.mts generated vendored Normal file

File diff suppressed because it is too large Load Diff

1045
node_modules/@stripe/stripe-js/dist/api/sources.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

639
node_modules/@stripe/stripe-js/dist/api/tokens.d.mts generated vendored Normal file
View File

@@ -0,0 +1,639 @@
import {Omit} from '../utils';
import {Card} from './cards';
import {BankAccount} from './bank-accounts';
import {JapanAddressParam, MetadataParam} from './shared';
/**
* The Token object.
*/
export interface Token {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'token';
bank_account?: BankAccount;
card?: Card;
/**
* IP address of the client that generated the token.
*/
client_ip: string | null;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Type of the token: `account`, `bank_account`, `card`, or `pii`.
*/
type: string;
/**
* Whether this token has already been used (tokens can be used only once).
*/
used: boolean;
}
export type BankAccountToken = Omit<Token, 'card'> & {
bank_account: BankAccount;
};
export namespace TokenCreateParams {
export interface Account {
/**
* The business type.
*/
business_type?: Account.BusinessType;
/**
* Information about the company or business.
*/
company?: Account.Company;
/**
* Information about the person represented by the account.
*/
individual?: Account.Individual;
/**
* Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`.
*/
tos_shown_and_accepted?: boolean;
}
export namespace Account {
export type BusinessType =
| 'company'
| 'government_entity'
| 'individual'
| 'non_profit';
export interface Company {
/**
* The company's primary address.
*/
address?: Company.Address;
/**
* The Kana variation of the company's primary address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the company's primary address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
*/
directors_provided?: boolean;
/**
* Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.
*/
executives_provided?: boolean;
/**
* The company's legal name.
*/
name?: string;
/**
* The Kana variation of the company's legal name (Japan only).
*/
name_kana?: string;
/**
* The Kanji variation of the company's legal name (Japan only).
*/
name_kanji?: string;
/**
* Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.
*/
owners_provided?: boolean;
/**
* The company's phone number (used for verification).
*/
phone?: string;
/**
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
*/
structure?: Company.Structure | null;
/**
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
*/
tax_id?: string;
/**
* The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
*/
tax_id_registrar?: string;
/**
* The VAT number of the company.
*/
vat_id?: string;
/**
* Information on the verification state of the company.
*/
verification?: Company.Verification;
}
export namespace Company {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export type Structure =
| 'government_instrumentality'
| 'governmental_unit'
| 'incorporated_non_profit'
| 'limited_liability_partnership'
| 'multi_member_llc'
| 'private_company'
| 'private_corporation'
| 'private_partnership'
| 'public_company'
| 'public_corporation'
| 'public_partnership'
| 'sole_proprietorship'
| 'tax_exempt_government_instrumentality'
| 'unincorporated_association'
| 'unincorporated_non_profit';
export interface Verification {
/**
* A document verifying the business.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface Document {
/**
* The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
export interface Individual {
/**
* The individual's primary address.
*/
address?: Individual.Address;
/**
* The Kana variation of the the individual's primary address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the the individual's primary address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* The individual's date of birth.
*/
dob?: Individual.Dob | null;
/**
* The individual's email address.
*/
email?: string;
/**
* The individual's first name.
*/
first_name?: string;
/**
* The Kana variation of the the individual's first name (Japan only).
*/
first_name_kana?: string;
/**
* The Kanji variation of the individual's first name (Japan only).
*/
first_name_kanji?: string;
/**
* The individual's gender (International regulations require either "male" or "female").
*/
gender?: string;
/**
* The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
*/
id_number?: string;
/**
* The individual's last name.
*/
last_name?: string;
/**
* The Kana varation of the individual's last name (Japan only).
*/
last_name_kana?: string;
/**
* The Kanji varation of the individual's last name (Japan only).
*/
last_name_kanji?: string;
/**
* The individual's maiden name.
*/
maiden_name?: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
/**
* The individual's phone number.
*/
phone?: string;
/**
* Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
*/
political_exposure?: Individual.PoliticalExposure;
/**
* The last four digits of the individual's Social Security Number (U.S. only).
*/
ssn_last_4?: string;
/**
* The individual's verification document information.
*/
verification?: Individual.Verification;
}
export namespace Individual {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;
/**
* The month of birth, between 1 and 12.
*/
month: number;
/**
* The four-digit year of birth.
*/
year: number;
}
export type PoliticalExposure = 'none' | 'existing';
export interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
additional_document?: Verification.AdditionalDocument;
/**
* An identifying document, either a passport or local ID card.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface AdditionalDocument {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
export interface Document {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
}
export interface Person {
/**
* The person's address.
*/
address?: Person.Address;
/**
* The Kana variation of the person's address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the person's address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* The person's date of birth.
*/
dob?: Person.Dob | null;
/**
* The person's email address.
*/
email?: string;
/**
* The person's first name.
*/
first_name?: string;
/**
* The Kana variation of the person's first name (Japan only).
*/
first_name_kana?: string;
/**
* The Kanji variation of the person's first name (Japan only).
*/
first_name_kanji?: string;
/**
* The person's gender (International regulations require either "male" or "female").
*/
gender?: string;
/**
* The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
*/
id_number?: string;
/**
* The person's last name.
*/
last_name?: string;
/**
* The Kana variation of the person's last name (Japan only).
*/
last_name_kana?: string;
/**
* The Kanji variation of the person's last name (Japan only).
*/
last_name_kanji?: string;
/**
* The person's maiden name.
*/
maiden_name?: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
/**
* The person's phone number.
*/
phone?: string;
/**
* The relationship that this person has with the account's legal entity.
*/
relationship?: Person.Relationship;
/**
* The last 4 digits of the person's social security number.
*/
ssn_last_4?: string;
/**
* The person's verification status.
*/
verification?: Person.Verification;
}
export namespace Person {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;
/**
* The month of birth, between 1 and 12.
*/
month: number;
/**
* The four-digit year of birth.
*/
year: number;
}
export interface Relationship {
/**
* Whether the person is a director of the account's legal entity. Currently only required for accounts in the EU. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
*/
director?: boolean;
/**
* Whether the person has significant responsibility to control, manage, or direct the organization.
*/
executive?: boolean;
/**
* Whether the person is an owner of the account's legal entity.
*/
owner?: boolean;
/**
* The percent owned by the person of the account's legal entity.
*/
percent_ownership?: number | null;
/**
* Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.
*/
representative?: boolean;
/**
* The person's title (e.g., CEO, Support Engineer).
*/
title?: string;
}
export interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
additional_document?: Verification.AdditionalDocument;
/**
* An identifying document, either a passport or local ID card.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface AdditionalDocument {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
export interface Document {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
}

639
node_modules/@stripe/stripe-js/dist/api/tokens.d.ts generated vendored Normal file
View File

@@ -0,0 +1,639 @@
import {Omit} from '../utils';
import {Card} from './cards';
import {BankAccount} from './bank-accounts';
import {JapanAddressParam, MetadataParam} from './shared';
/**
* The Token object.
*/
export interface Token {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'token';
bank_account?: BankAccount;
card?: Card;
/**
* IP address of the client that generated the token.
*/
client_ip: string | null;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Type of the token: `account`, `bank_account`, `card`, or `pii`.
*/
type: string;
/**
* Whether this token has already been used (tokens can be used only once).
*/
used: boolean;
}
export type BankAccountToken = Omit<Token, 'card'> & {
bank_account: BankAccount;
};
export namespace TokenCreateParams {
export interface Account {
/**
* The business type.
*/
business_type?: Account.BusinessType;
/**
* Information about the company or business.
*/
company?: Account.Company;
/**
* Information about the person represented by the account.
*/
individual?: Account.Individual;
/**
* Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`.
*/
tos_shown_and_accepted?: boolean;
}
export namespace Account {
export type BusinessType =
| 'company'
| 'government_entity'
| 'individual'
| 'non_profit';
export interface Company {
/**
* The company's primary address.
*/
address?: Company.Address;
/**
* The Kana variation of the company's primary address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the company's primary address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
*/
directors_provided?: boolean;
/**
* Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.
*/
executives_provided?: boolean;
/**
* The company's legal name.
*/
name?: string;
/**
* The Kana variation of the company's legal name (Japan only).
*/
name_kana?: string;
/**
* The Kanji variation of the company's legal name (Japan only).
*/
name_kanji?: string;
/**
* Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.
*/
owners_provided?: boolean;
/**
* The company's phone number (used for verification).
*/
phone?: string;
/**
* The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
*/
structure?: Company.Structure | null;
/**
* The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
*/
tax_id?: string;
/**
* The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
*/
tax_id_registrar?: string;
/**
* The VAT number of the company.
*/
vat_id?: string;
/**
* Information on the verification state of the company.
*/
verification?: Company.Verification;
}
export namespace Company {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export type Structure =
| 'government_instrumentality'
| 'governmental_unit'
| 'incorporated_non_profit'
| 'limited_liability_partnership'
| 'multi_member_llc'
| 'private_company'
| 'private_corporation'
| 'private_partnership'
| 'public_company'
| 'public_corporation'
| 'public_partnership'
| 'sole_proprietorship'
| 'tax_exempt_government_instrumentality'
| 'unincorporated_association'
| 'unincorporated_non_profit';
export interface Verification {
/**
* A document verifying the business.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface Document {
/**
* The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
export interface Individual {
/**
* The individual's primary address.
*/
address?: Individual.Address;
/**
* The Kana variation of the the individual's primary address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the the individual's primary address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* The individual's date of birth.
*/
dob?: Individual.Dob | null;
/**
* The individual's email address.
*/
email?: string;
/**
* The individual's first name.
*/
first_name?: string;
/**
* The Kana variation of the the individual's first name (Japan only).
*/
first_name_kana?: string;
/**
* The Kanji variation of the individual's first name (Japan only).
*/
first_name_kanji?: string;
/**
* The individual's gender (International regulations require either "male" or "female").
*/
gender?: string;
/**
* The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
*/
id_number?: string;
/**
* The individual's last name.
*/
last_name?: string;
/**
* The Kana varation of the individual's last name (Japan only).
*/
last_name_kana?: string;
/**
* The Kanji varation of the individual's last name (Japan only).
*/
last_name_kanji?: string;
/**
* The individual's maiden name.
*/
maiden_name?: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
/**
* The individual's phone number.
*/
phone?: string;
/**
* Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
*/
political_exposure?: Individual.PoliticalExposure;
/**
* The last four digits of the individual's Social Security Number (U.S. only).
*/
ssn_last_4?: string;
/**
* The individual's verification document information.
*/
verification?: Individual.Verification;
}
export namespace Individual {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;
/**
* The month of birth, between 1 and 12.
*/
month: number;
/**
* The four-digit year of birth.
*/
year: number;
}
export type PoliticalExposure = 'none' | 'existing';
export interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
additional_document?: Verification.AdditionalDocument;
/**
* An identifying document, either a passport or local ID card.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface AdditionalDocument {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
export interface Document {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
}
export interface Person {
/**
* The person's address.
*/
address?: Person.Address;
/**
* The Kana variation of the person's address (Japan only).
*/
address_kana?: JapanAddressParam;
/**
* The Kanji variation of the person's address (Japan only).
*/
address_kanji?: JapanAddressParam;
/**
* The person's date of birth.
*/
dob?: Person.Dob | null;
/**
* The person's email address.
*/
email?: string;
/**
* The person's first name.
*/
first_name?: string;
/**
* The Kana variation of the person's first name (Japan only).
*/
first_name_kana?: string;
/**
* The Kanji variation of the person's first name (Japan only).
*/
first_name_kanji?: string;
/**
* The person's gender (International regulations require either "male" or "female").
*/
gender?: string;
/**
* The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
*/
id_number?: string;
/**
* The person's last name.
*/
last_name?: string;
/**
* The Kana variation of the person's last name (Japan only).
*/
last_name_kana?: string;
/**
* The Kanji variation of the person's last name (Japan only).
*/
last_name_kanji?: string;
/**
* The person's maiden name.
*/
maiden_name?: string;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: MetadataParam | null;
/**
* The person's phone number.
*/
phone?: string;
/**
* The relationship that this person has with the account's legal entity.
*/
relationship?: Person.Relationship;
/**
* The last 4 digits of the person's social security number.
*/
ssn_last_4?: string;
/**
* The person's verification status.
*/
verification?: Person.Verification;
}
export namespace Person {
export interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
}
export interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;
/**
* The month of birth, between 1 and 12.
*/
month: number;
/**
* The four-digit year of birth.
*/
year: number;
}
export interface Relationship {
/**
* Whether the person is a director of the account's legal entity. Currently only required for accounts in the EU. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
*/
director?: boolean;
/**
* Whether the person has significant responsibility to control, manage, or direct the organization.
*/
executive?: boolean;
/**
* Whether the person is an owner of the account's legal entity.
*/
owner?: boolean;
/**
* The percent owned by the person of the account's legal entity.
*/
percent_ownership?: number | null;
/**
* Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.
*/
representative?: boolean;
/**
* The person's title (e.g., CEO, Support Engineer).
*/
title?: string;
}
export interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
additional_document?: Verification.AdditionalDocument;
/**
* An identifying document, either a passport or local ID card.
*/
document?: Verification.Document;
}
export namespace Verification {
export interface AdditionalDocument {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
export interface Document {
/**
* The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
}

View File

@@ -0,0 +1,9 @@
/**
* The VerificationSession object.
*/
export interface VerificationSession {
/**
* Unique identifier for the object.
*/
id: string;
}

View File

@@ -0,0 +1,9 @@
/**
* The VerificationSession object.
*/
export interface VerificationSession {
/**
* Unique identifier for the object.
*/
id: string;
}

14
node_modules/@stripe/stripe-js/dist/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
export * from './api';
export * from './stripe-js';
import {StripeConstructor} from './stripe-js';
export {loadStripe} from './shared';
declare global {
interface Window {
// Stripe.js must be loaded directly from https://js.stripe.com/v3, which
// places a `Stripe` object on the window
Stripe?: StripeConstructor;
}
}

14
node_modules/@stripe/stripe-js/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
export * from './api';
export * from './stripe-js';
import {StripeConstructor} from './stripe-js';
export {loadStripe} from './shared';
declare global {
interface Window {
// Stripe.js must be loaded directly from https://js.stripe.com/v3, which
// places a `Stripe` object on the window
Stripe?: StripeConstructor;
}
}

175
node_modules/@stripe/stripe-js/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,175 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var V3_URL = 'https://js.stripe.com/v3';
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
var findScript = function findScript() {
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (!V3_URL_REGEX.test(script.src)) {
continue;
}
return script;
}
return null;
};
var injectScript = function injectScript(params) {
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
var script = document.createElement('script');
script.src = "".concat(V3_URL).concat(queryString);
var headOrBody = document.head || document.body;
if (!headOrBody) {
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
}
headOrBody.appendChild(script);
return script;
};
var registerWrapper = function registerWrapper(stripe, startTime) {
if (!stripe || !stripe._registerWrapper) {
return;
}
stripe._registerWrapper({
name: 'stripe-js',
version: "5.6.0",
startTime: startTime
});
};
var stripePromise$1 = null;
var onErrorListener = null;
var onLoadListener = null;
var onError = function onError(reject) {
return function () {
reject(new Error('Failed to load Stripe.js'));
};
};
var onLoad = function onLoad(resolve, reject) {
return function () {
if (window.Stripe) {
resolve(window.Stripe);
} else {
reject(new Error('Stripe.js not available'));
}
};
};
var loadScript = function loadScript(params) {
// Ensure that we only attempt to load Stripe.js at most once
if (stripePromise$1 !== null) {
return stripePromise$1;
}
stripePromise$1 = new Promise(function (resolve, reject) {
if (typeof window === 'undefined' || typeof document === 'undefined') {
// Resolve to null when imported server side. This makes the module
// safe to import in an isomorphic code base.
resolve(null);
return;
}
if (window.Stripe && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
}
if (window.Stripe) {
resolve(window.Stripe);
return;
}
try {
var script = findScript();
if (script && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
} else if (!script) {
script = injectScript(params);
} else if (script && onLoadListener !== null && onErrorListener !== null) {
var _script$parentNode;
// remove event listeners
script.removeEventListener('load', onLoadListener);
script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,
// reload script to trigger 'load' event
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
script = injectScript(params);
}
onLoadListener = onLoad(resolve, reject);
onErrorListener = onError(reject);
script.addEventListener('load', onLoadListener);
script.addEventListener('error', onErrorListener);
} catch (error) {
reject(error);
return;
}
}); // Resets stripePromise on error
return stripePromise$1["catch"](function (error) {
stripePromise$1 = null;
return Promise.reject(error);
});
};
var initStripe = function initStripe(maybeStripe, args, startTime) {
if (maybeStripe === null) {
return null;
}
var stripe = maybeStripe.apply(undefined, args);
registerWrapper(stripe, startTime);
return stripe;
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
var stripePromise;
var loadCalled = false;
var getStripePromise = function getStripePromise() {
if (stripePromise) {
return stripePromise;
}
stripePromise = loadScript(null)["catch"](function (error) {
// clear cache on error
stripePromise = null;
return Promise.reject(error);
});
return stripePromise;
}; // Execute our own script injection after a tick to give users time to do their
// own script injection.
Promise.resolve().then(function () {
return getStripePromise();
})["catch"](function (error) {
if (!loadCalled) {
console.warn(error);
}
});
var loadStripe = function loadStripe() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
loadCalled = true;
var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script
return getStripePromise().then(function (maybeStripe) {
return initStripe(maybeStripe, args, startTime);
});
};
exports.loadStripe = loadStripe;

171
node_modules/@stripe/stripe-js/dist/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,171 @@
var V3_URL = 'https://js.stripe.com/v3';
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
var findScript = function findScript() {
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (!V3_URL_REGEX.test(script.src)) {
continue;
}
return script;
}
return null;
};
var injectScript = function injectScript(params) {
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
var script = document.createElement('script');
script.src = "".concat(V3_URL).concat(queryString);
var headOrBody = document.head || document.body;
if (!headOrBody) {
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
}
headOrBody.appendChild(script);
return script;
};
var registerWrapper = function registerWrapper(stripe, startTime) {
if (!stripe || !stripe._registerWrapper) {
return;
}
stripe._registerWrapper({
name: 'stripe-js',
version: "5.6.0",
startTime: startTime
});
};
var stripePromise$1 = null;
var onErrorListener = null;
var onLoadListener = null;
var onError = function onError(reject) {
return function () {
reject(new Error('Failed to load Stripe.js'));
};
};
var onLoad = function onLoad(resolve, reject) {
return function () {
if (window.Stripe) {
resolve(window.Stripe);
} else {
reject(new Error('Stripe.js not available'));
}
};
};
var loadScript = function loadScript(params) {
// Ensure that we only attempt to load Stripe.js at most once
if (stripePromise$1 !== null) {
return stripePromise$1;
}
stripePromise$1 = new Promise(function (resolve, reject) {
if (typeof window === 'undefined' || typeof document === 'undefined') {
// Resolve to null when imported server side. This makes the module
// safe to import in an isomorphic code base.
resolve(null);
return;
}
if (window.Stripe && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
}
if (window.Stripe) {
resolve(window.Stripe);
return;
}
try {
var script = findScript();
if (script && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
} else if (!script) {
script = injectScript(params);
} else if (script && onLoadListener !== null && onErrorListener !== null) {
var _script$parentNode;
// remove event listeners
script.removeEventListener('load', onLoadListener);
script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,
// reload script to trigger 'load' event
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
script = injectScript(params);
}
onLoadListener = onLoad(resolve, reject);
onErrorListener = onError(reject);
script.addEventListener('load', onLoadListener);
script.addEventListener('error', onErrorListener);
} catch (error) {
reject(error);
return;
}
}); // Resets stripePromise on error
return stripePromise$1["catch"](function (error) {
stripePromise$1 = null;
return Promise.reject(error);
});
};
var initStripe = function initStripe(maybeStripe, args, startTime) {
if (maybeStripe === null) {
return null;
}
var stripe = maybeStripe.apply(undefined, args);
registerWrapper(stripe, startTime);
return stripe;
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
var stripePromise;
var loadCalled = false;
var getStripePromise = function getStripePromise() {
if (stripePromise) {
return stripePromise;
}
stripePromise = loadScript(null)["catch"](function (error) {
// clear cache on error
stripePromise = null;
return Promise.reject(error);
});
return stripePromise;
}; // Execute our own script injection after a tick to give users time to do their
// own script injection.
Promise.resolve().then(function () {
return getStripePromise();
})["catch"](function (error) {
if (!loadCalled) {
console.warn(error);
}
});
var loadStripe = function loadStripe() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
loadCalled = true;
var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script
return getStripePromise().then(function (maybeStripe) {
return initStripe(maybeStripe, args, startTime);
});
};
export { loadStripe };

5
node_modules/@stripe/stripe-js/dist/pure.d.mts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import {loadStripe as _loadStripe} from './shared';
export const loadStripe: typeof _loadStripe & {
setLoadParameters: (params: {advancedFraudSignals: boolean}) => void;
};

5
node_modules/@stripe/stripe-js/dist/pure.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import {loadStripe as _loadStripe} from './shared';
export const loadStripe: typeof _loadStripe & {
setLoadParameters: (params: {advancedFraudSignals: boolean}) => void;
};

204
node_modules/@stripe/stripe-js/dist/pure.js generated vendored Normal file
View File

@@ -0,0 +1,204 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
var V3_URL = 'https://js.stripe.com/v3';
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
var findScript = function findScript() {
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (!V3_URL_REGEX.test(script.src)) {
continue;
}
return script;
}
return null;
};
var injectScript = function injectScript(params) {
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
var script = document.createElement('script');
script.src = "".concat(V3_URL).concat(queryString);
var headOrBody = document.head || document.body;
if (!headOrBody) {
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
}
headOrBody.appendChild(script);
return script;
};
var registerWrapper = function registerWrapper(stripe, startTime) {
if (!stripe || !stripe._registerWrapper) {
return;
}
stripe._registerWrapper({
name: 'stripe-js',
version: "5.6.0",
startTime: startTime
});
};
var stripePromise = null;
var onErrorListener = null;
var onLoadListener = null;
var onError = function onError(reject) {
return function () {
reject(new Error('Failed to load Stripe.js'));
};
};
var onLoad = function onLoad(resolve, reject) {
return function () {
if (window.Stripe) {
resolve(window.Stripe);
} else {
reject(new Error('Stripe.js not available'));
}
};
};
var loadScript = function loadScript(params) {
// Ensure that we only attempt to load Stripe.js at most once
if (stripePromise !== null) {
return stripePromise;
}
stripePromise = new Promise(function (resolve, reject) {
if (typeof window === 'undefined' || typeof document === 'undefined') {
// Resolve to null when imported server side. This makes the module
// safe to import in an isomorphic code base.
resolve(null);
return;
}
if (window.Stripe && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
}
if (window.Stripe) {
resolve(window.Stripe);
return;
}
try {
var script = findScript();
if (script && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
} else if (!script) {
script = injectScript(params);
} else if (script && onLoadListener !== null && onErrorListener !== null) {
var _script$parentNode;
// remove event listeners
script.removeEventListener('load', onLoadListener);
script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,
// reload script to trigger 'load' event
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
script = injectScript(params);
}
onLoadListener = onLoad(resolve, reject);
onErrorListener = onError(reject);
script.addEventListener('load', onLoadListener);
script.addEventListener('error', onErrorListener);
} catch (error) {
reject(error);
return;
}
}); // Resets stripePromise on error
return stripePromise["catch"](function (error) {
stripePromise = null;
return Promise.reject(error);
});
};
var initStripe = function initStripe(maybeStripe, args, startTime) {
if (maybeStripe === null) {
return null;
}
var stripe = maybeStripe.apply(undefined, args);
registerWrapper(stripe, startTime);
return stripe;
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
var validateLoadParams = function validateLoadParams(params) {
var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
if (params === null || _typeof(params) !== 'object') {
throw new Error(errorMessage);
}
if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {
return params;
}
throw new Error(errorMessage);
};
var loadParams;
var loadStripeCalled = false;
var loadStripe = function loadStripe() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
loadStripeCalled = true;
var startTime = Date.now();
return loadScript(loadParams).then(function (maybeStripe) {
return initStripe(maybeStripe, args, startTime);
});
};
loadStripe.setLoadParameters = function (params) {
// we won't throw an error if setLoadParameters is called with the same values as before
if (loadStripeCalled && loadParams) {
var validatedParams = validateLoadParams(params);
var parameterKeys = Object.keys(validatedParams);
var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {
var _loadParams;
return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
}, true);
if (sameParameters) {
return;
}
}
if (loadStripeCalled) {
throw new Error('You cannot change load parameters after calling loadStripe');
}
loadParams = validateLoadParams(params);
};
exports.loadStripe = loadStripe;

200
node_modules/@stripe/stripe-js/dist/pure.mjs generated vendored Normal file
View File

@@ -0,0 +1,200 @@
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
var V3_URL = 'https://js.stripe.com/v3';
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
var findScript = function findScript() {
var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (!V3_URL_REGEX.test(script.src)) {
continue;
}
return script;
}
return null;
};
var injectScript = function injectScript(params) {
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
var script = document.createElement('script');
script.src = "".concat(V3_URL).concat(queryString);
var headOrBody = document.head || document.body;
if (!headOrBody) {
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
}
headOrBody.appendChild(script);
return script;
};
var registerWrapper = function registerWrapper(stripe, startTime) {
if (!stripe || !stripe._registerWrapper) {
return;
}
stripe._registerWrapper({
name: 'stripe-js',
version: "5.6.0",
startTime: startTime
});
};
var stripePromise = null;
var onErrorListener = null;
var onLoadListener = null;
var onError = function onError(reject) {
return function () {
reject(new Error('Failed to load Stripe.js'));
};
};
var onLoad = function onLoad(resolve, reject) {
return function () {
if (window.Stripe) {
resolve(window.Stripe);
} else {
reject(new Error('Stripe.js not available'));
}
};
};
var loadScript = function loadScript(params) {
// Ensure that we only attempt to load Stripe.js at most once
if (stripePromise !== null) {
return stripePromise;
}
stripePromise = new Promise(function (resolve, reject) {
if (typeof window === 'undefined' || typeof document === 'undefined') {
// Resolve to null when imported server side. This makes the module
// safe to import in an isomorphic code base.
resolve(null);
return;
}
if (window.Stripe && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
}
if (window.Stripe) {
resolve(window.Stripe);
return;
}
try {
var script = findScript();
if (script && params) {
console.warn(EXISTING_SCRIPT_MESSAGE);
} else if (!script) {
script = injectScript(params);
} else if (script && onLoadListener !== null && onErrorListener !== null) {
var _script$parentNode;
// remove event listeners
script.removeEventListener('load', onLoadListener);
script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,
// reload script to trigger 'load' event
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
script = injectScript(params);
}
onLoadListener = onLoad(resolve, reject);
onErrorListener = onError(reject);
script.addEventListener('load', onLoadListener);
script.addEventListener('error', onErrorListener);
} catch (error) {
reject(error);
return;
}
}); // Resets stripePromise on error
return stripePromise["catch"](function (error) {
stripePromise = null;
return Promise.reject(error);
});
};
var initStripe = function initStripe(maybeStripe, args, startTime) {
if (maybeStripe === null) {
return null;
}
var stripe = maybeStripe.apply(undefined, args);
registerWrapper(stripe, startTime);
return stripe;
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
var validateLoadParams = function validateLoadParams(params) {
var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
if (params === null || _typeof(params) !== 'object') {
throw new Error(errorMessage);
}
if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') {
return params;
}
throw new Error(errorMessage);
};
var loadParams;
var loadStripeCalled = false;
var loadStripe = function loadStripe() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
loadStripeCalled = true;
var startTime = Date.now();
return loadScript(loadParams).then(function (maybeStripe) {
return initStripe(maybeStripe, args, startTime);
});
};
loadStripe.setLoadParameters = function (params) {
// we won't throw an error if setLoadParameters is called with the same values as before
if (loadStripeCalled && loadParams) {
var validatedParams = validateLoadParams(params);
var parameterKeys = Object.keys(validatedParams);
var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {
var _loadParams;
return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
}, true);
if (sameParameters) {
return;
}
}
if (loadStripeCalled) {
throw new Error('You cannot change load parameters after calling loadStripe');
}
loadParams = validateLoadParams(params);
};
export { loadStripe };

6
node_modules/@stripe/stripe-js/dist/shared.d.mts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import {StripeConstructorOptions, Stripe} from './stripe-js';
export const loadStripe: (
publishableKey: string,
options?: StripeConstructorOptions | undefined
) => Promise<Stripe | null>;

6
node_modules/@stripe/stripe-js/dist/shared.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import {StripeConstructorOptions, Stripe} from './stripe-js';
export const loadStripe: (
publishableKey: string,
options?: StripeConstructorOptions | undefined
) => Promise<Stripe | null>;

View File

@@ -0,0 +1,499 @@
import {
LayoutObject,
Layout,
TermsOption,
StripePaymentElement,
} from './elements/payment';
import {
AddressMode,
ContactOption,
StripeAddressElement,
} from './elements/address';
import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
import {StripeError} from './stripe';
import {
StripeCurrencySelectorElement,
FieldsOption,
StripeElementBase,
StripeExpressCheckoutElement,
StripeExpressCheckoutElementConfirmEvent,
StripeExpressCheckoutElementOptions,
StripeExpressCheckoutElementReadyEvent,
} from './elements';
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*/
export interface StripeCheckoutElementsOptions {
appearance?: Appearance;
loader?: 'auto' | 'always' | 'never';
fonts?: Array<CssFontSource | CustomFontSource>;
}
export interface StripeCheckoutOptions {
clientSecret: string;
elementsOptions?: StripeCheckoutElementsOptions;
}
/* Elements with CheckoutSessions API types */
export type StripeCheckoutAddress = {
country: string;
line1?: string | null;
line2?: string | null;
city?: string | null;
postal_code?: string | null;
state?: string | null;
};
export type StripeCheckoutAdjustableQuantity = {
maximum: number;
minimum: number;
};
export type StripeCheckoutBillingInterval = 'day' | 'month' | 'week' | 'year';
export type StripeCheckoutConfirmationRequirement =
| 'phoneNumber'
| 'shippingAddress'
| 'billingAddress'
| 'paymentDetails'
| 'email';
export type StripeCheckoutContact = {
name?: string | null;
address: StripeCheckoutAddress;
};
export type StripeCheckoutDeliveryEstimate = {
maximum: StripeCheckoutEstimate | null;
minimum: StripeCheckoutEstimate | null;
};
export type StripeCheckoutDiscountAmount = {
amount: number;
displayName: string;
promotionCode: string | null;
recurring:
| {type: 'forever'}
| {type: 'repeating'; durationInMonths: number}
| null;
};
export type StripeCheckoutDueNext = {
amountSubtotal: number;
amountDiscount: number;
amountTaxInclusive: number;
amountTaxExclusive: number;
billingCycleAnchor: number | null;
};
export type StripeCheckoutEstimate = {
unit: 'business_day' | 'day' | 'hour' | 'week' | 'month';
value: number;
};
export type StripeCheckoutLastPaymentError = {
message: string;
};
export type StripeCheckoutRedirectBehavior = 'always' | 'if_required';
export type StripeCheckoutSavedPaymentMethod = {
id: string;
type: 'card';
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
billingDetails: {
email?: string | null;
name?: string | null;
phone?: string | null;
address?: {
line1?: string | null;
line2?: string | null;
city?: string | null;
postal_code?: string | null;
state?: string | null;
country?: string | null;
} | null;
};
};
export type StripeCheckoutTaxAmount = {
amount: number;
inclusive: boolean;
displayName: string;
};
export type StripeCheckoutLineItem = {
id: string;
name: string;
amountDiscount: number;
amountSubtotal: number;
amountTaxExclusive: number;
amountTaxInclusive: number;
unitAmount: number;
description: string | null;
quantity: number;
discountAmounts: Array<StripeCheckoutDiscountAmount> | null;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
recurring: {
interval: StripeCheckoutBillingInterval;
intervalCount: number;
isProrated: boolean;
usageType: 'metered' | 'licensed';
} | null;
adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
images: string[];
};
export type StripeCheckoutRecurring = {
interval: StripeCheckoutBillingInterval;
intervalCount: number;
dueNext: StripeCheckoutDueNext;
trial: StripeCheckoutTrial | null;
};
export type StripeCheckoutShipping = {
shippingOption: StripeCheckoutShippingOption;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
};
export type StripeCheckoutShippingOption = {
id: string;
amount: number;
currency: string;
displayName: string | null;
deliveryEstimate: StripeCheckoutDeliveryEstimate | null;
};
export type StripeCheckoutStatus =
| {type: 'open'}
| {type: 'expired'}
| {
type: 'complete';
paymentStatus: 'paid' | 'unpaid' | 'no_payment_required';
};
export type StripeCheckoutTaxStatus =
| {status: 'ready'}
| {status: 'requires_shipping_address'}
| {status: 'requires_billing_address'};
export type StripeCheckoutTotalSummary = {
appliedBalance: number;
balanceAppliedToNextInvoice: boolean;
discount: number;
shippingRate: number;
subtotal: number;
taxExclusive: number;
taxInclusive: number;
total: number;
};
export type StripeCheckoutTrial = {
trialEnd: number;
trialPeriodDays: number;
};
export type StripeCheckoutCurrencyOption = {
amount: number;
currency: string;
currencyConversion?: {fxRate: number; sourceCurrency: string};
};
/* Custom Checkout session */
export interface StripeCheckoutSession {
billingAddress: StripeCheckoutContact | null;
businessName: string | null;
canConfirm: boolean;
confirmationRequirements: StripeCheckoutConfirmationRequirement[];
currency: string;
currencyOptions: Array<StripeCheckoutCurrencyOption> | null;
discountAmounts: Array<StripeCheckoutDiscountAmount> | null;
email: string | null;
id: string;
lastPaymentError: StripeCheckoutLastPaymentError | null;
lineItems: Array<StripeCheckoutLineItem>;
livemode: boolean;
phoneNumber: string | null;
recurring: StripeCheckoutRecurring | null;
savedPaymentMethods: Array<StripeCheckoutSavedPaymentMethod> | null;
shipping: StripeCheckoutShipping | null;
shippingAddress: StripeCheckoutContact | null;
shippingOptions: Array<StripeCheckoutShippingOption>;
status: StripeCheckoutStatus;
tax: StripeCheckoutTaxStatus;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
total: StripeCheckoutTotalSummary;
}
export type StripeCheckoutPaymentElementOptions = {
layout?: Layout | LayoutObject;
paymentMethodOrder?: Array<string>;
readonly?: boolean;
terms?: TermsOption;
fields?: FieldsOption;
};
export type StripeCheckoutAddressElementOptions = {
mode: AddressMode;
contacts?: ContactOption[];
display?: {
name?: 'full' | 'split' | 'organization';
};
};
export type StripeCheckoutExpressCheckoutElementOptions = {
buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight'];
buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
buttonType: StripeExpressCheckoutElementOptions['buttonType'];
layout: StripeExpressCheckoutElementOptions['layout'];
paymentMethodOrder: StripeExpressCheckoutElementOptions['paymentMethodOrder'];
paymentMethods: StripeExpressCheckoutElementOptions['paymentMethods'];
};
export type StripeCheckoutUpdateHandler = (
session: StripeCheckoutSession
) => void;
export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered.
*/
on(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'ready',
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when a buyer authorizes a payment within a supported payment method.
*/
on(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'confirm',
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Updates the options the `ExpressCheckoutElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update: StripeExpressCheckoutElement['update'];
};
type AnyBuyerError = {message: string; code: null};
type ApplyPromotionCodeError =
| {message: string; code: 'invalidCode'}
| AnyBuyerError;
export type StripeCheckoutApplyPromotionCodeResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: ApplyPromotionCodeError};
export type StripeCheckoutRemovePromotionCodeResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdateAddressResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdatePhoneNumberResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: never};
type UpdateEmailError =
| {message: string; code: 'incompleteEmail'}
| {message: string; code: 'invalidEmail'};
export type StripeCheckoutUpdateEmailResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: UpdateEmailError};
export type StripeCheckoutUpdateLineItemQuantityResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdateShippingOptionResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
type ConfirmError =
| {
message: string;
code: 'paymentFailed';
paymentFailed: {
declineCode: string | null;
};
}
| AnyBuyerError;
export type StripeCheckoutConfirmResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: ConfirmError};
type RunServerUpdateFunction = () => Promise<unknown>;
export type StripeCheckoutRunServerUpdateResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export interface StripeCheckout {
/* Custom Checkout methods */
applyPromotionCode: (
promotionCode: string
) => Promise<StripeCheckoutApplyPromotionCodeResult>;
removePromotionCode: () => Promise<StripeCheckoutRemovePromotionCodeResult>;
updateShippingAddress: (
shippingAddress: StripeCheckoutContact | null
) => Promise<StripeCheckoutUpdateAddressResult>;
updateBillingAddress: (
billingAddress: StripeCheckoutContact | null
) => Promise<StripeCheckoutUpdateAddressResult>;
updatePhoneNumber: (
phoneNumber: string
) => Promise<StripeCheckoutUpdatePhoneNumberResult>;
updateEmail: (email: string) => Promise<StripeCheckoutUpdateEmailResult>;
updateLineItemQuantity: (args: {
lineItem: string;
quantity: number;
}) => Promise<StripeCheckoutUpdateLineItemQuantityResult>;
updateShippingOption: (
shippingOption: string
) => Promise<StripeCheckoutUpdateShippingOptionResult>;
confirm: (args?: {
returnUrl?: string;
redirect?: StripeCheckoutRedirectBehavior;
paymentMethod?: string;
savePaymentMethod?: boolean;
email?: string;
phoneNumber?: string;
billingAddress?: StripeCheckoutContact;
shippingAddress?: StripeCheckoutContact;
expressCheckoutConfirmEvent?: StripeExpressCheckoutElementConfirmEvent;
}) => Promise<StripeCheckoutConfirmResult>;
session: () => StripeCheckoutSession;
on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
runServerUpdate: (
userFunction: RunServerUpdateFunction
) => Promise<StripeCheckoutRunServerUpdateResult>;
/* Elements methods */
changeAppearance: (appearance: Appearance) => void;
getElement(elementType: 'payment'): StripePaymentElement | null;
getElement(
elementType: 'address',
mode: AddressMode
): StripeAddressElement | null;
getElement(
elementType: 'expressCheckout'
): StripeCheckoutExpressCheckoutElement | null;
/* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
getElement(
elementType: 'currencySelector'
): StripeCurrencySelectorElement | null;
createElement(
elementType: 'payment',
options?: StripeCheckoutPaymentElementOptions
): StripePaymentElement;
createElement(
elementType: 'address',
options: StripeCheckoutAddressElementOptions
): StripeAddressElement;
createElement(
elementType: 'expressCheckout',
options: StripeCheckoutExpressCheckoutElementOptions
): StripeCheckoutExpressCheckoutElement;
/* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
createElement(elementType: 'currencySelector'): StripeCurrencySelectorElement;
}

View File

@@ -0,0 +1,499 @@
import {
LayoutObject,
Layout,
TermsOption,
StripePaymentElement,
} from './elements/payment';
import {
AddressMode,
ContactOption,
StripeAddressElement,
} from './elements/address';
import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
import {StripeError} from './stripe';
import {
StripeCurrencySelectorElement,
FieldsOption,
StripeElementBase,
StripeExpressCheckoutElement,
StripeExpressCheckoutElementConfirmEvent,
StripeExpressCheckoutElementOptions,
StripeExpressCheckoutElementReadyEvent,
} from './elements';
/**
* Requires beta access:
* Contact [Stripe support](https://support.stripe.com/) for more information.
*/
export interface StripeCheckoutElementsOptions {
appearance?: Appearance;
loader?: 'auto' | 'always' | 'never';
fonts?: Array<CssFontSource | CustomFontSource>;
}
export interface StripeCheckoutOptions {
clientSecret: string;
elementsOptions?: StripeCheckoutElementsOptions;
}
/* Elements with CheckoutSessions API types */
export type StripeCheckoutAddress = {
country: string;
line1?: string | null;
line2?: string | null;
city?: string | null;
postal_code?: string | null;
state?: string | null;
};
export type StripeCheckoutAdjustableQuantity = {
maximum: number;
minimum: number;
};
export type StripeCheckoutBillingInterval = 'day' | 'month' | 'week' | 'year';
export type StripeCheckoutConfirmationRequirement =
| 'phoneNumber'
| 'shippingAddress'
| 'billingAddress'
| 'paymentDetails'
| 'email';
export type StripeCheckoutContact = {
name?: string | null;
address: StripeCheckoutAddress;
};
export type StripeCheckoutDeliveryEstimate = {
maximum: StripeCheckoutEstimate | null;
minimum: StripeCheckoutEstimate | null;
};
export type StripeCheckoutDiscountAmount = {
amount: number;
displayName: string;
promotionCode: string | null;
recurring:
| {type: 'forever'}
| {type: 'repeating'; durationInMonths: number}
| null;
};
export type StripeCheckoutDueNext = {
amountSubtotal: number;
amountDiscount: number;
amountTaxInclusive: number;
amountTaxExclusive: number;
billingCycleAnchor: number | null;
};
export type StripeCheckoutEstimate = {
unit: 'business_day' | 'day' | 'hour' | 'week' | 'month';
value: number;
};
export type StripeCheckoutLastPaymentError = {
message: string;
};
export type StripeCheckoutRedirectBehavior = 'always' | 'if_required';
export type StripeCheckoutSavedPaymentMethod = {
id: string;
type: 'card';
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
billingDetails: {
email?: string | null;
name?: string | null;
phone?: string | null;
address?: {
line1?: string | null;
line2?: string | null;
city?: string | null;
postal_code?: string | null;
state?: string | null;
country?: string | null;
} | null;
};
};
export type StripeCheckoutTaxAmount = {
amount: number;
inclusive: boolean;
displayName: string;
};
export type StripeCheckoutLineItem = {
id: string;
name: string;
amountDiscount: number;
amountSubtotal: number;
amountTaxExclusive: number;
amountTaxInclusive: number;
unitAmount: number;
description: string | null;
quantity: number;
discountAmounts: Array<StripeCheckoutDiscountAmount> | null;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
recurring: {
interval: StripeCheckoutBillingInterval;
intervalCount: number;
isProrated: boolean;
usageType: 'metered' | 'licensed';
} | null;
adjustableQuantity: StripeCheckoutAdjustableQuantity | null;
images: string[];
};
export type StripeCheckoutRecurring = {
interval: StripeCheckoutBillingInterval;
intervalCount: number;
dueNext: StripeCheckoutDueNext;
trial: StripeCheckoutTrial | null;
};
export type StripeCheckoutShipping = {
shippingOption: StripeCheckoutShippingOption;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
};
export type StripeCheckoutShippingOption = {
id: string;
amount: number;
currency: string;
displayName: string | null;
deliveryEstimate: StripeCheckoutDeliveryEstimate | null;
};
export type StripeCheckoutStatus =
| {type: 'open'}
| {type: 'expired'}
| {
type: 'complete';
paymentStatus: 'paid' | 'unpaid' | 'no_payment_required';
};
export type StripeCheckoutTaxStatus =
| {status: 'ready'}
| {status: 'requires_shipping_address'}
| {status: 'requires_billing_address'};
export type StripeCheckoutTotalSummary = {
appliedBalance: number;
balanceAppliedToNextInvoice: boolean;
discount: number;
shippingRate: number;
subtotal: number;
taxExclusive: number;
taxInclusive: number;
total: number;
};
export type StripeCheckoutTrial = {
trialEnd: number;
trialPeriodDays: number;
};
export type StripeCheckoutCurrencyOption = {
amount: number;
currency: string;
currencyConversion?: {fxRate: number; sourceCurrency: string};
};
/* Custom Checkout session */
export interface StripeCheckoutSession {
billingAddress: StripeCheckoutContact | null;
businessName: string | null;
canConfirm: boolean;
confirmationRequirements: StripeCheckoutConfirmationRequirement[];
currency: string;
currencyOptions: Array<StripeCheckoutCurrencyOption> | null;
discountAmounts: Array<StripeCheckoutDiscountAmount> | null;
email: string | null;
id: string;
lastPaymentError: StripeCheckoutLastPaymentError | null;
lineItems: Array<StripeCheckoutLineItem>;
livemode: boolean;
phoneNumber: string | null;
recurring: StripeCheckoutRecurring | null;
savedPaymentMethods: Array<StripeCheckoutSavedPaymentMethod> | null;
shipping: StripeCheckoutShipping | null;
shippingAddress: StripeCheckoutContact | null;
shippingOptions: Array<StripeCheckoutShippingOption>;
status: StripeCheckoutStatus;
tax: StripeCheckoutTaxStatus;
taxAmounts: Array<StripeCheckoutTaxAmount> | null;
total: StripeCheckoutTotalSummary;
}
export type StripeCheckoutPaymentElementOptions = {
layout?: Layout | LayoutObject;
paymentMethodOrder?: Array<string>;
readonly?: boolean;
terms?: TermsOption;
fields?: FieldsOption;
};
export type StripeCheckoutAddressElementOptions = {
mode: AddressMode;
contacts?: ContactOption[];
display?: {
name?: 'full' | 'split' | 'organization';
};
};
export type StripeCheckoutExpressCheckoutElementOptions = {
buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight'];
buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
buttonType: StripeExpressCheckoutElementOptions['buttonType'];
layout: StripeExpressCheckoutElementOptions['layout'];
paymentMethodOrder: StripeExpressCheckoutElementOptions['paymentMethodOrder'];
paymentMethods: StripeExpressCheckoutElementOptions['paymentMethods'];
};
export type StripeCheckoutUpdateHandler = (
session: StripeCheckoutSession
) => void;
export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered.
*/
on(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'ready',
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Triggered when a buyer authorizes a payment within a supported payment method.
*/
on(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
once(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
off(
eventType: 'confirm',
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeCheckoutExpressCheckoutElement;
/**
* Updates the options the `ExpressCheckoutElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update: StripeExpressCheckoutElement['update'];
};
type AnyBuyerError = {message: string; code: null};
type ApplyPromotionCodeError =
| {message: string; code: 'invalidCode'}
| AnyBuyerError;
export type StripeCheckoutApplyPromotionCodeResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: ApplyPromotionCodeError};
export type StripeCheckoutRemovePromotionCodeResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdateAddressResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdatePhoneNumberResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: never};
type UpdateEmailError =
| {message: string; code: 'incompleteEmail'}
| {message: string; code: 'invalidEmail'};
export type StripeCheckoutUpdateEmailResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: UpdateEmailError};
export type StripeCheckoutUpdateLineItemQuantityResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export type StripeCheckoutUpdateShippingOptionResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
type ConfirmError =
| {
message: string;
code: 'paymentFailed';
paymentFailed: {
declineCode: string | null;
};
}
| AnyBuyerError;
export type StripeCheckoutConfirmResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: ConfirmError};
type RunServerUpdateFunction = () => Promise<unknown>;
export type StripeCheckoutRunServerUpdateResult =
| {type: 'success'; success: StripeCheckoutSession}
| {type: 'error'; error: AnyBuyerError};
export interface StripeCheckout {
/* Custom Checkout methods */
applyPromotionCode: (
promotionCode: string
) => Promise<StripeCheckoutApplyPromotionCodeResult>;
removePromotionCode: () => Promise<StripeCheckoutRemovePromotionCodeResult>;
updateShippingAddress: (
shippingAddress: StripeCheckoutContact | null
) => Promise<StripeCheckoutUpdateAddressResult>;
updateBillingAddress: (
billingAddress: StripeCheckoutContact | null
) => Promise<StripeCheckoutUpdateAddressResult>;
updatePhoneNumber: (
phoneNumber: string
) => Promise<StripeCheckoutUpdatePhoneNumberResult>;
updateEmail: (email: string) => Promise<StripeCheckoutUpdateEmailResult>;
updateLineItemQuantity: (args: {
lineItem: string;
quantity: number;
}) => Promise<StripeCheckoutUpdateLineItemQuantityResult>;
updateShippingOption: (
shippingOption: string
) => Promise<StripeCheckoutUpdateShippingOptionResult>;
confirm: (args?: {
returnUrl?: string;
redirect?: StripeCheckoutRedirectBehavior;
paymentMethod?: string;
savePaymentMethod?: boolean;
email?: string;
phoneNumber?: string;
billingAddress?: StripeCheckoutContact;
shippingAddress?: StripeCheckoutContact;
expressCheckoutConfirmEvent?: StripeExpressCheckoutElementConfirmEvent;
}) => Promise<StripeCheckoutConfirmResult>;
session: () => StripeCheckoutSession;
on: (event: 'change', handler: StripeCheckoutUpdateHandler) => void;
runServerUpdate: (
userFunction: RunServerUpdateFunction
) => Promise<StripeCheckoutRunServerUpdateResult>;
/* Elements methods */
changeAppearance: (appearance: Appearance) => void;
getElement(elementType: 'payment'): StripePaymentElement | null;
getElement(
elementType: 'address',
mode: AddressMode
): StripeAddressElement | null;
getElement(
elementType: 'expressCheckout'
): StripeCheckoutExpressCheckoutElement | null;
/* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
getElement(
elementType: 'currencySelector'
): StripeCurrencySelectorElement | null;
createElement(
elementType: 'payment',
options?: StripeCheckoutPaymentElementOptions
): StripePaymentElement;
createElement(
elementType: 'address',
options: StripeCheckoutAddressElementOptions
): StripeAddressElement;
createElement(
elementType: 'expressCheckout',
options: StripeCheckoutExpressCheckoutElementOptions
): StripeCheckoutExpressCheckoutElement;
/* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
createElement(elementType: 'currencySelector'): StripeCurrencySelectorElement;
}

View File

@@ -0,0 +1 @@
export {CreateConfirmationToken} from '../api';

View File

@@ -0,0 +1 @@
export {CreateConfirmationToken} from '../api';

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeAddressElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
once(
eventType: 'change',
handler: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
off(
eventType: 'change',
handler?: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Updates the options the `AddressElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAddressElementOptions>): StripeAddressElement;
/**
* Validates and retrieves form values from the `AddressElement`.
*/
getValue(): Promise<
Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'>
>;
};
export interface ContactOption {
name: string;
phone?: string;
address: {
line1: string;
line2?: string;
city: string;
state: string;
postal_code: string;
country: string;
};
}
export type AddressMode = 'shipping' | 'billing';
export interface StripeAddressElementOptions {
/**
* Control which mode the AddressElement will be used for.
*/
mode: AddressMode;
/**
* An array of two-letter ISO country codes representing which countries
* are displayed in the AddressElement.
*/
allowedCountries?: string[] | null;
/**
* Control autocomplete settings in the AddressElement.
*/
autocomplete?:
| {mode: 'automatic'}
| {mode: 'disabled'}
| {mode: 'google_maps_api'; apiKey: string};
/**
* Whether or not AddressElement accepts PO boxes
*/
blockPoBox?: boolean;
/**
* An array of saved addresses.
*/
contacts?: ContactOption[];
/**
* Default value for AddressElement fields
*/
defaultValues?: {
name?: string | null;
firstName?: string | null;
lastName?: string | null;
address?: {
line1?: string | null;
line2?: string | null;
city?: string | null;
state?: string | null;
postal_code?: string | null;
country: string;
};
phone?: string | null;
};
/**
* Control which additional fields to display in the AddressElement.
*/
fields?: {
phone?: 'always' | 'never' | 'auto';
};
/**
* Specify validation rules for the above additional fields.
*/
validation?: {
phone?: {
required: 'always' | 'never' | 'auto';
};
};
/**
* Specify display options in the AddressElement
*/
display?: {
name?: 'full' | 'split' | 'organization';
};
}
export interface StripeAddressElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'address';
/**
* The mode of the AddressElement that emitted this event.
*/
elementMode: AddressMode;
/**
* Whether or not the AddressElement is currently empty.
*/
empty: boolean;
/**
* Whether or not the AddressElement is complete.
*/
complete: boolean;
/**
* Whether or not the address is new.
*/
isNewAddress: boolean;
/**
* An object containing the current address.
*/
value: {
name: string;
firstName?: string;
lastName?: string;
address: {
line1: string;
line2: string | null;
city: string;
state: string;
postal_code: string;
country: string;
};
phone?: string;
};
}
export interface StripeAddressElementGetElementOptions {
mode: AddressMode;
}

View File

@@ -0,0 +1,265 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeAddressElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
once(
eventType: 'change',
handler: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
off(
eventType: 'change',
handler?: (event: StripeAddressElementChangeEvent) => any
): StripeAddressElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'address'; error: StripeError}) => any
): StripeAddressElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'address'}) => any
): StripeAddressElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'address'}) => any
): StripeAddressElement;
/**
* Updates the options the `AddressElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAddressElementOptions>): StripeAddressElement;
/**
* Validates and retrieves form values from the `AddressElement`.
*/
getValue(): Promise<
Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'>
>;
};
export interface ContactOption {
name: string;
phone?: string;
address: {
line1: string;
line2?: string;
city: string;
state: string;
postal_code: string;
country: string;
};
}
export type AddressMode = 'shipping' | 'billing';
export interface StripeAddressElementOptions {
/**
* Control which mode the AddressElement will be used for.
*/
mode: AddressMode;
/**
* An array of two-letter ISO country codes representing which countries
* are displayed in the AddressElement.
*/
allowedCountries?: string[] | null;
/**
* Control autocomplete settings in the AddressElement.
*/
autocomplete?:
| {mode: 'automatic'}
| {mode: 'disabled'}
| {mode: 'google_maps_api'; apiKey: string};
/**
* Whether or not AddressElement accepts PO boxes
*/
blockPoBox?: boolean;
/**
* An array of saved addresses.
*/
contacts?: ContactOption[];
/**
* Default value for AddressElement fields
*/
defaultValues?: {
name?: string | null;
firstName?: string | null;
lastName?: string | null;
address?: {
line1?: string | null;
line2?: string | null;
city?: string | null;
state?: string | null;
postal_code?: string | null;
country: string;
};
phone?: string | null;
};
/**
* Control which additional fields to display in the AddressElement.
*/
fields?: {
phone?: 'always' | 'never' | 'auto';
};
/**
* Specify validation rules for the above additional fields.
*/
validation?: {
phone?: {
required: 'always' | 'never' | 'auto';
};
};
/**
* Specify display options in the AddressElement
*/
display?: {
name?: 'full' | 'split' | 'organization';
};
}
export interface StripeAddressElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'address';
/**
* The mode of the AddressElement that emitted this event.
*/
elementMode: AddressMode;
/**
* Whether or not the AddressElement is currently empty.
*/
empty: boolean;
/**
* Whether or not the AddressElement is complete.
*/
complete: boolean;
/**
* Whether or not the address is new.
*/
isNewAddress: boolean;
/**
* An object containing the current address.
*/
value: {
name: string;
firstName?: string;
lastName?: string;
address: {
line1: string;
line2: string | null;
city: string;
state: string;
postal_code: string;
country: string;
};
phone?: string;
};
}
export interface StripeAddressElementGetElementOptions {
mode: AddressMode;
}

View File

@@ -0,0 +1,65 @@
export type StripeAffirmMessageElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#affirm-message'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `AffirmMessageElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAffirmMessageElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'affirmMessage'}) => any
): StripeAffirmMessageElement;
};
export interface StripeAffirmMessageElementOptions {
/**
* The total amount in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency: 'USD';
/**
* The affirm logo color.
*/
logoColor?: 'primary' | 'black' | 'white';
/**
* The font color of the promotional message.
*/
fontColor?: string;
/**
* The font size of the promotional message.
*/
fontSize?: string;
/**
* The text alignment of the promotional message.
*/
textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify';
}

View File

@@ -0,0 +1,65 @@
export type StripeAffirmMessageElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#affirm-message'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `AffirmMessageElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAffirmMessageElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'affirmMessage'}) => any
): StripeAffirmMessageElement;
};
export interface StripeAffirmMessageElementOptions {
/**
* The total amount in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency: 'USD';
/**
* The affirm logo color.
*/
logoColor?: 'primary' | 'black' | 'white';
/**
* The font color of the promotional message.
*/
fontColor?: string;
/**
* The font size of the promotional message.
*/
fontSize?: string;
/**
* The text alignment of the promotional message.
*/
textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify';
}

View File

@@ -0,0 +1,119 @@
export type StripeAfterpayClearpayMessageElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#afterpay-clearpay-message'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `AfterpayClearpayMessageElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAfterpayClearpayMessageElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'afterpayClearpayMessage'}) => any
): StripeAfterpayClearpayMessageElement;
};
export interface StripeAfterpayClearpayMessageElementOptions {
/**
* The total amount, divided into 4 installments, in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency: 'USD' | 'AUD' | 'CAD' | 'GBP' | 'NZD' | 'EUR';
/**
* The badge color theme, applied when `logoType` is set to badge.
*/
badgeTheme?:
| 'black-on-mint'
| 'black-on-white'
| 'mint-on-black'
| 'white-on-black';
/**
* The leading text for the mesage.
*/
introText?: 'In' | 'in' | 'Or' | 'or' | 'Pay' | 'pay' | 'Pay in' | 'pay in';
/**
* Indicates whether an item is eligible for purchase with Afterpay Clearpay.
*/
isEligible?: boolean;
/**
* Indicates whether an entire cart is eligible for purchase with Afterpay Clearpay.
*/
isCartEligible?: boolean;
/**
* The lockup color theme, applied when `logoType` is set to lockup.
*/
lockupTheme?: 'black' | 'white' | 'mint';
/**
* The logo style to display.
*/
logoType?: 'badge' | 'lockup';
/**
* The maximum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard.
*/
max?: number;
/**
* The minimum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard.
*/
min?: number;
/**
* The style of modal link to display.
*/
modalLinkStyle?: 'circled-info-icon' | 'learn-more-text' | 'more-info-text';
/**
* The background color for the info modal.
*/
modalTheme?: 'mint' | 'white';
/**
* Determines whether 'interest-free' is displayed in the message.
*/
showInterestFree?: boolean;
/**
* Determines whether 'with' is displayed before the logo.
*/
showLowerLimit?: boolean;
/**
* Determines whether the lower limit is displayed when `amount` exceeds price limits.
*/
showUpperLimit?: boolean;
/**
* Determines whether the upper limit is displayed when `amount` exceeds price limits.
*/
showWith?: boolean;
}

View File

@@ -0,0 +1,119 @@
export type StripeAfterpayClearpayMessageElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#afterpay-clearpay-message'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `AfterpayClearpayMessageElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripeAfterpayClearpayMessageElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'afterpayClearpayMessage'}) => any
): StripeAfterpayClearpayMessageElement;
};
export interface StripeAfterpayClearpayMessageElementOptions {
/**
* The total amount, divided into 4 installments, in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency: 'USD' | 'AUD' | 'CAD' | 'GBP' | 'NZD' | 'EUR';
/**
* The badge color theme, applied when `logoType` is set to badge.
*/
badgeTheme?:
| 'black-on-mint'
| 'black-on-white'
| 'mint-on-black'
| 'white-on-black';
/**
* The leading text for the mesage.
*/
introText?: 'In' | 'in' | 'Or' | 'or' | 'Pay' | 'pay' | 'Pay in' | 'pay in';
/**
* Indicates whether an item is eligible for purchase with Afterpay Clearpay.
*/
isEligible?: boolean;
/**
* Indicates whether an entire cart is eligible for purchase with Afterpay Clearpay.
*/
isCartEligible?: boolean;
/**
* The lockup color theme, applied when `logoType` is set to lockup.
*/
lockupTheme?: 'black' | 'white' | 'mint';
/**
* The logo style to display.
*/
logoType?: 'badge' | 'lockup';
/**
* The maximum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard.
*/
max?: number;
/**
* The minimum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard.
*/
min?: number;
/**
* The style of modal link to display.
*/
modalLinkStyle?: 'circled-info-icon' | 'learn-more-text' | 'more-info-text';
/**
* The background color for the info modal.
*/
modalTheme?: 'mint' | 'white';
/**
* Determines whether 'interest-free' is displayed in the message.
*/
showInterestFree?: boolean;
/**
* Determines whether 'with' is displayed before the logo.
*/
showLowerLimit?: boolean;
/**
* Determines whether the lower limit is displayed when `amount` exceeds price limits.
*/
showUpperLimit?: boolean;
/**
* Determines whether the upper limit is displayed when `amount` exceeds price limits.
*/
showWith?: boolean;
}

View File

@@ -0,0 +1,157 @@
export type ApplePayRecurringPaymentRequestIntervalUnit =
| 'year'
| 'month'
| 'day'
| 'hour'
| 'minute';
export interface ApplePayLineItem {
/**
* A short, localized description of the line item.
*/
label: string;
/**
* The amount in the currency's subunit (e.g. cents, yen, etc.)
*/
amount: number;
}
export type ApplePayRegularBilling = ApplePayLineItem & {
/**
* The date of the first payment.
*/
recurringPaymentStartDate?: Date;
/**
* The date of the final payment.
*/
recurringPaymentEndDate?: Date;
/**
* The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval.
*/
recurringPaymentIntervalUnit?: ApplePayRecurringPaymentRequestIntervalUnit;
/**
* The number of interval units that make up the total payment interval.
*/
recurringPaymentIntervalCount?: number;
};
export interface ApplePayRecurringPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the recurring payment on your website.
*/
managementURL: string;
regularBilling: ApplePayRegularBilling;
trialBilling?: ApplePayRegularBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
}
export type ApplePayAutomaticReloadBilling = ApplePayLineItem & {
/**
* The balance an account reaches before the merchant applies the automatic reload amount.
*/
automaticReloadPaymentThresholdAmount: number;
};
export interface ApplePayAutomaticReloadPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the automatic reload payment on your website.
*/
managementURL: string;
automaticReloadBilling: ApplePayAutomaticReloadBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
}
export type ApplePayDeferredBilling = ApplePayLineItem & {
/**
* The date, in the future, of the payment.
*/
deferredPaymentDate: Date;
};
export interface ApplePayDeferredPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the deferred payment on your website.
*/
managementURL: string;
deferredBilling: ApplePayDeferredBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
/**
* The future date before which the customer can cancel the deferred payment for free.
*/
freeCancellationDate?: Date;
/**
* The time zone of the free cancellation date.
*
* 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`.
*/
freeCancellationDateTimeZone?: string;
}
export type ApplePayOption =
| {
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest: ApplePayDeferredPaymentRequest;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
};
export type ApplePayUpdateOption =
| {
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
}
| {
recurringPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
};

View File

@@ -0,0 +1,157 @@
export type ApplePayRecurringPaymentRequestIntervalUnit =
| 'year'
| 'month'
| 'day'
| 'hour'
| 'minute';
export interface ApplePayLineItem {
/**
* A short, localized description of the line item.
*/
label: string;
/**
* The amount in the currency's subunit (e.g. cents, yen, etc.)
*/
amount: number;
}
export type ApplePayRegularBilling = ApplePayLineItem & {
/**
* The date of the first payment.
*/
recurringPaymentStartDate?: Date;
/**
* The date of the final payment.
*/
recurringPaymentEndDate?: Date;
/**
* The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval.
*/
recurringPaymentIntervalUnit?: ApplePayRecurringPaymentRequestIntervalUnit;
/**
* The number of interval units that make up the total payment interval.
*/
recurringPaymentIntervalCount?: number;
};
export interface ApplePayRecurringPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the recurring payment on your website.
*/
managementURL: string;
regularBilling: ApplePayRegularBilling;
trialBilling?: ApplePayRegularBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
}
export type ApplePayAutomaticReloadBilling = ApplePayLineItem & {
/**
* The balance an account reaches before the merchant applies the automatic reload amount.
*/
automaticReloadPaymentThresholdAmount: number;
};
export interface ApplePayAutomaticReloadPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the automatic reload payment on your website.
*/
managementURL: string;
automaticReloadBilling: ApplePayAutomaticReloadBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
}
export type ApplePayDeferredBilling = ApplePayLineItem & {
/**
* The date, in the future, of the payment.
*/
deferredPaymentDate: Date;
};
export interface ApplePayDeferredPaymentRequest {
/**
* The description of the payment that the customer will see in their Apple Pay wallet.
*/
paymentDescription: string;
/**
* The URL to manage items related to the deferred payment on your website.
*/
managementURL: string;
deferredBilling: ApplePayDeferredBilling;
/**
* The billing agreement label that is displayed to the customer in the Apple Pay payment interface.
*/
billingAgreement?: string;
/**
* The future date before which the customer can cancel the deferred payment for free.
*/
freeCancellationDate?: Date;
/**
* The time zone of the free cancellation date.
*
* 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`.
*/
freeCancellationDateTimeZone?: string;
}
export type ApplePayOption =
| {
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest: ApplePayDeferredPaymentRequest;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
}
| {
recurringPaymentRequest?: null;
deferredPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
};
export type ApplePayUpdateOption =
| {
recurringPaymentRequest: ApplePayRecurringPaymentRequest;
automaticReloadPaymentRequest?: null;
}
| {
recurringPaymentRequest?: null;
automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest;
}
| {
recurringPaymentRequest?: null;
automaticReloadPaymentRequest?: null;
};

View File

@@ -0,0 +1,138 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeAuBankAccountElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
once(
eventType: 'change',
handler: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
off(
eventType: 'change',
handler?: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Updates the options the `AuBankAccountElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `AuBankAccountElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeAuBankAccountElementOptions>): void;
};
export interface StripeAuBankAccountElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeAuBankAccountElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'auBankAccount';
/**
* The bank name corresponding to the entered BSB.
*/
bankName?: string;
/**
* The branch name corresponding to the entered BSB.
*/
branchName?: string;
}

View File

@@ -0,0 +1,138 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeAuBankAccountElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
once(
eventType: 'change',
handler: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
off(
eventType: 'change',
handler?: (event: StripeAuBankAccountElementChangeEvent) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'auBankAccount'}) => any
): StripeAuBankAccountElement;
/**
* Updates the options the `AuBankAccountElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `AuBankAccountElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeAuBankAccountElementOptions>): void;
};
export interface StripeAuBankAccountElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeAuBankAccountElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'auBankAccount';
/**
* The bank name corresponding to the entered BSB.
*/
bankName?: string;
/**
* The branch name corresponding to the entered BSB.
*/
branchName?: string;
}

View File

@@ -0,0 +1,264 @@
import {StripeElementType} from '../elements-group';
export type StripeElementBase = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element.
*
* You need to create a container DOM element to mount an `Element`.
* If the container DOM element has a label, the `Element` is automatically focused when its label is clicked.
* There are two ways to do this:
*
* 1. Mount the instance within a `<label>`.
* 2. Create a `<label>` with a `for` attribute, referencing the ID of your container.
*/
mount(domElement: string | HTMLElement): void;
/**
* Blurs the element.
*/
blur(): void;
/**
* Clears the value(s) of the element.
*/
clear(): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Focuses the element.
*/
focus(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
};
/**
* Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant.
*/
export interface StripeElementStyle {
/**
* Base variant—all other variants inherit from these styles.
*/
base?: StripeElementStyleVariant;
/**
* Applied when the element has valid input.
*/
complete?: StripeElementStyleVariant;
/**
* Applied when the element has no customer input.
*/
empty?: StripeElementStyleVariant;
/**
* Applied when the element has invalid input.
*/
invalid?: StripeElementStyleVariant;
}
/**
* An object with `CSSProperties` supported by Stripe.js.
* Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant.
*/
export interface StripeElementStyleVariant extends StripeElementCSSProperties {
':hover'?: StripeElementCSSProperties;
':focus'?: StripeElementCSSProperties;
'::placeholder'?: StripeElementCSSProperties;
'::selection'?: StripeElementCSSProperties;
':-webkit-autofill'?: StripeElementCSSProperties;
/**
* Available for all elements except the `paymentRequestButton` element
*/
':disabled'?: StripeElementCSSProperties;
/**
* Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
*/
'::-ms-clear'?: StripeElementCSSProperties & {display: string};
}
/**
* CSS properties supported by Stripe.js.
*/
export interface StripeElementCSSProperties {
/**
* The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property.
*
* This property works best with the `::selection` pseudo-class.
* In other cases, consider setting the background color on the element's container instaed.
*/
backgroundColor?: string;
/**
* The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property.
*/
color?: string;
/**
* The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property.
*/
fontFamily?: string;
/**
* The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property.
*/
fontSize?: string;
/**
* The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property.
*/
fontSmoothing?: string;
/**
* The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property.
*/
fontStyle?: string;
/**
* The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property.
*/
fontVariant?: string;
/**
* The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property.
*/
fontWeight?: string | number;
/**
* A custom property, used to set the color of the icons that are rendered in an element.
*/
iconColor?: string;
/**
* The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property.
*
* To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead.
*/
lineHeight?: string;
/**
* The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property.
*/
letterSpacing?: string;
/**
* The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property.
*
* Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
*/
textAlign?: string;
/**
* The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property.
*
* Available for the `idealBank` element.
* Accepts integer length with `px` unit as values.
*/
padding?: string;
/**
* The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property.
*/
textDecoration?: string;
/**
* The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property.
*/
textShadow?: string;
/**
* The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property.
*/
textTransform?: string;
}
/**
* Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state.
*/
export interface StripeElementClasses {
/**
* The base class applied to the container.
* Defaults to `StripeElement`.
*/
base?: string;
/**
* The class name to apply when the `Element` is complete.
* Defaults to `StripeElement--complete`.
*/
complete?: string;
/**
* The class name to apply when the `Element` is empty.
* Defaults to `StripeElement--empty`.
*/
empty?: string;
/**
* The class name to apply when the `Element` is focused.
* Defaults to `StripeElement--focus`.
*/
focus?: string;
/**
* The class name to apply when the `Element` is invalid.
* Defaults to `StripeElement--invalid`.
*/
invalid?: string;
/**
* The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari).
* Defaults to `StripeElement--webkit-autofill`.
*/
webkitAutofill?: string;
}
export interface StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: StripeElementType;
/**
* `true` if the value is empty.
*/
empty: boolean;
/**
* `true` if the value is well-formed and potentially complete.
* The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission.
*
* It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value.
* In many cases the customer could still add further input.
*
* The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request.
*/
complete: boolean;
/**
* The current validation error, if any.
*/
error:
| undefined
| {
type: 'validation_error';
code: string;
message: string;
};
}

View File

@@ -0,0 +1,264 @@
import {StripeElementType} from '../elements-group';
export type StripeElementBase = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element.
*
* You need to create a container DOM element to mount an `Element`.
* If the container DOM element has a label, the `Element` is automatically focused when its label is clicked.
* There are two ways to do this:
*
* 1. Mount the instance within a `<label>`.
* 2. Create a `<label>` with a `for` attribute, referencing the ID of your container.
*/
mount(domElement: string | HTMLElement): void;
/**
* Blurs the element.
*/
blur(): void;
/**
* Clears the value(s) of the element.
*/
clear(): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Focuses the element.
*/
focus(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
};
/**
* Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant.
*/
export interface StripeElementStyle {
/**
* Base variant—all other variants inherit from these styles.
*/
base?: StripeElementStyleVariant;
/**
* Applied when the element has valid input.
*/
complete?: StripeElementStyleVariant;
/**
* Applied when the element has no customer input.
*/
empty?: StripeElementStyleVariant;
/**
* Applied when the element has invalid input.
*/
invalid?: StripeElementStyleVariant;
}
/**
* An object with `CSSProperties` supported by Stripe.js.
* Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant.
*/
export interface StripeElementStyleVariant extends StripeElementCSSProperties {
':hover'?: StripeElementCSSProperties;
':focus'?: StripeElementCSSProperties;
'::placeholder'?: StripeElementCSSProperties;
'::selection'?: StripeElementCSSProperties;
':-webkit-autofill'?: StripeElementCSSProperties;
/**
* Available for all elements except the `paymentRequestButton` element
*/
':disabled'?: StripeElementCSSProperties;
/**
* Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
*/
'::-ms-clear'?: StripeElementCSSProperties & {display: string};
}
/**
* CSS properties supported by Stripe.js.
*/
export interface StripeElementCSSProperties {
/**
* The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property.
*
* This property works best with the `::selection` pseudo-class.
* In other cases, consider setting the background color on the element's container instaed.
*/
backgroundColor?: string;
/**
* The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property.
*/
color?: string;
/**
* The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property.
*/
fontFamily?: string;
/**
* The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property.
*/
fontSize?: string;
/**
* The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property.
*/
fontSmoothing?: string;
/**
* The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property.
*/
fontStyle?: string;
/**
* The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property.
*/
fontVariant?: string;
/**
* The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property.
*/
fontWeight?: string | number;
/**
* A custom property, used to set the color of the icons that are rendered in an element.
*/
iconColor?: string;
/**
* The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property.
*
* To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead.
*/
lineHeight?: string;
/**
* The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property.
*/
letterSpacing?: string;
/**
* The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property.
*
* Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements.
*/
textAlign?: string;
/**
* The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property.
*
* Available for the `idealBank` element.
* Accepts integer length with `px` unit as values.
*/
padding?: string;
/**
* The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property.
*/
textDecoration?: string;
/**
* The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property.
*/
textShadow?: string;
/**
* The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property.
*/
textTransform?: string;
}
/**
* Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state.
*/
export interface StripeElementClasses {
/**
* The base class applied to the container.
* Defaults to `StripeElement`.
*/
base?: string;
/**
* The class name to apply when the `Element` is complete.
* Defaults to `StripeElement--complete`.
*/
complete?: string;
/**
* The class name to apply when the `Element` is empty.
* Defaults to `StripeElement--empty`.
*/
empty?: string;
/**
* The class name to apply when the `Element` is focused.
* Defaults to `StripeElement--focus`.
*/
focus?: string;
/**
* The class name to apply when the `Element` is invalid.
* Defaults to `StripeElement--invalid`.
*/
invalid?: string;
/**
* The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari).
* Defaults to `StripeElement--webkit-autofill`.
*/
webkitAutofill?: string;
}
export interface StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: StripeElementType;
/**
* `true` if the value is empty.
*/
empty: boolean;
/**
* `true` if the value is well-formed and potentially complete.
* The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission.
*
* It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value.
* In many cases the customer could still add further input.
*
* The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request.
*/
complete: boolean;
/**
* The current validation error, if any.
*/
error:
| undefined
| {
type: 'validation_error';
code: string;
message: string;
};
}

View File

@@ -0,0 +1,119 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeCardCvcElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
once(
eventType: 'change',
handler: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
off(
eventType: 'change',
handler?: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Updates the options the `CardCvcElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardCvcElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardCvcElementOptions>): void;
};
export interface StripeCardCvcElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeCardCvcElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardCvc';
}

View File

@@ -0,0 +1,119 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeCardCvcElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
once(
eventType: 'change',
handler: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
off(
eventType: 'change',
handler?: (event: StripeCardCvcElementChangeEvent) => any
): StripeCardCvcElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardCvc'}) => any
): StripeCardCvcElement;
/**
* Updates the options the `CardCvcElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardCvcElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardCvcElementOptions>): void;
};
export interface StripeCardCvcElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeCardCvcElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardCvc';
}

View File

@@ -0,0 +1,119 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeCardExpiryElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
once(
eventType: 'change',
handler: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
off(
eventType: 'change',
handler?: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Updates the options the `CardExpiryElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardExpiryElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardExpiryElementOptions>): void;
};
export interface StripeCardExpiryElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeCardExpiryElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardExpiry';
}

View File

@@ -0,0 +1,119 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeCardExpiryElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
once(
eventType: 'change',
handler: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
off(
eventType: 'change',
handler?: (event: StripeCardExpiryElementChangeEvent) => any
): StripeCardExpiryElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardExpiry'}) => any
): StripeCardExpiryElement;
/**
* Updates the options the `CardExpiryElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardExpiryElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardExpiryElementOptions>): void;
};
export interface StripeCardExpiryElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeCardExpiryElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardExpiry';
}

View File

@@ -0,0 +1,217 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
import {StripeError} from '../stripe';
import {CardNetworkBrand} from '../elements-group';
export type StripeCardNumberElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
once(
eventType: 'change',
handler: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
off(
eventType: 'change',
handler?: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when there is a change to the available networks the provided card can run on.
*/
on(
eventType: 'networkschange',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'networkschange',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'networkschange',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
/**
* Updates the options the `CardNumberElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `Element` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardNumberElementUpdateOptions>): void;
};
export interface StripeCardNumberElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Show a card brand icon in the Element.
* Default is `false`.
*/
showIcon?: boolean;
/**
* Appearance of the brand icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides and disables the Link Button in the Card Element.
* Default is `false`.
*/
disableLink?: boolean;
/**
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
* entry of a co-branded card.
*
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
*/
preferredNetwork?: Array<CardNetworkBrand>;
}
export interface StripeCardNumberElementUpdateOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Show a card brand icon in the Element.
* Default is `false`.
*/
showIcon?: boolean;
/**
* Appearance of the brand icon in the Element.
*/
iconStyle?: 'default' | 'solid';
}
export interface StripeCardNumberElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardNumber';
/*
* The card brand of the card number being entered.
*/
brand:
| 'visa'
| 'mastercard'
| 'amex'
| 'discover'
| 'diners'
| 'jcb'
| 'unionpay'
| 'unknown';
}

View File

@@ -0,0 +1,217 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
import {StripeError} from '../stripe';
import {CardNetworkBrand} from '../elements-group';
export type StripeCardNumberElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
once(
eventType: 'change',
handler: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
off(
eventType: 'change',
handler?: (event: StripeCardNumberElementChangeEvent) => any
): StripeCardNumberElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when there is a change to the available networks the provided card can run on.
*/
on(
eventType: 'networkschange',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
once(
eventType: 'networkschange',
handler: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
off(
eventType: 'networkschange',
handler?: (event: {elementType: 'cardNumber'}) => any
): StripeCardNumberElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'cardNumber'; error: StripeError}) => any
): StripeCardNumberElement;
/**
* Updates the options the `CardNumberElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `Element` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeCardNumberElementUpdateOptions>): void;
};
export interface StripeCardNumberElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Show a card brand icon in the Element.
* Default is `false`.
*/
showIcon?: boolean;
/**
* Appearance of the brand icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides and disables the Link Button in the Card Element.
* Default is `false`.
*/
disableLink?: boolean;
/**
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
* entry of a co-branded card.
*
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
*/
preferredNetwork?: Array<CardNetworkBrand>;
}
export interface StripeCardNumberElementUpdateOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
placeholder?: string;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Show a card brand icon in the Element.
* Default is `false`.
*/
showIcon?: boolean;
/**
* Appearance of the brand icon in the Element.
*/
iconStyle?: 'default' | 'solid';
}
export interface StripeCardNumberElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'cardNumber';
/*
* The card brand of the card number being entered.
*/
brand:
| 'visa'
| 'mastercard'
| 'amex'
| 'discover'
| 'diners'
| 'jcb'
| 'unionpay'
| 'unknown';
}

View File

@@ -0,0 +1,243 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
import {StripeError} from '../stripe';
import {CardNetworkBrand} from '../elements-group';
export type StripeCardElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
once(
eventType: 'change',
handler: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
off(
eventType: 'change',
handler?: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when there is a change to the available networks the provided card can run on.
*/
on(
eventType: 'networkschange',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'networkschange',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'networkschange',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
/**
* Updates the options the `CardElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: StripeCardElementUpdateOptions): void;
};
export interface StripeCardElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`).
* Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled.
*/
value?: {postalCode?: string};
/**
* Hide the postal code field.
* Default is `false`.
* If you are already collecting a full billing address or postal code elsewhere, set this to `true`.
*/
hidePostalCode?: boolean;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Hides and disables the Link Button in the Card Element.
* Default is `false`.
*/
disableLink?: boolean;
/**
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
* entry of a co-branded card.
*
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
*/
preferredNetwork?: Array<CardNetworkBrand>;
}
export interface StripeCardElementUpdateOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`).
* Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled.
*/
value?: {postalCode?: string};
/**
* Hide the postal code field.
* Default is `false`.
* If you are already collecting a full billing address or postal code elsewhere, set this to `true`.
*/
hidePostalCode?: boolean;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
}
export interface StripeCardElementChangeEvent extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'card';
/**
* An object containing the currently entered `postalCode`.
*/
value: {postalCode: string};
/*
* The card brand of the card number being entered.
*/
brand:
| 'visa'
| 'mastercard'
| 'amex'
| 'discover'
| 'diners'
| 'jcb'
| 'unionpay'
| 'unknown';
}

View File

@@ -0,0 +1,243 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
import {StripeError} from '../stripe';
import {CardNetworkBrand} from '../elements-group';
export type StripeCardElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
once(
eventType: 'change',
handler: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
off(
eventType: 'change',
handler?: (event: StripeCardElementChangeEvent) => any
): StripeCardElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when there is a change to the available networks the provided card can run on.
*/
on(
eventType: 'networkschange',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
once(
eventType: 'networkschange',
handler: (event: {elementType: 'card'}) => any
): StripeCardElement;
off(
eventType: 'networkschange',
handler?: (event: {elementType: 'card'}) => any
): StripeCardElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'card'; error: StripeError}) => any
): StripeCardElement;
/**
* Updates the options the `CardElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `CardElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: StripeCardElementUpdateOptions): void;
};
export interface StripeCardElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`).
* Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled.
*/
value?: {postalCode?: string};
/**
* Hide the postal code field.
* Default is `false`.
* If you are already collecting a full billing address or postal code elsewhere, set this to `true`.
*/
hidePostalCode?: boolean;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
/**
* Hides and disables the Link Button in the Card Element.
* Default is `false`.
*/
disableLink?: boolean;
/**
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
* entry of a co-branded card.
*
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
*/
preferredNetwork?: Array<CardNetworkBrand>;
}
export interface StripeCardElementUpdateOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`).
* Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled.
*/
value?: {postalCode?: string};
/**
* Hide the postal code field.
* Default is `false`.
* If you are already collecting a full billing address or postal code elsewhere, set this to `true`.
*/
hidePostalCode?: boolean;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is `false`.
*/
disabled?: boolean;
}
export interface StripeCardElementChangeEvent extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'card';
/**
* An object containing the currently entered `postalCode`.
*/
value: {postalCode: string};
/*
* The card brand of the card number being entered.
*/
brand:
| 'visa'
| 'mastercard'
| 'amex'
| 'discover'
| 'diners'
| 'jcb'
| 'unionpay'
| 'unknown';
}

View File

@@ -0,0 +1,93 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeCurrencySelectorElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
};

View File

@@ -0,0 +1,93 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeCurrencySelectorElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'currencySelector'}) => any
): StripeCurrencySelectorElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'currencySelector';
error: StripeError;
}) => any
): StripeCurrencySelectorElement;
};

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeEpsBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
once(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
off(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Updates the options the `EpsBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `EpsBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeEpsBankElementOptions>): void;
};
export interface StripeEpsBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeEpsBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'epsBank';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
}

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeEpsBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
once(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
off(
eventType: 'change',
handler: (event: StripeEpsBankElementChangeEvent) => any
): StripeEpsBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'ready',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'focus',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'blur',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
off(
eventType: 'escape',
handler: (event: {elementType: 'epsBank'}) => any
): StripeEpsBankElement;
/**
* Updates the options the `EpsBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `EpsBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeEpsBankElementOptions>): void;
};
export interface StripeEpsBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeEpsBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'epsBank';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
}

View File

@@ -0,0 +1,479 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
import {ApplePayOption, ApplePayUpdateOption} from './apple-pay';
export type StripeExpressCheckoutElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'ready',
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a button on the element is clicked.
*/
on(
eventType: 'click',
handler: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'click',
handler: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'click',
handler?: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer authorizes a payment within a supported payment method.
*/
on(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'confirm',
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
*/
on(
eventType: 'cancel',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'cancel',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'cancel',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer selects a different shipping address.
*/
on(
eventType: 'shippingaddresschange',
handler: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
once(
eventType: 'shippingaddresschange',
handler: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
off(
eventType: 'shippingaddresschange',
handler?: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer selects a different shipping rate.
*/
on(
eventType: 'shippingratechange',
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'shippingratechange',
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'shippingratechange',
handler?: (
event: StripeExpressCheckoutElementShippingRateChangeEvent
) => any
): StripeExpressCheckoutElement;
/**
* Updates the options the `ExpressCheckoutElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(
options: StripeExpressCheckoutElementUpdateOptions
): StripeExpressCheckoutElement;
};
export type ExpressPaymentType =
| 'google_pay'
| 'apple_pay'
| 'amazon_pay'
| 'link'
| 'paypal';
export type ExpressCheckoutPartialAddress = {
city: string;
state: string;
postal_code: string;
country: string;
};
export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & {
line1: string;
line2: string | null;
};
export type BillingDetails = {
name: string;
email?: string;
phone?: string;
address: ExpressCheckoutAddress;
};
export type ShippingAddress = {
name: string;
address: ExpressCheckoutAddress;
};
export type LineItem = {
name: string;
amount: number;
};
export type DeliveryUnit = 'hour' | 'day' | 'business_day' | 'week' | 'month';
export type DeliveryEstimate = {
unit: DeliveryUnit;
value: number;
};
export type ShippingRate = {
id: string;
amount: number;
displayName: string;
deliveryEstimate?:
| string
| {
maximum?: DeliveryEstimate;
minimum?: DeliveryEstimate;
};
};
export type LayoutOption = {
maxColumns?: number;
maxRows?: number;
overflow?: 'auto' | 'never';
};
export type ExpressCheckoutPaymentMethodOptionWithAlways =
| 'always'
| ExpressCheckoutPaymentMethodOption;
export type ExpressCheckoutPaymentMethodOption = 'auto' | 'never';
export type ExpressCheckoutPaymentMethodsOption = {
amazonPay?: ExpressCheckoutPaymentMethodOption;
applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
link?: ExpressCheckoutPaymentMethodOption;
paypal?: ExpressCheckoutPaymentMethodOption;
};
export type ExpressCheckoutWalletsOption = {
applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
};
export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
export type GooglePayButtonTheme = 'black' | 'white';
export type PayPalButtonTheme = 'gold' | 'blue' | 'silver' | 'white' | 'black';
export type ButtonThemeOption = {
applePay?: ApplePayButtonTheme;
googlePay?: GooglePayButtonTheme;
paypal?: PayPalButtonTheme;
};
export type ApplePayButtonType =
| 'add-money'
| 'book'
| 'buy'
| 'check-out'
| 'contribute'
| 'donate'
| 'order'
| 'plain'
| 'reload'
| 'rent'
| 'subscribe'
| 'support'
| 'tip'
| 'top-up';
export type GooglePayButtonType =
| 'book'
| 'buy'
| 'checkout'
| 'donate'
| 'order'
| 'pay'
| 'plain'
| 'subscribe';
export type PayPalButtonType = 'paypal' | 'buynow' | 'checkout' | 'pay';
export type ButtonTypeOption = {
applePay?: ApplePayButtonType;
googlePay?: GooglePayButtonType;
paypal?: PayPalButtonType;
};
export interface StripeExpressCheckoutElementOptions {
/**
* Manually sets the height of the buttons shown.
*/
buttonHeight?: number;
/**
* Controls the color of each button.
*/
buttonTheme?: ButtonThemeOption;
/**
* Specifies the type of each button.
*/
buttonType?: ButtonTypeOption;
/**
* Specifies how buttons should be laid out in relation to each other.
*/
layout?: LayoutOption;
/**
* Override the order in which payment methods are displayed in the Express Checkout Element.
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
/**
* Control payment method display in the Express Checkout Element.
*/
paymentMethods?: ExpressCheckoutPaymentMethodsOption;
/**
* @deprecated
* Use `paymentMethods` instead.
*
* Control wallets display in the Express Checkout Element.
*/
wallets?: ExpressCheckoutWalletsOption;
}
/*
* Updatable options for an `Elements` instance
*/
export interface StripeExpressCheckoutElementUpdateOptions {
/**
* Manually sets the height of the buttons shown.
*/
buttonHeight?: number;
/**
* Specifies how buttons should be laid out in relation to each other.
*/
layout?: LayoutOption;
/**
* Override the order in which payment methods are displayed in the Pay Button Element.
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
}
export type AvailablePaymentMethods = {
amazonPay: boolean;
applePay: boolean;
googlePay: boolean;
link: boolean;
paypal: boolean;
};
export interface StripeExpressCheckoutElementReadyEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'expressCheckout';
/**
* The list of payment methods that could possibly show in the element, or undefined if no payment methods can show.
*/
availablePaymentMethods: undefined | AvailablePaymentMethods;
}
export type ClickResolveDetails = {
/**
* An array of two-letter ISO country codes representing which countries
* are eligible shipping locations.
*/
allowedShippingCountries?: string[];
billingAddressRequired?: boolean;
/**
* Provide information about your business that will be displayed in the payment interface.
* This information will be retrieved from your Stripe account if not provided.
*/
business?: {name: string};
emailRequired?: boolean;
lineItems?: Array<LineItem>;
phoneNumberRequired?: boolean;
shippingAddressRequired?: boolean;
shippingRates?: Array<ShippingRate>;
applePay?: ApplePayOption;
};
export interface StripeExpressCheckoutElementClickEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'expressCheckout';
/**
* The payment method associated with the button that was clicked.
*/
expressPaymentType: ExpressPaymentType;
/**
* Callback to configure the details shown on a payment interface, including which fields to collect.
* This must be called within 1 second of the 'click' event being emitted.
*/
resolve: (resolveDetails?: ClickResolveDetails) => void;
}
export interface StripeExpressCheckoutElementConfirmEvent {
/**
* Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface.
*/
paymentFailed: (payload?: {
reason?: 'fail' | 'invalid_shipping_address';
}) => void;
billingDetails?: BillingDetails;
shippingAddress?: ShippingAddress;
shippingRate?: ShippingRate;
expressPaymentType: ExpressPaymentType;
}
export type ChangeResolveDetails = {
lineItems?: Array<LineItem>;
shippingRates?: Array<ShippingRate>;
applePay?: ApplePayUpdateOption;
};
export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
name: string;
address: ExpressCheckoutPartialAddress;
resolve: (resolveDetails?: ChangeResolveDetails) => void;
reject: () => void;
}
export interface StripeExpressCheckoutElementShippingRateChangeEvent {
shippingRate: ShippingRate;
resolve: (resolveDetails?: ChangeResolveDetails) => void;
reject: () => void;
}

View File

@@ -0,0 +1,479 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
import {ApplePayOption, ApplePayUpdateOption} from './apple-pay';
export type StripeExpressCheckoutElement = StripeElementBase & {
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'ready',
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'ready',
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a button on the element is clicked.
*/
on(
eventType: 'click',
handler: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'click',
handler: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'click',
handler?: (event: StripeExpressCheckoutElementClickEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'expressCheckout';
error: StripeError;
}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer authorizes a payment within a supported payment method.
*/
on(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'confirm',
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'confirm',
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
*/
on(
eventType: 'cancel',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
once(
eventType: 'cancel',
handler: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
off(
eventType: 'cancel',
handler?: (event: {elementType: 'expressCheckout'}) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer selects a different shipping address.
*/
on(
eventType: 'shippingaddresschange',
handler: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
once(
eventType: 'shippingaddresschange',
handler: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
off(
eventType: 'shippingaddresschange',
handler?: (
event: StripeExpressCheckoutElementShippingAddressChangeEvent
) => any
): StripeExpressCheckoutElement;
/**
* Triggered when a buyer selects a different shipping rate.
*/
on(
eventType: 'shippingratechange',
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
): StripeExpressCheckoutElement;
once(
eventType: 'shippingratechange',
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
): StripeExpressCheckoutElement;
off(
eventType: 'shippingratechange',
handler?: (
event: StripeExpressCheckoutElementShippingRateChangeEvent
) => any
): StripeExpressCheckoutElement;
/**
* Updates the options the `ExpressCheckoutElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(
options: StripeExpressCheckoutElementUpdateOptions
): StripeExpressCheckoutElement;
};
export type ExpressPaymentType =
| 'google_pay'
| 'apple_pay'
| 'amazon_pay'
| 'link'
| 'paypal';
export type ExpressCheckoutPartialAddress = {
city: string;
state: string;
postal_code: string;
country: string;
};
export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & {
line1: string;
line2: string | null;
};
export type BillingDetails = {
name: string;
email?: string;
phone?: string;
address: ExpressCheckoutAddress;
};
export type ShippingAddress = {
name: string;
address: ExpressCheckoutAddress;
};
export type LineItem = {
name: string;
amount: number;
};
export type DeliveryUnit = 'hour' | 'day' | 'business_day' | 'week' | 'month';
export type DeliveryEstimate = {
unit: DeliveryUnit;
value: number;
};
export type ShippingRate = {
id: string;
amount: number;
displayName: string;
deliveryEstimate?:
| string
| {
maximum?: DeliveryEstimate;
minimum?: DeliveryEstimate;
};
};
export type LayoutOption = {
maxColumns?: number;
maxRows?: number;
overflow?: 'auto' | 'never';
};
export type ExpressCheckoutPaymentMethodOptionWithAlways =
| 'always'
| ExpressCheckoutPaymentMethodOption;
export type ExpressCheckoutPaymentMethodOption = 'auto' | 'never';
export type ExpressCheckoutPaymentMethodsOption = {
amazonPay?: ExpressCheckoutPaymentMethodOption;
applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
link?: ExpressCheckoutPaymentMethodOption;
paypal?: ExpressCheckoutPaymentMethodOption;
};
export type ExpressCheckoutWalletsOption = {
applePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
googlePay?: ExpressCheckoutPaymentMethodOptionWithAlways;
};
export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
export type GooglePayButtonTheme = 'black' | 'white';
export type PayPalButtonTheme = 'gold' | 'blue' | 'silver' | 'white' | 'black';
export type ButtonThemeOption = {
applePay?: ApplePayButtonTheme;
googlePay?: GooglePayButtonTheme;
paypal?: PayPalButtonTheme;
};
export type ApplePayButtonType =
| 'add-money'
| 'book'
| 'buy'
| 'check-out'
| 'contribute'
| 'donate'
| 'order'
| 'plain'
| 'reload'
| 'rent'
| 'subscribe'
| 'support'
| 'tip'
| 'top-up';
export type GooglePayButtonType =
| 'book'
| 'buy'
| 'checkout'
| 'donate'
| 'order'
| 'pay'
| 'plain'
| 'subscribe';
export type PayPalButtonType = 'paypal' | 'buynow' | 'checkout' | 'pay';
export type ButtonTypeOption = {
applePay?: ApplePayButtonType;
googlePay?: GooglePayButtonType;
paypal?: PayPalButtonType;
};
export interface StripeExpressCheckoutElementOptions {
/**
* Manually sets the height of the buttons shown.
*/
buttonHeight?: number;
/**
* Controls the color of each button.
*/
buttonTheme?: ButtonThemeOption;
/**
* Specifies the type of each button.
*/
buttonType?: ButtonTypeOption;
/**
* Specifies how buttons should be laid out in relation to each other.
*/
layout?: LayoutOption;
/**
* Override the order in which payment methods are displayed in the Express Checkout Element.
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
/**
* Control payment method display in the Express Checkout Element.
*/
paymentMethods?: ExpressCheckoutPaymentMethodsOption;
/**
* @deprecated
* Use `paymentMethods` instead.
*
* Control wallets display in the Express Checkout Element.
*/
wallets?: ExpressCheckoutWalletsOption;
}
/*
* Updatable options for an `Elements` instance
*/
export interface StripeExpressCheckoutElementUpdateOptions {
/**
* Manually sets the height of the buttons shown.
*/
buttonHeight?: number;
/**
* Specifies how buttons should be laid out in relation to each other.
*/
layout?: LayoutOption;
/**
* Override the order in which payment methods are displayed in the Pay Button Element.
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
}
export type AvailablePaymentMethods = {
amazonPay: boolean;
applePay: boolean;
googlePay: boolean;
link: boolean;
paypal: boolean;
};
export interface StripeExpressCheckoutElementReadyEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'expressCheckout';
/**
* The list of payment methods that could possibly show in the element, or undefined if no payment methods can show.
*/
availablePaymentMethods: undefined | AvailablePaymentMethods;
}
export type ClickResolveDetails = {
/**
* An array of two-letter ISO country codes representing which countries
* are eligible shipping locations.
*/
allowedShippingCountries?: string[];
billingAddressRequired?: boolean;
/**
* Provide information about your business that will be displayed in the payment interface.
* This information will be retrieved from your Stripe account if not provided.
*/
business?: {name: string};
emailRequired?: boolean;
lineItems?: Array<LineItem>;
phoneNumberRequired?: boolean;
shippingAddressRequired?: boolean;
shippingRates?: Array<ShippingRate>;
applePay?: ApplePayOption;
};
export interface StripeExpressCheckoutElementClickEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'expressCheckout';
/**
* The payment method associated with the button that was clicked.
*/
expressPaymentType: ExpressPaymentType;
/**
* Callback to configure the details shown on a payment interface, including which fields to collect.
* This must be called within 1 second of the 'click' event being emitted.
*/
resolve: (resolveDetails?: ClickResolveDetails) => void;
}
export interface StripeExpressCheckoutElementConfirmEvent {
/**
* Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface.
*/
paymentFailed: (payload?: {
reason?: 'fail' | 'invalid_shipping_address';
}) => void;
billingDetails?: BillingDetails;
shippingAddress?: ShippingAddress;
shippingRate?: ShippingRate;
expressPaymentType: ExpressPaymentType;
}
export type ChangeResolveDetails = {
lineItems?: Array<LineItem>;
shippingRates?: Array<ShippingRate>;
applePay?: ApplePayUpdateOption;
};
export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
name: string;
address: ExpressCheckoutPartialAddress;
resolve: (resolveDetails?: ChangeResolveDetails) => void;
reject: () => void;
}
export interface StripeExpressCheckoutElementShippingRateChangeEvent {
shippingRate: ShippingRate;
resolve: (resolveDetails?: ChangeResolveDetails) => void;
reject: () => void;
}

View File

@@ -0,0 +1,134 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeFpxBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
once(
eventType: 'change',
handler: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
off(
eventType: 'change',
handler?: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Updates the options the `FpxBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `FpxBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeFpxBankElementOptions>): void;
};
export interface StripeFpxBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference) (e.g., `affin_bank`).
*/
value?: string;
/**
* The type of the FPX accountholder.
*/
accountHolderType: 'individual' | 'company';
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeFpxBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'fpxBank';
/**
* The selected bank.
* Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference).
*/
value: string;
}

View File

@@ -0,0 +1,134 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeFpxBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
once(
eventType: 'change',
handler: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
off(
eventType: 'change',
handler?: (event: StripeFpxBankElementChangeEvent) => any
): StripeFpxBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'fpxBank'}) => any
): StripeFpxBankElement;
/**
* Updates the options the `FpxBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `FpxBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeFpxBankElementOptions>): void;
};
export interface StripeFpxBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference) (e.g., `affin_bank`).
*/
value?: string;
/**
* The type of the FPX accountholder.
*/
accountHolderType: 'individual' | 'company';
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeFpxBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'fpxBank';
/**
* The selected bank.
* Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference).
*/
value: string;
}

View File

@@ -0,0 +1,135 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeIbanElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
once(
eventType: 'change',
handler: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
off(
eventType: 'change',
handler?: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Updates the options the `IbanElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IbanElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIbanElementOptions>): void;
};
export interface StripeIbanElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
supportedCountries?: string[];
placeholderCountry?: string;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeIbanElementChangeEvent extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'iban';
country: string;
bankName: string;
}

View File

@@ -0,0 +1,135 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeIbanElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
once(
eventType: 'change',
handler: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
off(
eventType: 'change',
handler?: (event: StripeIbanElementChangeEvent) => any
): StripeIbanElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'iban'}) => any
): StripeIbanElement;
/**
* Updates the options the `IbanElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IbanElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIbanElementOptions>): void;
};
export interface StripeIbanElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
supportedCountries?: string[];
placeholderCountry?: string;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeIbanElementChangeEvent extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'iban';
country: string;
bankName: string;
}

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeIdealBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
once(
eventType: 'change',
handler: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
off(
eventType: 'change',
handler?: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Updates the options the `IdealBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IdealBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIdealBankElementOptions>): void;
};
export interface StripeIdealBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank) (e.g., `abn_amro`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeIdealBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'idealBank';
/**
* The selected bank.
* Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank).
*/
value: string;
}

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeIdealBankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
once(
eventType: 'change',
handler: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
off(
eventType: 'change',
handler?: (event: StripeIdealBankElementChangeEvent) => any
): StripeIdealBankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'idealBank'}) => any
): StripeIdealBankElement;
/**
* Updates the options the `IdealBankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IdealBankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIdealBankElementOptions>): void;
};
export interface StripeIdealBankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank) (e.g., `abn_amro`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeIdealBankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'idealBank';
/**
* The selected bank.
* Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank).
*/
value: string;
}

View File

@@ -0,0 +1,22 @@
export * from './address';
export * from './payment-method-messaging';
export * from './affirm-message';
export * from './afterpay-clearpay-message';
export * from './au-bank-account';
export * from './base';
export * from './card-cvc';
export * from './card-expiry';
export * from './card-number';
export * from './card';
export * from './currency-selector';
export * from './eps-bank';
export * from './express-checkout';
export * from './fpx-bank';
export * from './iban';
export * from './ideal-bank';
export * from './link-authentication';
export * from './p24-bank';
export * from './payment-request-button';
export * from './payment';
export * from './shipping-address';
export * from './issuing';

View File

@@ -0,0 +1,22 @@
export * from './address';
export * from './payment-method-messaging';
export * from './affirm-message';
export * from './afterpay-clearpay-message';
export * from './au-bank-account';
export * from './base';
export * from './card-cvc';
export * from './card-expiry';
export * from './card-number';
export * from './card';
export * from './currency-selector';
export * from './eps-bank';
export * from './express-checkout';
export * from './fpx-bank';
export * from './iban';
export * from './ideal-bank';
export * from './link-authentication';
export * from './p24-bank';
export * from './payment-request-button';
export * from './payment';
export * from './shipping-address';
export * from './issuing';

View File

@@ -0,0 +1,5 @@
export * from './issuing-card-number-display';
export * from './issuing-card-cvc-display';
export * from './issuing-card-expiry-display';
export * from './issuing-card-pin-display';
export * from './issuing-card-copy-button';

View File

@@ -0,0 +1,5 @@
export * from './issuing-card-number-display';
export * from './issuing-card-cvc-display';
export * from './issuing-card-expiry-display';
export * from './issuing-card-pin-display';
export * from './issuing-card-copy-button';

View File

@@ -0,0 +1,37 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardCopyButtonElement = StripeElementBase & {
/**
* Triggered when the element is clicked.
*/
on(
eventType: 'click',
handler: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
once(
eventType: 'click',
handler: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
off(
eventType: 'click',
handler?: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
/**
* Updates the options the `IssuingCardCopyButtonElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardCopyButtonElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardCopyButtonElementOptions>): void;
};
export interface StripeIssuingCardCopyButtonElementOptions {
/**
* The issued card data element to copy to the user's clipboard
*/
toCopy: 'expiry' | 'cvc' | 'number' | 'pin';
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,37 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardCopyButtonElement = StripeElementBase & {
/**
* Triggered when the element is clicked.
*/
on(
eventType: 'click',
handler: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
once(
eventType: 'click',
handler: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
off(
eventType: 'click',
handler?: (event: {elementType: 'issuingCardCopyButton'}) => any
): StripeIssuingCardCopyButtonElement;
/**
* Updates the options the `IssuingCardCopyButtonElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardCopyButtonElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardCopyButtonElementOptions>): void;
};
export interface StripeIssuingCardCopyButtonElementOptions {
/**
* The issued card data element to copy to the user's clipboard
*/
toCopy: 'expiry' | 'cvc' | 'number' | 'pin';
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardCvcDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardCvcDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardCvcDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardCvcDisplayElementOptions>): void;
};
export interface StripeIssuingCardCvcDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardCvcDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardCvcDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardCvcDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardCvcDisplayElementOptions>): void;
};
export interface StripeIssuingCardCvcDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardExpiryDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardExpiryDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardExpiryDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardExpiryDisplayElementOptions>): void;
};
export interface StripeIssuingCardExpiryDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardExpiryDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardExpiryDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardExpiryDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardExpiryDisplayElementOptions>): void;
};
export interface StripeIssuingCardExpiryDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,40 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardNumberDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardNumberDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardNumberDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardNumberDisplayElementOptions>): void;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'issuingCardNumberDisplay'}) => any
): StripeIssuingCardNumberDisplayElement;
};
export interface StripeIssuingCardNumberDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,40 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardNumberDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardNumberDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardNumberDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardNumberDisplayElementOptions>): void;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'issuingCardNumberDisplay'}) => any
): StripeIssuingCardNumberDisplayElement;
};
export interface StripeIssuingCardNumberDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardPinDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardPinDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardPinDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardPinDisplayElementOptions>): void;
};
export interface StripeIssuingCardPinDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,32 @@
import {StripeElementBase, StripeElementStyle} from '../base';
export type StripeIssuingCardPinDisplayElement = StripeElementBase & {
/**
* Updates the options the `IssuingCardPinDisplayElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `IssuingCardPinDisplayElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeIssuingCardPinDisplayElementOptions>): void;
};
export interface StripeIssuingCardPinDisplayElementOptions {
/**
* The token (e.g. `ic_abc123`) of the issued card to display in this Element
*/
issuingCard: string;
/**
* The secret component of the ephemeral key with which to authenticate this sensitive
* card details request
*/
ephemeralKeySecret?: string;
/**
* The nonce used to mint the ephemeral key provided in `ephemeralKeySecret`
*/
nonce?: string;
style?: StripeElementStyle;
}

View File

@@ -0,0 +1,158 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeLinkAuthenticationElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'change',
handler: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'change',
handler?: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
};
export interface StripeLinkAuthenticationElementOptions {
/**
* Default value for LinkAuthenticationElement fields
*/
defaultValues?: {
email: string;
};
}
export interface StripeLinkAuthenticationElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'linkAuthentication';
/**
* Whether or not the LinkAuthentication Element is currently empty.
*/
empty: boolean;
/**
* Whether or not the LinkAuthentication Element is complete.
*/
complete: boolean;
/**
* An object containing the current email.
*/
value: {
email: string;
};
}

View File

@@ -0,0 +1,158 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
export type StripeLinkAuthenticationElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'change',
handler: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'change',
handler?: (event: StripeLinkAuthenticationElementChangeEvent) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'loaderror',
handler: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'loaderror',
handler?: (event: {
elementType: 'linkAuthentication';
error: StripeError;
}) => any
): StripeLinkAuthenticationElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'linkAuthentication'}) => any
): StripeLinkAuthenticationElement;
};
export interface StripeLinkAuthenticationElementOptions {
/**
* Default value for LinkAuthenticationElement fields
*/
defaultValues?: {
email: string;
};
}
export interface StripeLinkAuthenticationElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'linkAuthentication';
/**
* Whether or not the LinkAuthentication Element is currently empty.
*/
empty: boolean;
/**
* Whether or not the LinkAuthentication Element is complete.
*/
complete: boolean;
/**
* An object containing the current email.
*/
value: {
email: string;
};
}

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeP24BankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
once(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
off(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Updates the options the `P24BankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `P24BankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeP24BankElementOptions>): void;
};
export interface StripeP24BankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeP24BankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'p24Bank';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `ing`).
*/
value?: string;
}

View File

@@ -0,0 +1,140 @@
import {
StripeElementBase,
StripeElementStyle,
StripeElementClasses,
StripeElementChangeEvent,
} from './base';
export type StripeP24BankElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
once(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
off(
eventType: 'change',
handler: (event: StripeP24BankElementChangeEvent) => any
): StripeP24BankElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'ready',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'focus',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'blur',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
off(
eventType: 'escape',
handler: (event: {elementType: 'p24Bank'}) => any
): StripeP24BankElement;
/**
* Updates the options the `P24BankElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `P24BankElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(options: Partial<StripeP24BankElementOptions>): void;
};
export interface StripeP24BankElementOptions {
classes?: StripeElementClasses;
style?: StripeElementStyle;
/**
* Appearance of the icon in the Element.
*/
iconStyle?: 'default' | 'solid';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `bank_austria`).
*/
value?: string;
/**
* Hides the icon in the Element.
* Default is `false`.
*/
hideIcon?: boolean;
/**
* Applies a disabled state to the Element such that user input is not accepted.
* Default is false.
*/
disabled?: boolean;
}
export interface StripeP24BankElementChangeEvent
extends StripeElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'p24Bank';
/**
* A pre-filled value for the Element.
* Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `ing`).
*/
value?: string;
}

View File

@@ -0,0 +1,101 @@
export type StripePaymentMethodMessagingElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `PaymentMethodMessagingElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripePaymentMethodMessagingElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'paymentMethodMessaging'}) => any
): StripePaymentMethodMessagingElement;
};
export interface StripePaymentMethodMessagingElementOptions {
/**
* The total amount in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency:
| 'USD'
| 'GBP'
| 'EUR'
| 'DKK'
| 'NOK'
| 'SEK'
| 'AUD'
| 'CAD'
| 'NZD';
/**
* Payment methods to show messaging for.
*/
paymentMethodTypes?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* Override the order in which payment methods are displayed in the Payment Method Messaging Element.
* By default, the Payment Method Messaging Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* @deprecated Use `paymentMethodTypes` instead.
*/
paymentMethods?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* The country the end-buyer is in.
*/
countryCode:
| 'US'
| 'CA'
| 'AU'
| 'NZ'
| 'GB'
| 'IE'
| 'FR'
| 'ES'
| 'DE'
| 'AT'
| 'BE'
| 'DK'
| 'FI'
| 'IT'
| 'NL'
| 'NO'
| 'SE';
/**
* The logo color to display in the message. Defaults to black
*/
logoColor?: 'black' | 'white' | 'color';
metaData?: {
messagingClientReferenceId: string | null;
};
}

View File

@@ -0,0 +1,101 @@
export type StripePaymentMethodMessagingElement = {
/**
* The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
* `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element.
*/
mount(domElement: string | HTMLElement): void;
/**
* Removes the element from the DOM and destroys it.
* A destroyed element can not be re-activated or re-mounted to the DOM.
*/
destroy(): void;
/**
* Unmounts the element from the DOM.
* Call `element.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Updates the options the `PaymentMethodMessagingElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripePaymentMethodMessagingElementOptions>): void;
/**
* Triggered when the element is fully loaded and ready to perform method calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'paymentMethodMessaging'}) => any
): StripePaymentMethodMessagingElement;
};
export interface StripePaymentMethodMessagingElementOptions {
/**
* The total amount in the smallest currency unit.
*/
amount: number;
/**
* The currency to display.
*/
currency:
| 'USD'
| 'GBP'
| 'EUR'
| 'DKK'
| 'NOK'
| 'SEK'
| 'AUD'
| 'CAD'
| 'NZD';
/**
* Payment methods to show messaging for.
*/
paymentMethodTypes?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* Override the order in which payment methods are displayed in the Payment Method Messaging Element.
* By default, the Payment Method Messaging Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* @deprecated Use `paymentMethodTypes` instead.
*/
paymentMethods?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
/**
* The country the end-buyer is in.
*/
countryCode:
| 'US'
| 'CA'
| 'AU'
| 'NZ'
| 'GB'
| 'IE'
| 'FR'
| 'ES'
| 'DE'
| 'AT'
| 'BE'
| 'DK'
| 'FI'
| 'IT'
| 'NL'
| 'NO'
| 'SE';
/**
* The logo color to display in the message. Defaults to black
*/
logoColor?: 'black' | 'white' | 'color';
metaData?: {
messagingClientReferenceId: string | null;
};
}

View File

@@ -0,0 +1,151 @@
import {StripeElementBase, StripeElementClasses} from './base';
import {PaymentRequest} from '../payment-request';
import {Omit} from '../../utils';
export type StripePaymentRequestButtonElement = StripeElementBase & {
/**
* Triggered when the payment request button is clicked.
*/
on(
eventType: 'click',
handler: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'click',
handler: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'click',
handler?: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Updates the options the `PaymentRequestButtonElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `PaymentRequestButtonElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(
options: Partial<
Omit<StripePaymentRequestButtonElementOptions, 'paymentRequest'>
>
): void;
};
export interface StripePaymentRequestButtonElementOptions {
classes?: StripeElementClasses;
/**
* An object used to customize the appearance of the Payment Request Button.
* The object must have a single `paymentRequestButton` field, containing any of the following sub-fields
*/
style?: {
paymentRequestButton: {
/**
* Preferred button type to display. Available types, by wallet:
*
* Browser card: default, book, buy, or donate.
*
* Google Pay: default, buy, or donate.
*
* Apple Pay: default, book, buy, donate, check-out, subscribe, reload, add-money, top-up, order, rent, support, contribute, tip
*
* When a wallet does not support the provided value, default is used as a fallback.
*/
type?:
| 'default'
| 'book'
| 'buy'
| 'donate'
| 'check-out'
| 'subscribe'
| 'reload'
| 'add-money'
| 'top-up'
| 'order'
| 'rent'
| 'support'
| 'contribute'
| 'tip';
/**
* One of dark, light, or light-outline. The default is dark.
*/
theme?: 'dark' | 'light' | 'light-outline';
/**
* The height of the Payment Request Button. Accepts px unit values.
*/
height?: string;
/**
* The gap between buttons when multile buttons are shown. Accepts px unit values.
*/
buttonSpacing?: string;
};
};
/**
* A `PaymentRequest` object used to configure the element.
*/
paymentRequest: PaymentRequest;
/**
* Disable showing multiple buttons.
* Default is `false`.
*/
disableMultipleButtons?: boolean;
}
export interface StripePaymentRequestButtonElementClickEvent {
preventDefault: () => void;
}

View File

@@ -0,0 +1,151 @@
import {StripeElementBase, StripeElementClasses} from './base';
import {PaymentRequest} from '../payment-request';
import {Omit} from '../../utils';
export type StripePaymentRequestButtonElement = StripeElementBase & {
/**
* Triggered when the payment request button is clicked.
*/
on(
eventType: 'click',
handler: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'click',
handler: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'click',
handler?: (event: StripePaymentRequestButtonElementClickEvent) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'paymentRequestButton'}) => any
): StripePaymentRequestButtonElement;
/**
* Updates the options the `PaymentRequestButtonElement` was initialized with.
* Updates are merged into the existing configuration.
*
* The styles of an `PaymentRequestButtonElement` can be dynamically changed using `element.update`.
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
*/
update(
options: Partial<
Omit<StripePaymentRequestButtonElementOptions, 'paymentRequest'>
>
): void;
};
export interface StripePaymentRequestButtonElementOptions {
classes?: StripeElementClasses;
/**
* An object used to customize the appearance of the Payment Request Button.
* The object must have a single `paymentRequestButton` field, containing any of the following sub-fields
*/
style?: {
paymentRequestButton: {
/**
* Preferred button type to display. Available types, by wallet:
*
* Browser card: default, book, buy, or donate.
*
* Google Pay: default, buy, or donate.
*
* Apple Pay: default, book, buy, donate, check-out, subscribe, reload, add-money, top-up, order, rent, support, contribute, tip
*
* When a wallet does not support the provided value, default is used as a fallback.
*/
type?:
| 'default'
| 'book'
| 'buy'
| 'donate'
| 'check-out'
| 'subscribe'
| 'reload'
| 'add-money'
| 'top-up'
| 'order'
| 'rent'
| 'support'
| 'contribute'
| 'tip';
/**
* One of dark, light, or light-outline. The default is dark.
*/
theme?: 'dark' | 'light' | 'light-outline';
/**
* The height of the Payment Request Button. Accepts px unit values.
*/
height?: string;
/**
* The gap between buttons when multile buttons are shown. Accepts px unit values.
*/
buttonSpacing?: string;
};
};
/**
* A `PaymentRequest` object used to configure the element.
*/
paymentRequest: PaymentRequest;
/**
* Disable showing multiple buttons.
* Default is `false`.
*/
disableMultipleButtons?: boolean;
}
export interface StripePaymentRequestButtonElementClickEvent {
preventDefault: () => void;
}

View File

@@ -0,0 +1,435 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
import {ApplePayOption} from './apple-pay';
import {CardNetworkBrand} from '../elements-group';
export type StripePaymentElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
once(
eventType: 'change',
handler: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
off(
eventType: 'change',
handler?: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* The change event is triggered when the `Element`'s value changes.
* Represents the details of a selected Card payment method.
*/
on(
eventType: 'carddetailschange',
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
): StripePaymentElement;
/**
* Triggered when a Saved Payment Method is updated.
*/
on(
eventType: 'savedpaymentmethodupdate',
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
): StripePaymentElement;
/**
* Triggered when a Saved Payment Method is removed.
*/
on(
eventType: 'savedpaymentmethodremove',
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
): StripePaymentElement;
/**
* Updates the options the `PaymentElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripePaymentElementOptions>): StripePaymentElement;
/**
* Collapses the Payment Element into a row of payment method tabs.
*/
collapse(): StripePaymentElement;
};
export interface DefaultValuesOption {
billingDetails?: {
name?: string;
email?: string;
phone?: string;
address?: {
country?: string;
postal_code?: string;
state?: string;
city?: string;
line1?: string;
line2?: string;
};
};
card?: {
network?: CardNetworkBrand[];
};
}
export type FieldOption = 'auto' | 'never';
export interface FieldsOption {
billingDetails?:
| FieldOption
| {
name?: FieldOption;
email?: FieldOption;
phone?: FieldOption;
address?:
| FieldOption
| 'if_required'
| {
country?: FieldOption;
postalCode?: FieldOption;
state?: FieldOption;
city?: FieldOption;
line1?: FieldOption;
line2?: FieldOption;
};
};
}
export type TermOption = 'auto' | 'always' | 'never';
export interface TermsOption {
applePay?: TermOption;
auBecsDebit?: TermOption;
bancontact?: TermOption;
card?: TermOption;
cashapp?: TermOption;
googlePay?: TermOption;
ideal?: TermOption;
paypal?: TermOption;
sepaDebit?: TermOption;
sofort?: TermOption;
usBankAccount?: TermOption;
}
export type PaymentWalletOption = 'auto' | 'never';
export interface PaymentWalletsOption {
applePay?: PaymentWalletOption;
googlePay?: PaymentWalletOption;
}
export type Layout = 'tabs' | 'accordion' | 'auto';
export interface LayoutObject {
type: Layout;
defaultCollapsed?: boolean;
radios?: boolean;
spacedAccordionItems?: boolean;
visibleAccordionItemsCount?: number;
}
export interface StripePaymentElementOptions {
/**
* Provide initial customer information that will be displayed in the Payment Element.
*/
defaultValues?: DefaultValuesOption;
/**
* Override the business name displayed in the Payment Element.
* By default the PaymentElement will use your Stripe account or business name.
*/
business?: {name: string};
/**
* Override the order in which payment methods are displayed in the Payment Element.
* By default, the Payment Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
/**
* Control which fields are displayed in the Payment Element.
*/
fields?: FieldsOption;
/**
* Apply a read-only state to the Payment Element so that payment details cant be changed.
* Default is false.
*/
readOnly?: boolean;
/**
* Control terms display in the Payment Element.
*/
terms?: TermsOption;
/**
* Control wallets display in the Payment Element.
*/
wallets?: PaymentWalletsOption;
/**
* Specify a layout to use when rendering a Payment Element.
*/
layout?: Layout | LayoutObject;
/**
* Specify the options to be used when the Apple Pay payment interface opens.
*/
applePay?: ApplePayOption;
}
export interface StripePaymentElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` if the all inputs in the Payment Element are empty.
*/
empty: boolean;
/**
* `true` if the every input in the Payment Element is well-formed and potentially complete.
*/
complete: boolean;
/**
* Whether or not the Payment Element is currently collapsed.
*/
collapsed: boolean;
/**
* An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
* If a payment method is selected, it will be included in the object.
*/
value: {
type: string;
payment_method?: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
};
}
type CardBrand =
| 'amex'
| 'diners'
| 'discover'
| 'eftpos_au'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'visa'
| 'unknown';
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
export interface StripePaymentElementCardDetailsChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the card details are loading.
*/
loading: boolean;
/**
* The card details for the selected payment method.
* Undefined while loading and for non card payment methods.
*/
details?: {
brands: CardBrand[] | null;
funding: CardFunding | null;
};
}
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the saved payment method is successfully updated.
*/
success: boolean;
/**
* Error message if the saved payment method update fails.
*/
error?: string;
/**
* The updated saved payment method.
*/
payment_method: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
}
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the saved payment method is successfully removed.
*/
success: boolean;
/**
* Error message if the saved payment method removal fails.
*/
error?: string;
/**
* The removed saved payment method.
*/
payment_method: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
}

View File

@@ -0,0 +1,435 @@
import {StripeElementBase} from './base';
import {StripeError} from '../stripe';
import {ApplePayOption} from './apple-pay';
import {CardNetworkBrand} from '../elements-group';
export type StripePaymentElement = StripeElementBase & {
/**
* The change event is triggered when the `Element`'s value changes.
*/
on(
eventType: 'change',
handler: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
once(
eventType: 'change',
handler: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
off(
eventType: 'change',
handler?: (event: StripePaymentElementChangeEvent) => any
): StripePaymentElement;
/**
* Triggered when the element is fully rendered and can accept `element.focus` calls.
*/
on(
eventType: 'ready',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'ready',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'ready',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element gains focus.
*/
on(
eventType: 'focus',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'focus',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'focus',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element loses focus.
*/
on(
eventType: 'blur',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'blur',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'blur',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the escape key is pressed within the element.
*/
on(
eventType: 'escape',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'escape',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'escape',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* Triggered when the element fails to load.
*/
on(
eventType: 'loaderror',
handler: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
once(
eventType: 'loaderror',
handler: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
off(
eventType: 'loaderror',
handler?: (event: {elementType: 'payment'; error: StripeError}) => any
): StripePaymentElement;
/**
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
*/
on(
eventType: 'loaderstart',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
once(
eventType: 'loaderstart',
handler: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
off(
eventType: 'loaderstart',
handler?: (event: {elementType: 'payment'}) => any
): StripePaymentElement;
/**
* The change event is triggered when the `Element`'s value changes.
* Represents the details of a selected Card payment method.
*/
on(
eventType: 'carddetailschange',
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
): StripePaymentElement;
/**
* Triggered when a Saved Payment Method is updated.
*/
on(
eventType: 'savedpaymentmethodupdate',
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
): StripePaymentElement;
/**
* Triggered when a Saved Payment Method is removed.
*/
on(
eventType: 'savedpaymentmethodremove',
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
): StripePaymentElement;
/**
* Updates the options the `PaymentElement` was initialized with.
* Updates are merged into the existing configuration.
*/
update(options: Partial<StripePaymentElementOptions>): StripePaymentElement;
/**
* Collapses the Payment Element into a row of payment method tabs.
*/
collapse(): StripePaymentElement;
};
export interface DefaultValuesOption {
billingDetails?: {
name?: string;
email?: string;
phone?: string;
address?: {
country?: string;
postal_code?: string;
state?: string;
city?: string;
line1?: string;
line2?: string;
};
};
card?: {
network?: CardNetworkBrand[];
};
}
export type FieldOption = 'auto' | 'never';
export interface FieldsOption {
billingDetails?:
| FieldOption
| {
name?: FieldOption;
email?: FieldOption;
phone?: FieldOption;
address?:
| FieldOption
| 'if_required'
| {
country?: FieldOption;
postalCode?: FieldOption;
state?: FieldOption;
city?: FieldOption;
line1?: FieldOption;
line2?: FieldOption;
};
};
}
export type TermOption = 'auto' | 'always' | 'never';
export interface TermsOption {
applePay?: TermOption;
auBecsDebit?: TermOption;
bancontact?: TermOption;
card?: TermOption;
cashapp?: TermOption;
googlePay?: TermOption;
ideal?: TermOption;
paypal?: TermOption;
sepaDebit?: TermOption;
sofort?: TermOption;
usBankAccount?: TermOption;
}
export type PaymentWalletOption = 'auto' | 'never';
export interface PaymentWalletsOption {
applePay?: PaymentWalletOption;
googlePay?: PaymentWalletOption;
}
export type Layout = 'tabs' | 'accordion' | 'auto';
export interface LayoutObject {
type: Layout;
defaultCollapsed?: boolean;
radios?: boolean;
spacedAccordionItems?: boolean;
visibleAccordionItemsCount?: number;
}
export interface StripePaymentElementOptions {
/**
* Provide initial customer information that will be displayed in the Payment Element.
*/
defaultValues?: DefaultValuesOption;
/**
* Override the business name displayed in the Payment Element.
* By default the PaymentElement will use your Stripe account or business name.
*/
business?: {name: string};
/**
* Override the order in which payment methods are displayed in the Payment Element.
* By default, the Payment Element will use a dynamic ordering that optimizes payment method display for each user.
*/
paymentMethodOrder?: string[];
/**
* Control which fields are displayed in the Payment Element.
*/
fields?: FieldsOption;
/**
* Apply a read-only state to the Payment Element so that payment details cant be changed.
* Default is false.
*/
readOnly?: boolean;
/**
* Control terms display in the Payment Element.
*/
terms?: TermsOption;
/**
* Control wallets display in the Payment Element.
*/
wallets?: PaymentWalletsOption;
/**
* Specify a layout to use when rendering a Payment Element.
*/
layout?: Layout | LayoutObject;
/**
* Specify the options to be used when the Apple Pay payment interface opens.
*/
applePay?: ApplePayOption;
}
export interface StripePaymentElementChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` if the all inputs in the Payment Element are empty.
*/
empty: boolean;
/**
* `true` if the every input in the Payment Element is well-formed and potentially complete.
*/
complete: boolean;
/**
* Whether or not the Payment Element is currently collapsed.
*/
collapsed: boolean;
/**
* An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
* If a payment method is selected, it will be included in the object.
*/
value: {
type: string;
payment_method?: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
};
}
type CardBrand =
| 'amex'
| 'diners'
| 'discover'
| 'eftpos_au'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'visa'
| 'unknown';
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
export interface StripePaymentElementCardDetailsChangeEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the card details are loading.
*/
loading: boolean;
/**
* The card details for the selected payment method.
* Undefined while loading and for non card payment methods.
*/
details?: {
brands: CardBrand[] | null;
funding: CardFunding | null;
};
}
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the saved payment method is successfully updated.
*/
success: boolean;
/**
* Error message if the saved payment method update fails.
*/
error?: string;
/**
* The updated saved payment method.
*/
payment_method: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
}
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
/**
* The type of element that emitted this event.
*/
elementType: 'payment';
/**
* `true` when the saved payment method is successfully removed.
*/
success: boolean;
/**
* Error message if the saved payment method removal fails.
*/
error?: string;
/**
* The removed saved payment method.
*/
payment_method: {
id: string;
type: string;
billing_details: {
address: {
city: null | string;
country: null | string;
line1: null | string;
line2: null | string;
postal_code: null | string;
state: null | string;
};
name: null | string;
email: null | string;
phone: null | string;
};
};
}

Some files were not shown because too many files have changed in this diff Show More