Skip to content

Commit

Permalink
API Updates (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe authored Jan 12, 2022
1 parent 2a8aa0d commit ecb3c2f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 6 deletions.
4 changes: 2 additions & 2 deletions types/2020-08-27/BillingPortal/Configurations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ declare module 'stripe' {

interface Product {
/**
* The list of prices IDs that a subscription can be updated to.
* The list of price IDs for the product that a subscription can be updated to.
*/
prices: Array<string>;

Expand Down Expand Up @@ -678,7 +678,7 @@ declare module 'stripe' {

interface Product {
/**
* The list of prices IDs that a subscription can be updated to.
* The list of price IDs for the product that a subscription can be updated to.
*/
prices: Array<string>;

Expand Down
32 changes: 28 additions & 4 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ declare module 'stripe' {
*/
customer: string | Stripe.Customer | Stripe.DeletedCustomer | null;

/**
* Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
*/
customer_creation: Session.CustomerCreation | null;

/**
* The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode.
*/
Expand Down Expand Up @@ -289,6 +294,8 @@ declare module 'stripe' {
promotions: 'auto' | null;
}

type CustomerCreation = 'always' | 'if_required';

interface CustomerDetails {
/**
* The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry.
Expand Down Expand Up @@ -914,7 +921,7 @@ declare module 'stripe' {
* ID of an existing Customer, if one exists. In `payment` mode, the customer's most recent card
* payment method will be used to prefill the email, name, card details, and billing address
* on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)
* will be used if it's a card, and otherwise the most recent card will be used. A valid billing address is required for Checkout to prefill the customer's card details.
* will be used if it's a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details.
*
* If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.
* If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.
Expand All @@ -925,6 +932,18 @@ declare module 'stripe' {
*/
customer?: string;

/**
* Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation.
*
* When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout
* with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details).
*
* Sessions that do not create Customers will instead create [Guest Customers](https://support.stripe.com/questions/guest-customer-faq) in the Dashboard.
*
* Can only be set in `payment` and `setup` mode.
*/
customer_creation?: SessionCreateParams.CustomerCreation;

/**
* If provided, this value will be used when the Customer object is created.
* If not provided, customers will be asked to enter their email address.
Expand Down Expand Up @@ -1089,6 +1108,8 @@ declare module 'stripe' {
promotions?: 'auto';
}

type CustomerCreation = 'always' | 'if_required';

interface CustomerUpdate {
/**
* Describes whether Checkout saves the billing address onto `customer.address`.
Expand Down Expand Up @@ -1383,9 +1404,12 @@ declare module 'stripe' {
* customer that their payment details will be saved and used for future
* payments.
*
* For both values, Checkout will attach the payment method to either the
* provided Customer for the session, or a new Customer created by Checkout
* if one has not been provided.
* 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
Expand Down
50 changes: 50 additions & 0 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,12 @@ declare module 'stripe' {

card_present?: PaymentMethodOptions.CardPresent;

fpx?: PaymentMethodOptions.Fpx;

giropay?: PaymentMethodOptions.Giropay;

grabpay?: PaymentMethodOptions.Grabpay;

ideal?: PaymentMethodOptions.Ideal;

interac_present?: PaymentMethodOptions.InteracPresent;
Expand Down Expand Up @@ -720,8 +724,12 @@ declare module 'stripe' {

interface CardPresent {}

interface Fpx {}

interface Giropay {}

interface Grabpay {}

interface Ideal {}

interface InteracPresent {}
Expand Down Expand Up @@ -1518,11 +1526,21 @@ declare module 'stripe' {
*/
card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;

/**
* If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
*/
fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;

/**
* If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
*/
giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;

/**
* If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
*/
grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;

/**
* If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
*/
Expand Down Expand Up @@ -1738,8 +1756,12 @@ declare module 'stripe' {

interface CardPresent {}

interface Fpx {}

interface Giropay {}

interface Grabpay {}

interface Ideal {}

interface InteracPresent {}
Expand Down Expand Up @@ -2469,11 +2491,21 @@ declare module 'stripe' {
*/
card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;

/**
* If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
*/
fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;

/**
* If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
*/
giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;

/**
* If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
*/
grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;

/**
* If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
*/
Expand Down Expand Up @@ -2689,8 +2721,12 @@ declare module 'stripe' {

interface CardPresent {}

interface Fpx {}

interface Giropay {}

interface Grabpay {}

interface Ideal {}

interface InteracPresent {}
Expand Down Expand Up @@ -3534,11 +3570,21 @@ declare module 'stripe' {
*/
card_present?: Stripe.Emptyable<PaymentMethodOptions.CardPresent>;

/**
* If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options.
*/
fpx?: Stripe.Emptyable<PaymentMethodOptions.Fpx>;

/**
* If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options.
*/
giropay?: Stripe.Emptyable<PaymentMethodOptions.Giropay>;

/**
* If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options.
*/
grabpay?: Stripe.Emptyable<PaymentMethodOptions.Grabpay>;

/**
* If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options.
*/
Expand Down Expand Up @@ -3754,8 +3800,12 @@ declare module 'stripe' {

interface CardPresent {}

interface Fpx {}

interface Giropay {}

interface Grabpay {}

interface Ideal {}

interface InteracPresent {}
Expand Down

0 comments on commit ecb3c2f

Please sign in to comment.