Skip to content

Commit

Permalink
Merge pull request #849 from stripe/remi/codegen-cadc76e
Browse files Browse the repository at this point in the history
Add support for `pause_collection` on `Subscription`
  • Loading branch information
remi-stripe authored Mar 24, 2020
2 parents cf7cf71 + 5be344d commit 33be580
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 15 deletions.
2 changes: 1 addition & 1 deletion types/2020-03-02/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ declare module 'stripe' {
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.
* 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. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
*/
fingerprint?: string | null;

Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ declare module 'stripe' {
exp_year: number | null;

/**
* 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.
* 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. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
*/
fingerprint?: string | null;

Expand Down Expand Up @@ -837,7 +837,7 @@ declare module 'stripe' {
exp_year: number | null;

/**
* 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.
* 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. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
*/
fingerprint: string | null;

Expand Down
4 changes: 2 additions & 2 deletions types/2020-03-02/Issuing/Cardholders.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1010,9 +1010,9 @@ declare module 'stripe' {
address: Address;

/**
* The cardholder's billing name.
* [DEPRECATED] The cardholder's billing name.
*/
name: string | null;
name?: string | null;
}

interface Company {
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/Issuing/Cards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3163,7 +3163,7 @@ declare module 'stripe' {
name?: string;

/**
* Only return cards whose full card number matches that of this card source ID.
* [DEPRECATED] Only return cards whose full card number matches that of this card source ID.
*/
source?: string;

Expand Down
16 changes: 8 additions & 8 deletions types/2020-03-02/Issuing/Disputes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ declare module 'stripe' {
/**
* Disputed amount. Usually the amount of the `disputed_transaction`, but can differ (usually because of currency fluctuation or because only part of the order is disputed).
*/
amount: number;
amount?: number;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
created?: number;

/**
* The currency the `disputed_transaction` was made in.
*/
currency: string;
currency?: string;

/**
* The transaction being disputed.
*/
disputed_transaction: string | Stripe.Issuing.Transaction;
disputed_transaction?: string | Stripe.Issuing.Transaction;

evidence: Dispute.Evidence;
evidence?: Dispute.Evidence;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Expand All @@ -45,17 +45,17 @@ declare module 'stripe' {
/**
* 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;
metadata?: Metadata;

/**
* Reason for this dispute. One of `duplicate`, `product_not_received`, `fraudulent`, or `other`.
*/
reason: string;
reason?: string;

/**
* Current status of dispute. One of `unsubmitted`, `under_review`, `won`, or `lost`.
*/
status: Dispute.Status;
status?: Dispute.Status;
}

namespace Dispute {
Expand Down
2 changes: 1 addition & 1 deletion types/2020-03-02/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ declare module 'stripe' {
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.
* 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. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
*/
fingerprint?: string | null;

Expand Down
42 changes: 42 additions & 0 deletions types/2020-03-02/Subscriptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ declare module 'stripe' {
*/
next_pending_invoice_item_invoice: number | null;

/**
* If specified, payment collection for this subscription will be paused.
*/
pause_collection: Subscription.PauseCollection | null;

/**
* Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
*/
Expand Down Expand Up @@ -208,6 +213,22 @@ declare module 'stripe' {

type CollectionMethod = 'charge_automatically' | 'send_invoice';

interface PauseCollection {
/**
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
*/
behavior: PauseCollection.Behavior;

/**
* The time after which the subscription will resume collecting payments.
*/
resumes_at: number | null;
}

namespace PauseCollection {
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
}

interface PendingInvoiceItemInterval {
/**
* Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
Expand Down Expand Up @@ -571,6 +592,11 @@ declare module 'stripe' {
*/
off_session?: boolean;

/**
* If specified, payment collection for this subscription will be paused.
*/
pause_collection?: SubscriptionUpdateParams.PauseCollection | null;

/**
* Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.
*
Expand Down Expand Up @@ -693,6 +719,22 @@ declare module 'stripe' {
}
}

interface PauseCollection {
/**
* The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
*/
behavior: PauseCollection.Behavior;

/**
* The time after which the subscription will resume collecting payments.
*/
resumes_at?: number;
}

namespace PauseCollection {
type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void';
}

type PaymentBehavior =
| 'allow_incomplete'
| 'error_if_incomplete'
Expand Down

0 comments on commit 33be580

Please sign in to comment.