Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Alipay on PaymentMethod and PaymentIntent #975

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions types/2020-03-02/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ declare module 'stripe' {
default_currency?: string;

/**
* The email address of the account holder. For Custom accounts, this is only to make the account easier to identify to you: Stripe will never directly email your users.
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
*/
email?: string;

Expand Down Expand Up @@ -784,7 +784,7 @@ declare module 'stripe' {
tos_acceptance?: AccountCreateParams.TosAcceptance;

/**
* The type of Stripe account to create. Currently must be `custom`, as only [Custom accounts](https://stripe.com/docs/connect/custom-accounts) may be created via the API.
* The type of Stripe account to create. May be one of `custom`, `express` or `standard`.
*/
type?: AccountCreateParams.Type;
}
Expand Down Expand Up @@ -1567,7 +1567,7 @@ declare module 'stripe' {
default_currency?: string;

/**
* Email address of the account representative. For Standard accounts, this is used to ask them to claim their Stripe account. For Custom accounts, this only makes the account easier to identify to platforms; Stripe does not email the account representative.
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
*/
email?: string;

Expand Down
6 changes: 3 additions & 3 deletions types/2020-03-02/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'stripe' {
/**
* Enables user redeemable promotion codes.
*/
allow_promotion_codes?: boolean | null;
allow_promotion_codes: boolean | null;

/**
* Total of all items before discounts or taxes are applied.
Expand Down Expand Up @@ -796,12 +796,12 @@ declare module 'stripe' {
recurring?: PriceData.Recurring;

/**
* A positive integer in %s representing how much to charge.
* A positive integer in %s representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
*/
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ declare module 'stripe' {

interface TaxIdDatum {
/**
* Type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `nz_gst`, `au_abn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, or `my_frp`
* Type of the tax ID, one of `ae_trn`, `au_abn`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_qst`, `ch_vat`, `cl_tin`, `es_cif`, `eu_vat`, `hk_br`, `id_npwp`, `in_gst`, `jp_cn`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ru_inn`, `sa_vat`, `sg_gst`, `sg_uen`, `th_vat`, `tw_vat`, `us_ein`, or `za_vat`
*/
type: TaxIdDatum.Type;

Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/Discounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ declare module 'stripe' {
/**
* The promotion code applied to create this discount.
*/
promotion_code?: string | Stripe.PromotionCode | null;
promotion_code: string | Stripe.PromotionCode | null;

/**
* Date that the coupon was applied.
Expand Down Expand Up @@ -104,7 +104,7 @@ declare module 'stripe' {
/**
* The promotion code applied to create this discount.
*/
promotion_code?: string | Stripe.PromotionCode | null;
promotion_code: string | Stripe.PromotionCode | null;

/**
* Date that the coupon was applied.
Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/InvoiceItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down Expand Up @@ -405,7 +405,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down Expand Up @@ -486,7 +486,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down Expand Up @@ -1219,7 +1219,7 @@ declare module 'stripe' {
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
* Same as `unit_amount`, but accepts a decimal value with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set, but at least one is required.
*/
unit_amount_decimal?: string;
}
Expand Down
73 changes: 73 additions & 0 deletions types/2020-03-02/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ declare module 'stripe' {
}

interface NextAction {
alipay_handle_redirect?: NextAction.AlipayHandleRedirect;

redirect_to_url?: NextAction.RedirectToUrl;

/**
Expand All @@ -331,6 +333,28 @@ declare module 'stripe' {
}

namespace NextAction {
interface AlipayHandleRedirect {
/**
* The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App.
*/
native_data: string | null;

/**
* The native URL you must redirect your customer to in order to authenticate the payment in an iOS App.
*/
native_url: string | null;

/**
* 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;
}

interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
Expand All @@ -347,12 +371,16 @@ declare module 'stripe' {
}

interface PaymentMethodOptions {
alipay?: PaymentMethodOptions.Alipay;

bancontact?: PaymentMethodOptions.Bancontact;

card?: PaymentMethodOptions.Card;
}

namespace PaymentMethodOptions {
interface Alipay {}

interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
Expand Down Expand Up @@ -728,6 +756,11 @@ declare module 'stripe' {
type OffSession = 'one_off' | 'recurring';

interface PaymentMethodData {
/**
* If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
*/
alipay?: PaymentMethodData.Alipay;

/**
* If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
*/
Expand Down Expand Up @@ -795,6 +828,8 @@ declare module 'stripe' {
}

namespace PaymentMethodData {
interface Alipay {}

interface AuBecsDebit {
/**
* The account number for the bank account.
Expand Down Expand Up @@ -954,6 +989,7 @@ declare module 'stripe' {
}

type Type =
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
Expand All @@ -967,6 +1003,11 @@ declare module 'stripe' {
}

interface PaymentMethodOptions {
/**
* If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
*/
alipay?: PaymentMethodOptions.Alipay | null;

/**
* If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
*/
Expand All @@ -979,6 +1020,8 @@ declare module 'stripe' {
}

namespace PaymentMethodOptions {
interface Alipay {}

interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
Expand Down Expand Up @@ -1251,6 +1294,11 @@ declare module 'stripe' {

namespace PaymentIntentUpdateParams {
interface PaymentMethodData {
/**
* If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
*/
alipay?: PaymentMethodData.Alipay;

/**
* If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
*/
Expand Down Expand Up @@ -1318,6 +1366,8 @@ declare module 'stripe' {
}

namespace PaymentMethodData {
interface Alipay {}

interface AuBecsDebit {
/**
* The account number for the bank account.
Expand Down Expand Up @@ -1477,6 +1527,7 @@ declare module 'stripe' {
}

type Type =
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
Expand All @@ -1490,6 +1541,11 @@ declare module 'stripe' {
}

interface PaymentMethodOptions {
/**
* If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
*/
alipay?: PaymentMethodOptions.Alipay | null;

/**
* If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
*/
Expand All @@ -1502,6 +1558,8 @@ declare module 'stripe' {
}

namespace PaymentMethodOptions {
interface Alipay {}

interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
Expand Down Expand Up @@ -1888,6 +1946,11 @@ declare module 'stripe' {
type OffSession = 'one_off' | 'recurring';

interface PaymentMethodData {
/**
* If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
*/
alipay?: PaymentMethodData.Alipay;

/**
* If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
*/
Expand Down Expand Up @@ -1955,6 +2018,8 @@ declare module 'stripe' {
}

namespace PaymentMethodData {
interface Alipay {}

interface AuBecsDebit {
/**
* The account number for the bank account.
Expand Down Expand Up @@ -2114,6 +2179,7 @@ declare module 'stripe' {
}

type Type =
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
Expand All @@ -2127,6 +2193,11 @@ declare module 'stripe' {
}

interface PaymentMethodOptions {
/**
* If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options.
*/
alipay?: PaymentMethodOptions.Alipay | null;

/**
* If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
*/
Expand All @@ -2139,6 +2210,8 @@ declare module 'stripe' {
}

namespace PaymentMethodOptions {
interface Alipay {}

interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
Expand Down
13 changes: 13 additions & 0 deletions types/2020-03-02/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ declare module 'stripe' {
*/
object: 'payment_method';

alipay?: PaymentMethod.Alipay;

au_becs_debit?: PaymentMethod.AuBecsDebit;

bacs_debit?: PaymentMethod.BacsDebit;
Expand Down Expand Up @@ -68,6 +70,8 @@ declare module 'stripe' {
}

namespace PaymentMethod {
interface Alipay {}

interface AuBecsDebit {
/**
* Six-digit number identifying bank and branch associated with this bank account.
Expand Down Expand Up @@ -440,6 +444,7 @@ declare module 'stripe' {
}

type Type =
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
Expand All @@ -454,6 +459,11 @@ declare module 'stripe' {
}

interface PaymentMethodCreateParams {
/**
* If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.
*/
alipay?: PaymentMethodCreateParams.Alipay;

/**
* If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.
*/
Expand Down Expand Up @@ -541,6 +551,8 @@ declare module 'stripe' {
}

namespace PaymentMethodCreateParams {
interface Alipay {}

interface AuBecsDebit {
/**
* The account number for the bank account.
Expand Down Expand Up @@ -726,6 +738,7 @@ declare module 'stripe' {
}

type Type =
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
Expand Down
Loading