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

Clean up deprecated features in our Typescript definitions #867

Merged
merged 1 commit into from
Apr 15, 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
10 changes: 0 additions & 10 deletions types/2020-03-02/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,6 @@ declare module 'stripe' {
}

interface AcssDebit {
/**
* 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.
*/
Expand All @@ -499,11 +494,6 @@ declare module 'stripe' {
* Last four digits of the bank account number.
*/
last4: string | null;

/**
* Routing transit number of the bank account.
*/
routing_number: string | null;
}

interface Alipay {}
Expand Down
138 changes: 1 addition & 137 deletions types/2020-03-02/Issuing/Authorizations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ declare module 'stripe' {
*/
authorization_method: Authorization.AuthorizationMethod;

/**
* [DEPRECATED] The amount that has been authorized. This will be `0` when the object is created, and increase after it has been approved.
*/
authorized_amount?: number;

/**
* [DEPRECATED] The currency that was presented to the cardholder for the authorization. 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).
*/
authorized_currency?: string;

/**
* List of balance transactions associated with this authorization.
*/
Expand All @@ -65,21 +55,6 @@ declare module 'stripe' {
*/
currency: string;

/**
* [DEPRECATED] The amount the authorization is expected to be in `held_currency`. When Stripe holds funds from you, this is the amount reserved for the authorization. This will be `0` when the object is created, and increase after it has been approved. For multi-currency transactions, `held_amount` can be used to determine the expected exchange rate.
*/
held_amount?: number;

/**
* [DEPRECATED] The currency of the [held amount](https://stripe.com/docs/api#issuing_authorization_object-held_amount). This will always be the card currency.
*/
held_currency?: string;

/**
* [DEPRECATED] If set `true`, you may provide [held_amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-held_amount) to control how much to hold for the authorization.
*/
is_held_amount_controllable?: boolean;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand All @@ -102,23 +77,13 @@ declare module 'stripe' {
*/
metadata: Metadata;

/**
* [DEPRECATED] The amount the user is requesting to be authorized. This field will only be non-zero during an `issuing_authorization.request` webhook.
*/
pending_authorized_amount?: number;

/**
* [DEPRECATED] The additional amount Stripe will hold if the authorization is approved. This field will only be non-zero during an `issuing_authorization.request` webhook.
*/
pending_held_amount?: number;

/**
* The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook.
*/
pending_request: Authorization.PendingRequest | null;

/**
* History of every time the authorization was approved/denied (whether approved/denied by you directly, or by Stripe based on your authorization_controls). If the merchant changes the authorization by performing an [incremental authorization or partial capture](https://stripe.com/docs/issuing/purchases/authorizations), you can look at request_history to see the previous states of the authorization.
* History of every time the authorization was approved/denied (whether approved/denied by you directly or by Stripe based on your `spending_controls`). If the merchant changes the authorization by performing an [incremental authorization or partial capture](https://stripe.com/docs/issuing/purchases/authorizations), you can look at this field to see the previous states of the authorization.
*/
request_history: Array<Authorization.RequestHistory>;

Expand All @@ -138,11 +103,6 @@ declare module 'stripe' {
* What, if any, digital wallet was used for this authorization. One of `apple_pay`, `google_pay`, or `samsung_pay`.
*/
wallet: string | null;

/**
* [DEPRECATED] What, if any, digital wallet was used for this authorization. One of `apple_pay`, `google_pay`, or `samsung_pay`.
*/
wallet_provider?: string | null;
}

namespace Authorization {
Expand Down Expand Up @@ -188,11 +148,6 @@ declare module 'stripe' {
* State where the seller is located
*/
state: string | null;

/**
* URL provided by the merchant on a 3DS request
*/
url?: string | null;
}

interface PendingRequest {
Expand Down Expand Up @@ -233,16 +188,6 @@ declare module 'stripe' {
*/
approved: boolean;

/**
* [DEPRECATED] The amount that was authorized at the time of this request.
*/
authorized_amount?: number;

/**
* [DEPRECATED] The currency that was presented to the cardholder for the authorization. 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).
*/
authorized_currency?: string;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
Expand All @@ -253,16 +198,6 @@ declare module 'stripe' {
*/
currency: string;

/**
* [DEPRECATED] The amount Stripe held from your account to fund the authorization, if the request was approved.
*/
held_amount?: number;

/**
* [DEPRECATED] The currency of the [held amount](https://stripe.com/docs/api#issuing_authorization_object-held_amount).
*/
held_currency?: string;

/**
* The amount that was authorized at the time of this request. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
Expand All @@ -277,28 +212,15 @@ declare module 'stripe' {
* The reason for the approval or decline.
*/
reason: RequestHistory.Reason;

/**
* [DEPRECATED] When an authorization is declined due to `authorization_controls`, this array contains details about the authorization controls that were violated. Otherwise, it is empty.
*/
violated_authorization_controls?: Array<
RequestHistory.ViolatedAuthorizationControl
>;
}

namespace RequestHistory {
type Reason =
| 'account_compliance_disabled'
| 'account_disabled'
| 'account_inactive'
| 'authentication_failed'
| 'authorization_controls'
| 'card_active'
| 'card_inactive'
| 'cardholder_inactive'
| 'cardholder_verification_required'
| 'incorrect_cvc'
| 'incorrect_expiry'
| 'insufficient_funds'
| 'not_allowed'
| 'spending_controls'
Expand All @@ -307,29 +229,6 @@ declare module 'stripe' {
| 'webhook_approved'
| 'webhook_declined'
| 'webhook_timeout';

interface ViolatedAuthorizationControl {
/**
* Entity which the authorization control acts on. One of `card`, `cardholder`, or `account`.
*/
entity: ViolatedAuthorizationControl.Entity;

/**
* Name of the authorization control. One of `allowed_categories`, `blocked_categories`, `spending_limits`, `max_approvals`, or `max_amount`.
*/
name: ViolatedAuthorizationControl.Name;
}

namespace ViolatedAuthorizationControl {
type Entity = 'account' | 'card' | 'cardholder';

type Name =
| 'allowed_categories'
| 'blocked_categories'
| 'max_amount'
| 'max_approvals'
| 'spending_limits';
}
}

type Status = 'closed' | 'pending' | 'reversed';
Expand All @@ -345,16 +244,6 @@ declare module 'stripe' {
*/
address_postal_code_check: VerificationData.AddressPostalCodeCheck;

/**
* [DEPRECATED] Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`.
*/
address_zip_check?: VerificationData.AddressZipCheck;

/**
* [DEPRECATED] Whether 3DS authentication was performed.
*/
authentication?: VerificationData.Authentication;

/**
* Whether the cardholder provided a CVC and if it matched Stripe's record.
*/
Expand All @@ -364,36 +253,16 @@ declare module 'stripe' {
* Whether the cardholder provided an expiry date and if it matched Stripe's record.
*/
expiry_check: VerificationData.ExpiryCheck;

/**
* 3D Secure details.
*/
three_d_secure?: VerificationData.ThreeDSecure | null;
}

namespace VerificationData {
type AddressLine1Check = 'match' | 'mismatch' | 'not_provided';

type AddressPostalCodeCheck = 'match' | 'mismatch' | 'not_provided';

type AddressZipCheck = 'match' | 'mismatch' | 'not_provided';

type Authentication = 'failure' | 'none' | 'success';

type CvcCheck = 'match' | 'mismatch' | 'not_provided';

type ExpiryCheck = 'match' | 'mismatch' | 'not_provided';

interface ThreeDSecure {
/**
* The outcome of the 3D Secure authentication request.
*/
result: ThreeDSecure.Result;
}

namespace ThreeDSecure {
type Result = 'attempt_acknowledged' | 'authenticated' | 'failed';
}
}
}

Expand Down Expand Up @@ -458,11 +327,6 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* [DEPRECATED] If the authorization's `is_held_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request).
*/
held_amount?: number;

/**
* 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`.
*/
Expand Down
Loading