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

API Updates #1420

Merged
merged 2 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 9 additions & 3 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,8 @@ declare module 'stripe' {
amount: number;

/**
* A discount represents the actual application of a coupon to a particular
* customer. It contains information about when the discount began and when it
* will end.
* A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
* It contains information about when the discount began, when it will end, and what it is applied to.
*
* Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).
*/
Expand Down Expand Up @@ -2157,6 +2156,13 @@ declare module 'stripe' {
*/
default_tax_rates?: Array<string>;

/**
* The subscription's description, meant to be displayable to the customer.
* Use this field to optionally store an explanation of the subscription
* for rendering in Stripe hosted surfaces.
*/
description?: string;

/**
* A list of items, each with an attached plan, that the customer is subscribing to. Prefer using `line_items`.
*/
Expand Down
8 changes: 4 additions & 4 deletions types/2020-08-27/Discounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ declare module 'stripe' {

/**
* A coupon contains information about a percent-off or amount-off discount you
* might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or
* [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge).
* might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),
* [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents).
*/
coupon: Stripe.Coupon;

Expand Down Expand Up @@ -87,8 +87,8 @@ declare module 'stripe' {

/**
* A coupon contains information about a percent-off or amount-off discount you
* might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or
* [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge).
* might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),
* [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents).
*/
coupon: Stripe.Coupon;

Expand Down
5 changes: 2 additions & 3 deletions types/2020-08-27/LineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ declare module 'stripe' {
amount: number;

/**
* A discount represents the actual application of a coupon to a particular
* customer. It contains information about when the discount began and when it
* will end.
* A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
* It contains information about when the discount began, when it will end, and what it is applied to.
*
* Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).
*/
Expand Down
7 changes: 3 additions & 4 deletions types/2020-08-27/Orders.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,8 @@ declare module 'stripe' {
amount: number;

/**
* A discount represents the actual application of a coupon to a particular
* customer. It contains information about when the discount began and when it
* will end.
* A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
* It contains information about when the discount began, when it will end, and what it is applied to.
*
* Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).
*/
Expand Down Expand Up @@ -2923,7 +2922,7 @@ declare module 'stripe' {
): ApiListPromise<Stripe.LineItem>;

/**
* Reopens a processing order.
* Reopens a submitted order.
*/
reopen(
id: string,
Expand Down
167 changes: 167 additions & 0 deletions types/2020-08-27/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ declare module 'stripe' {
*/
billing_address_collection: PaymentLink.BillingAddressCollection;

/**
* When set, provides configuration to gather active consent from customers.
*/
consent_collection: PaymentLink.ConsentCollection | null;

/**
* Configuration for Customer creation during checkout.
*/
customer_creation: PaymentLink.CustomerCreation;

/**
* The line items representing what is being sold.
*/
Expand All @@ -65,6 +75,11 @@ declare module 'stripe' {
*/
on_behalf_of: string | Stripe.Account | null;

/**
* Indicates the parameters to be passed to PaymentIntent creation during checkout.
*/
payment_intent_data: PaymentLink.PaymentIntentData | null;

/**
* The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
*/
Expand All @@ -77,11 +92,23 @@ declare module 'stripe' {
*/
shipping_address_collection: PaymentLink.ShippingAddressCollection | null;

/**
* The shipping rate options applied to the session.
*/
shipping_options: Array<PaymentLink.ShippingOption>;

/**
* Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.
*/
submit_type: PaymentLink.SubmitType;

/**
* When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
*/
subscription_data: PaymentLink.SubscriptionData | null;

tax_id_collection: PaymentLink.TaxIdCollection;

/**
* The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
*/
Expand Down Expand Up @@ -132,6 +159,33 @@ declare module 'stripe' {

type BillingAddressCollection = 'auto' | 'required';

interface ConsentCollection {
/**
* If set to `auto`, enables the collection of customer consent for promotional communications.
*/
promotions: 'auto' | null;
}

type CustomerCreation = 'always' | 'if_required';

interface PaymentIntentData {
/**
* Indicates when the funds will be captured from the customer's account.
*/
capture_method: PaymentIntentData.CaptureMethod | null;

/**
* Indicates that you intend to make future payments with the payment method collected during checkout.
*/
setup_future_usage: PaymentIntentData.SetupFutureUsage | null;
}

namespace PaymentIntentData {
type CaptureMethod = 'automatic' | 'manual';

type SetupFutureUsage = 'off_session' | 'on_session';
}

interface PhoneNumberCollection {
/**
* If `true`, a phone number will be collected during checkout.
Expand Down Expand Up @@ -387,13 +441,34 @@ declare module 'stripe' {
| 'ZZ';
}

interface ShippingOption {
/**
* A non-negative integer in cents representing how much to charge.
*/
shipping_amount: number;

/**
* The ID of the Shipping Rate to use for this shipping option.
*/
shipping_rate: string | Stripe.ShippingRate;
}

type SubmitType = 'auto' | 'book' | 'donate' | 'pay';

interface SubscriptionData {
/**
* Integer representing the number of trial period days before the customer is charged for the first time.
*/
trial_period_days: number | null;
}

interface TaxIdCollection {
/**
* Indicates whether tax ID collection is enabled for the session.
*/
enabled: boolean;
}

interface TransferData {
/**
* The amount in %s that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
Expand Down Expand Up @@ -443,6 +518,16 @@ declare module 'stripe' {
*/
billing_address_collection?: PaymentLinkCreateParams.BillingAddressCollection;

/**
* Configure fields to gather active consent from customers.
*/
consent_collection?: PaymentLinkCreateParams.ConsentCollection;

/**
* Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).
*/
customer_creation?: PaymentLinkCreateParams.CustomerCreation;

/**
* Specifies which fields in the response should be expanded.
*/
Expand All @@ -458,6 +543,11 @@ declare module 'stripe' {
*/
on_behalf_of?: string;

/**
* A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
*/
payment_intent_data?: PaymentLinkCreateParams.PaymentIntentData;

/**
* The list of payment method types that customers can use. Only `card` is supported. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)).
*/
Expand All @@ -475,11 +565,26 @@ declare module 'stripe' {
*/
shipping_address_collection?: PaymentLinkCreateParams.ShippingAddressCollection;

/**
* The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.
*/
shipping_options?: Array<PaymentLinkCreateParams.ShippingOption>;

/**
* Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button.
*/
submit_type?: PaymentLinkCreateParams.SubmitType;

/**
* When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.
*/
subscription_data?: PaymentLinkCreateParams.SubscriptionData;

/**
* Controls tax ID collection during checkout.
*/
tax_id_collection?: PaymentLinkCreateParams.TaxIdCollection;

/**
* The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
*/
Expand Down Expand Up @@ -531,6 +636,17 @@ declare module 'stripe' {

type BillingAddressCollection = 'auto' | 'required';

interface ConsentCollection {
/**
* If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
* Session will determine whether to display an option to opt into promotional communication
* from the merchant depending on the customer's locale. Only available to US merchants.
*/
promotions?: 'auto';
}

type CustomerCreation = 'always' | 'if_required';

interface LineItem {
/**
* When set, provides configuration for this item's quantity to be adjusted by the customer during checkout.
Expand Down Expand Up @@ -567,6 +683,34 @@ declare module 'stripe' {
}
}

interface PaymentIntentData {
/**
* Controls when the funds will be captured from the customer's account.
*/
capture_method?: PaymentIntentData.CaptureMethod;

/**
* Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session.
*
* When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved.
*
* When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.
*
* If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.
*
* If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.
*
* When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
*/
setup_future_usage?: PaymentIntentData.SetupFutureUsage;
}

namespace PaymentIntentData {
type CaptureMethod = 'automatic' | 'manual';

type SetupFutureUsage = 'off_session' | 'on_session';
}

interface PhoneNumberCollection {
/**
* Set to `true` to enable phone number collection.
Expand Down Expand Up @@ -823,13 +967,29 @@ declare module 'stripe' {
| 'ZZ';
}

interface ShippingOption {
/**
* The ID of the Shipping Rate to use for this shipping option.
*/
shipping_rate?: string;
}

type SubmitType = 'auto' | 'book' | 'donate' | 'pay';

interface SubscriptionData {
/**
* Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
*/
trial_period_days?: number;
}

interface TaxIdCollection {
/**
* Set to `true` to enable tax ID collection.
*/
enabled: boolean;
}

interface TransferData {
/**
* The amount that will be transferred automatically when a charge succeeds.
Expand Down Expand Up @@ -879,6 +1039,11 @@ declare module 'stripe' {
*/
billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection;

/**
* Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).
*/
customer_creation?: PaymentLinkUpdateParams.CustomerCreation;

/**
* Specifies which fields in the response should be expanded.
*/
Expand Down Expand Up @@ -952,6 +1117,8 @@ declare module 'stripe' {

type BillingAddressCollection = 'auto' | 'required';

type CustomerCreation = 'always' | 'if_required';

interface LineItem {
/**
* When set, provides configuration for this item's quantity to be adjusted by the customer during checkout.
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/PromotionCodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declare module 'stripe' {

/**
* A coupon contains information about a percent-off or amount-off discount you
* might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or
* [orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge).
* might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),
* [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents).
*/
coupon: Stripe.Coupon;

Expand Down
Loading