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

Multiple API changes #991

Merged
merged 1 commit into from
Aug 28, 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
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2020-03-02
2020-08-27
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ and instantiate it as `new Stripe()` with the latest API version.
```ts
import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...', {
apiVersion: '2020-03-02',
apiVersion: '2020-08-27',
});

const createCustomer = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import env from 'dotenv';
env.config();

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2020-03-02',
apiVersion: '2020-08-27',
});

const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"node": "^8.1 || >=10.*"
},
"main": "lib/stripe.js",
"types": "types/2020-03-02/index.d.ts",
"types": "types/2020-08-27/index.d.ts",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* Alternate name for refresh_url to ensure backwards compatibility
*/
failure_url?: string;

/**
* The URL that the user will be redirected to if the account link is no longer valid. Your `refresh_url` should trigger a method on your server to create a new account link using this API, with the same parameters, and redirect the user to the new account link.
*/
Expand All @@ -61,11 +56,6 @@ declare module 'stripe' {
* The URL that the user will be redirected to upon leaving or completing the linked flow.
*/
return_url?: string;

/**
* Alternate name for return_url to ensure backwards compatibility
*/
success_url?: string;
}

namespace AccountLinkCreateParams {
Expand Down
52 changes: 10 additions & 42 deletions types/2020-03-02/Accounts.d.ts → types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,15 @@ declare module 'stripe' {
| 'verification_document_id_number_missing'
| 'verification_document_incomplete'
| 'verification_document_invalid'
| 'verification_document_issue_or_expiry_date_missing'
| 'verification_document_manipulated'
| 'verification_document_missing_back'
| 'verification_document_missing_front'
| 'verification_document_name_mismatch'
| 'verification_document_name_missing'
| 'verification_document_nationality_mismatch'
| 'verification_document_not_readable'
| 'verification_document_not_signed'
| 'verification_document_not_uploaded'
| 'verification_document_photo_mismatch'
| 'verification_document_too_large'
Expand All @@ -517,7 +519,9 @@ declare module 'stripe' {
| 'verification_failed_keyed_identity'
| 'verification_failed_keyed_match'
| 'verification_failed_name_match'
| 'verification_failed_other';
| 'verification_failed_other'
| 'verification_failed_tax_id_match'
| 'verification_failed_tax_id_not_issued';
}
}

Expand Down Expand Up @@ -669,17 +673,17 @@ declare module 'stripe' {
/**
* The Unix timestamp marking when the Stripe Services Agreement was accepted by the account representative
*/
date: number | null;
date?: number | null;

/**
* The IP address from which the Stripe Services Agreement was accepted by the account representative
*/
ip: string | null;
ip?: string | null;

/**
* The user agent of the browser from which the Stripe Services Agreement was accepted by the account representative
*/
user_agent: string | null;
user_agent?: string | null;
}

type Type = 'custom' | 'express' | 'standard';
Expand Down Expand Up @@ -727,7 +731,7 @@ declare module 'stripe' {
capabilities?: AccountCreateParams.Capabilities;

/**
* Information about the company or business. This field is null unless `business_type` is set to `company`, `government_entity`, or `non_profit`.
* Information about the company or business. This field is available for any `business_type`.
*/
company?: AccountCreateParams.Company;

Expand Down Expand Up @@ -768,11 +772,6 @@ declare module 'stripe' {
*/
metadata?: MetadataParam | null;

/**
* (Deprecated) Alternative to `capabilities`. The set of capabilities you want to unlock for this account. Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.
*/
requested_capabilities?: Array<AccountCreateParams.RequestedCapability>;

/**
* Options for customizing how the account functions within Stripe.
*/
Expand Down Expand Up @@ -1345,19 +1344,6 @@ declare module 'stripe' {
}
}

type RequestedCapability =
| 'au_becs_debit_payments'
| 'bacs_debit_payments'
| 'card_issuing'
| 'card_payments'
| 'cartes_bancaires_payments'
| 'fpx_payments'
| 'jcb_payments'
| 'legacy_payments'
| 'tax_reporting_us_1099_k'
| 'tax_reporting_us_1099_misc'
| 'transfers';

interface Settings {
/**
* Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products.
Expand Down Expand Up @@ -1557,7 +1543,7 @@ declare module 'stripe' {
capabilities?: AccountUpdateParams.Capabilities;

/**
* Information about the company or business. This field is null unless `business_type` is set to `company`, `government_entity`, or `non_profit`.
* Information about the company or business. This field is available for any `business_type`.
*/
company?: AccountUpdateParams.Company;

Expand Down Expand Up @@ -1593,11 +1579,6 @@ declare module 'stripe' {
*/
metadata?: MetadataParam | null;

/**
* (Deprecated) Alternative to `capabilities`. The set of capabilities you want to unlock for this account. Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.
*/
requested_capabilities?: Array<AccountUpdateParams.RequestedCapability>;

/**
* Options for customizing how the account functions within Stripe.
*/
Expand Down Expand Up @@ -2165,19 +2146,6 @@ declare module 'stripe' {
}
}

type RequestedCapability =
| 'au_becs_debit_payments'
| 'bacs_debit_payments'
| 'card_issuing'
| 'card_payments'
| 'cartes_bancaires_payments'
| 'fpx_payments'
| 'jcb_payments'
| 'legacy_payments'
| 'tax_reporting_us_1099_k'
| 'tax_reporting_us_1099_misc'
| 'transfers';

interface Settings {
/**
* Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ declare module 'stripe' {
| 'verification_document_id_number_missing'
| 'verification_document_incomplete'
| 'verification_document_invalid'
| 'verification_document_issue_or_expiry_date_missing'
| 'verification_document_manipulated'
| 'verification_document_missing_back'
| 'verification_document_missing_front'
| 'verification_document_name_mismatch'
| 'verification_document_name_missing'
| 'verification_document_nationality_mismatch'
| 'verification_document_not_readable'
| 'verification_document_not_signed'
| 'verification_document_not_uploaded'
| 'verification_document_photo_mismatch'
| 'verification_document_too_large'
Expand All @@ -133,7 +135,9 @@ declare module 'stripe' {
| 'verification_failed_keyed_identity'
| 'verification_failed_keyed_match'
| 'verification_failed_name_match'
| 'verification_failed_other';
| 'verification_failed_other'
| 'verification_failed_tax_id_match'
| 'verification_failed_tax_id_not_issued';
}
}

Expand Down
File renamed without changes.
49 changes: 18 additions & 31 deletions types/2020-03-02/Charges.d.ts → types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,6 @@ declare module 'stripe' {

bancontact?: PaymentMethodDetails.Bancontact;

bitcoin?: PaymentMethodDetails.Bitcoin;

card?: PaymentMethodDetails.Card;

card_present?: PaymentMethodDetails.CardPresent;
Expand Down Expand Up @@ -615,20 +613,6 @@ declare module 'stripe' {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}

interface Bitcoin {
address: string | null;

amount: number | null;

amount_charged: number | null;

amount_received: number | null;

amount_returned: number | null;

refund_address: string | null;
}

interface Card {
/**
* Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
Expand Down Expand Up @@ -759,12 +743,6 @@ declare module 'stripe' {
}

interface ThreeDSecure {
/**
* Whether or not authentication was performed. 3D Secure will succeed
* without authentication when the card is not enrolled.
*/
authenticated?: boolean;

/**
* For authenticated transactions: how the customer was authenticated by
* the issuing bank.
Expand All @@ -782,11 +760,6 @@ declare module 'stripe' {
*/
result_reason: ThreeDSecure.ResultReason | null;

/**
* Whether or not 3D Secure succeeded.
*/
succeeded?: boolean;

/**
* The version of 3D Secure that was used.
*/
Expand Down Expand Up @@ -959,9 +932,9 @@ declare module 'stripe' {
network: string | null;

/**
* How were card details read in this transaction. Can be contact_emv, contactless_emv, magnetic_stripe_fallback, magnetic_stripe_track2, or contactless_magstripe_mode
* How card details were read in this transaction.
*/
read_method: string | null;
read_method: CardPresent.ReadMethod | null;

/**
* A collection of fields required to be displayed on receipts. Only required for EMV transactions.
Expand All @@ -970,6 +943,13 @@ declare module 'stripe' {
}

namespace CardPresent {
type ReadMethod =
| 'contact_emv'
| 'contactless_emv'
| 'contactless_magstripe_mode'
| 'magnetic_stripe_fallback'
| 'magnetic_stripe_track2';

interface Receipt {
/**
* The type of account being debited or credited
Expand Down Expand Up @@ -1208,9 +1188,9 @@ declare module 'stripe' {
network: string | null;

/**
* How were card details read in this transaction. Can be contact_emv, contactless_emv, magnetic_stripe_fallback, magnetic_stripe_track2, or contactless_magstripe_mode
* How card details were read in this transaction.
*/
read_method: string | null;
read_method: InteracPresent.ReadMethod | null;

/**
* A collection of fields required to be displayed on receipts. Only required for EMV transactions.
Expand All @@ -1219,6 +1199,13 @@ declare module 'stripe' {
}

namespace InteracPresent {
type ReadMethod =
| 'contact_emv'
| 'contactless_emv'
| 'contactless_magstripe_mode'
| 'magnetic_stripe_fallback'
| 'magnetic_stripe_track2';

interface Receipt {
/**
* The type of account being debited or credited
Expand Down
Loading