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

Remove deprecated resources and methods #744

Merged
merged 5 commits into from
Dec 26, 2019
Merged
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
5 changes: 0 additions & 5 deletions lib/resources.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ module.exports = {
ApplicationFees: require('./resources/ApplicationFees'),
Balance: require('./resources/Balance'),
BalanceTransactions: require('./resources/BalanceTransactions'),
BitcoinReceivers: require('./resources/BitcoinReceivers'),
Charges: require('./resources/Charges'),
CountrySpecs: require('./resources/CountrySpecs'),
Coupons: require('./resources/Coupons'),
@@ -35,7 +34,6 @@ module.exports = {
Payouts: require('./resources/Payouts'),
Plans: require('./resources/Plans'),
Products: require('./resources/Products'),
Recipients: require('./resources/Recipients'),
Refunds: require('./resources/Refunds'),
Reviews: require('./resources/Reviews'),
SetupIntents: require('./resources/SetupIntents'),
@@ -45,12 +43,9 @@ module.exports = {
SubscriptionItems: require('./resources/SubscriptionItems'),
SubscriptionSchedules: require('./resources/SubscriptionSchedules'),
TaxRates: require('./resources/TaxRates'),
ThreeDSecure: require('./resources/ThreeDSecure'),
Tokens: require('./resources/Tokens'),
Topups: require('./resources/Topups'),
Transfers: require('./resources/Transfers'),
UsageRecords: require('./resources/UsageRecords'),
UsageRecordSummaries: require('./resources/UsageRecordSummaries'),
WebhookEndpoints: require('./resources/WebhookEndpoints'),
Checkout: resourceNamespace('checkout', {
Sessions: require('./resources/Checkout/Sessions'),
16 changes: 0 additions & 16 deletions lib/resources/BitcoinReceivers.js

This file was deleted.

36 changes: 0 additions & 36 deletions lib/resources/Recipients.js

This file was deleted.

6 changes: 6 additions & 0 deletions lib/resources/SubscriptionItems.js
Original file line number Diff line number Diff line change
@@ -12,4 +12,10 @@ module.exports = StripeResource.extend({
method: 'POST',
path: '/{subscriptionItem}/usage_records',
}),

listUsageRecordSummaries: stripeMethod({
method: 'GET',
path: '/{subscriptionItem}/usage_record_summaries',
methodType: 'list',
}),
});
9 changes: 0 additions & 9 deletions lib/resources/ThreeDSecure.js

This file was deleted.

14 changes: 0 additions & 14 deletions lib/resources/UsageRecordSummaries.js

This file was deleted.

13 changes: 0 additions & 13 deletions lib/resources/UsageRecords.js

This file was deleted.

47 changes: 0 additions & 47 deletions test/resources/BitcoinReceivers.spec.js

This file was deleted.

213 changes: 0 additions & 213 deletions test/resources/Recipients.spec.js

This file was deleted.

14 changes: 14 additions & 0 deletions test/resources/SubscriptionItems.spec.js
Original file line number Diff line number Diff line change
@@ -100,4 +100,18 @@ describe('SubscriptionItems Resource', () => {
});
});
});

describe('listUsageRecordSummaries', () => {
it('Sends the correct request', () => {
stripe.subscriptionItems.listUsageRecordSummaries('si_123', {});

expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/subscription_items/si_123/usage_record_summaries',
headers: {},
data: {},
settings: {},
});
});
});
});
43 changes: 0 additions & 43 deletions test/resources/ThreeDSecure.spec.js

This file was deleted.

50 changes: 0 additions & 50 deletions test/resources/UsageRecordSummaries.spec.js

This file was deleted.

74 changes: 0 additions & 74 deletions test/resources/UsageRecords.spec.js

This file was deleted.

63 changes: 0 additions & 63 deletions types/2019-12-03/BitcoinReceivers.d.ts
Original file line number Diff line number Diff line change
@@ -127,68 +127,5 @@ declare module 'stripe' {
*/
deleted: true;
}

interface BitcoinReceiverRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface BitcoinReceiverListParams extends PaginationParams {
/**
* Filter for active receivers.
*/
active?: boolean;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

/**
* Filter for filled receivers.
*/
filled?: boolean;

/**
* Filter for receivers with uncaptured funds.
*/
uncaptured_funds?: boolean;
}

class BitcoinReceiversResource {
/**
* Retrieves the Bitcoin receiver with the given ID.
*/
retrieve(
id: string,
params?: BitcoinReceiverRetrieveParams,
options?: RequestOptions
): Promise<BitcoinReceiver>;
retrieve(id: string, options?: RequestOptions): Promise<BitcoinReceiver>;

/**
* Returns a list of your receivers. Receivers are returned sorted by creation date, with the most recently created receivers appearing first.
*/
list(
params?: BitcoinReceiverListParams,
options?: RequestOptions
): ApiListPromise<BitcoinReceiver>;
list(options?: RequestOptions): ApiListPromise<BitcoinReceiver>;

/**
* List bitcoin transacitons for a given receiver.
*/
listTransactions(
id: string,
params?: BitcoinTransactionListParams,
options?: RequestOptions
): ApiListPromise<BitcoinTransaction>;
listTransactions(
id: string,
options?: RequestOptions
): ApiListPromise<BitcoinTransaction>;
}
}
}
7 changes: 6 additions & 1 deletion types/2019-12-03/CustomerSources.d.ts
Original file line number Diff line number Diff line change
@@ -144,7 +144,12 @@ declare module 'stripe' {
object?: string;
}

interface CustomerSourceDeleteParams {}
interface CustomerSourceDeleteParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface CustomerSourceVerifyParams {
/**
179 changes: 0 additions & 179 deletions types/2019-12-03/Recipients.d.ts
Original file line number Diff line number Diff line change
@@ -92,184 +92,5 @@ declare module 'stripe' {
*/
deleted: true;
}

interface RecipientCreateParams {
/**
* The recipient's full, legal name. For type `individual`, should be in the format `First Last`, `First Middle Last`, or `First M Last` (no prefixes or suffixes). For `corporation`, the full, incorporated name.
*/
name: string;

/**
* Type of the recipient: either `individual` or `corporation`.
*/
type: string;

/**
* A bank account to attach to the recipient. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe-js), or a dictionary containing a user's bank account details, with the options described below.
*/
bank_account?: string;

/**
* A U.S. Visa or MasterCard debit card (_not_ prepaid) to attach to the recipient. If the debit card is not valid, recipient creation will fail. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe-js), or a dictionary containing a user's debit card details, with the options described below. Although not all information is required, the extra info helps prevent fraud.
*/
card?: string;

/**
* An arbitrary string which you can attach to a `Recipient` object. It is displayed alongside the recipient in the web interface.
*/
description?: string;

/**
* The recipient's email address. It is displayed alongside the recipient in the web interface, and can be useful for searching and tracking.
*/
email?: string;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<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;

/**
* The recipient's tax ID, as a string. For type `individual`, the full SSN; for type `corporation`, the full EIN.
*/
tax_id?: string;
}

interface RecipientRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface RecipientUpdateParams {
/**
* A bank account to attach to the recipient. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe-js), or a dictionary containing a user's bank account details, with the options described below.
*/
bank_account?: string;

/**
* A U.S. Visa or MasterCard debit card (not prepaid) to attach to the recipient. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe-js), or a dictionary containing a user's debit card details, with the options described below. Passing `card` will create a new card, make it the new recipient default card, and delete the old recipient default (if one exists). If you want to add additional debit cards instead of replacing the existing default, use the [card creation API](#create_card). Whenever you attach a card to a recipient, Stripe will automatically validate the debit card.
*/
card?: string;

/**
* ID of the card to set as the recipient's new default for payouts.
*/
default_card?: string;

/**
* An arbitrary string which you can attach to a `Recipient` object. It is displayed alongside the recipient in the web interface.
*/
description?: string;

/**
* The recipient's email address. It is displayed alongside the recipient in the web interface, and can be useful for searching and tracking.
*/
email?: string;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<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;

/**
* The recipient's full, legal name. For type `individual`, should be in the format `First Last`, `First Middle Last`, or `First M Last` (no prefixes or suffixes). For `corporation`, the full, incorporated name.
*/
name?: string;

/**
* The recipient's tax ID, as a string. For type `individual`, the full SSN; for type `corporation`, the full EIN.
*/
tax_id?: string;
}

interface RecipientListParams extends PaginationParams {
created?: RangeQueryParam | number;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

type?: RecipientListParams.Type;

/**
* Only return recipients that are verified or unverified.
*/
verified?: boolean;
}

namespace RecipientListParams {
type Type = 'corporation' | 'individual';
}

interface RecipientDeleteParams {}

class RecipientsResource {
/**
* Creates a new Recipient object and verifies the recipient's identity.
* Also verifies the recipient's bank account information or debit card, if either is provided.
*/
create(
params: RecipientCreateParams,
options?: RequestOptions
): Promise<Recipient>;

/**
* Retrieves the details of an existing recipient. You need only supply the unique recipient identifier that was returned upon recipient creation.
*/
retrieve(
id: string,
params?: RecipientRetrieveParams,
options?: RequestOptions
): Promise<Recipient | DeletedRecipient>;
retrieve(
id: string,
options?: RequestOptions
): Promise<Recipient | DeletedRecipient>;

/**
* Updates the specified recipient by setting the values of the parameters passed.
* Any parameters not provided will be left unchanged.
*
* If you update the name or tax ID, the identity verification will automatically be rerun.
* If you update the bank account, the bank account validation will automatically be rerun.
*/
update(
id: string,
params?: RecipientUpdateParams,
options?: RequestOptions
): Promise<Recipient>;

/**
* Returns a list of your recipients. The recipients are returned sorted by creation date, with the most recently created recipients appearing first.
*/
list(
params?: RecipientListParams,
options?: RequestOptions
): ApiListPromise<Recipient>;
list(options?: RequestOptions): ApiListPromise<Recipient>;

/**
* Permanently deletes a recipient. It cannot be undone.
*/
del(
id: string,
params?: RecipientDeleteParams,
options?: RequestOptions
): Promise<DeletedRecipient>;
del(id: string, options?: RequestOptions): Promise<DeletedRecipient>;
}
}
}
15 changes: 15 additions & 0 deletions types/2019-12-03/SubscriptionItems.d.ts
Original file line number Diff line number Diff line change
@@ -310,6 +310,21 @@ declare module 'stripe' {
params: UsageRecordCreateParams,
options?: RequestOptions
): Promise<UsageRecord>;

/**
* For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the billing plan's month of September).
*
* The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends.
*/
listUsageRecordSummaries(
id: string,
params?: UsageRecordSummaryListParams,
options?: RequestOptions
): ApiListPromise<UsageRecordSummary>;
listUsageRecordSummaries(
id: string,
options?: RequestOptions
): ApiListPromise<UsageRecordSummary>;
}
}
}
108 changes: 0 additions & 108 deletions types/2019-12-03/ThreeDSecure.d.ts

This file was deleted.

7 changes: 7 additions & 0 deletions types/2019-12-03/UsageRecordSummaries.d.ts
Original file line number Diff line number Diff line change
@@ -50,5 +50,12 @@ declare module 'stripe' {
start: number | null;
}
}

interface UsageRecordSummaryListParams extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
}
6 changes: 1 addition & 5 deletions types/2019-12-03/index.d.ts
Original file line number Diff line number Diff line change
@@ -69,11 +69,9 @@
///<reference path='./Terminal/ConnectionTokens.d.ts' />
///<reference path='./Terminal/Locations.d.ts' />
///<reference path='./Terminal/Readers.d.ts' />
///<reference path='./ThreeDSecure.d.ts' />
///<reference path='./Tokens.d.ts' />
///<reference path='./Topups.d.ts' />
///<reference path='./Transfers.d.ts' />
///<reference path='./UsageRecordSummaries.d.ts' />
///<reference path='./WebhookEndpoints.d.ts' />
///<reference path='./Capabilities.d.ts' />
///<reference path='./ExternalAccounts.d.ts' />
@@ -86,6 +84,7 @@
///<reference path='./TaxIds.d.ts' />
///<reference path='./InvoiceLineItems.d.ts' />
///<reference path='./UsageRecords.d.ts' />
///<reference path='./UsageRecordSummaries.d.ts' />
///<reference path='./TransferReversals.d.ts' />

declare module 'stripe' {
@@ -108,7 +107,6 @@ declare module 'stripe' {
applicationFees: Stripe.ApplicationFeesResource;
balance: Stripe.BalanceResource;
balanceTransactions: Stripe.BalanceTransactionsResource;
bitcoinReceivers: Stripe.BitcoinReceiversResource;
charges: Stripe.ChargesResource;
countrySpecs: Stripe.CountrySpecsResource;
coupons: Stripe.CouponsResource;
@@ -131,7 +129,6 @@ declare module 'stripe' {
payouts: Stripe.PayoutsResource;
plans: Stripe.PlansResource;
products: Stripe.ProductsResource;
recipients: Stripe.RecipientsResource;
refunds: Stripe.RefundsResource;
reviews: Stripe.ReviewsResource;
setupIntents: Stripe.SetupIntentsResource;
@@ -141,7 +138,6 @@ declare module 'stripe' {
subscriptionItems: Stripe.SubscriptionItemsResource;
subscriptionSchedules: Stripe.SubscriptionSchedulesResource;
taxRates: Stripe.TaxRatesResource;
threeDSecure: Stripe.ThreeDSecureResource;
tokens: Stripe.TokensResource;
topups: Stripe.TopupsResource;
transfers: Stripe.TransfersResource;