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 for beta branch #1511

Merged
merged 12 commits into from
Aug 11, 2022
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 10.2.0 - 2022-08-11
* [#1510](https://github.com/stripe/stripe-node/pull/1510) API Updates
* Add support for `payment_method_collection` on `Checkout.Session`, `CheckoutSessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`

## 10.1.0 - 2022-08-09
* [#1506](https://github.com/stripe/stripe-node/pull/1506) API Updates
* Add support for `process_config` on `Terminal.Reader.action.process_payment_intent`
* [#1505](https://github.com/stripe/stripe-node/pull/1505) Simplify AddressParam definitions
- Rename `AddressParam` to `ShippingAddressParam`, and change type of `Source.source_order.shipping.address`, `SourceUpdateParams.SourceOrder.Shipping.address`, and `SessionCreateParams.PaymentIntentData.Shipping.address` to `ShippingAddressParam`
- Rename `AccountAddressParam` go `AddressParam`, and change type of `AccountCreateParams.BusinessProfile.support_address`, `AccountCreateParams.Company.address`, `AccountCreateParams.Individual.address `, `AccountCreateParams.Individual.registered_address`, `AccountUpdateParams.BusinessProfile.support_address`, `AccountUpdateParams.Company.address`, `AccountUpdateParams.Individual.address`, `AccountUpdateParams.Individual.registered_address`, `ChargeCreateParams.Shipping.address`, `ChargeUpdateParams.Shipping.address`, `CustomerCreateParams.Shipping.address`, `CustomerUpdateParams.Shipping.address`, `CustomerSourceUpdateParams.Owner.address`, `InvoiceListUpcomingLinesParams.CustomerDetails.Shipping.address`, `InvoiceRetrieveUpcomingParams.CustomerDetails.Shipping.address`, `OrderCreateParams.BillingDetails.address`, `OrderCreateParams.ShippingDetails.address`, `OrderUpdateParams.BillingDetails.address`, `OrderUpdateParams.ShippingDetails.address`, `PaymentIntentCreateParams.Shipping.address`, `PaymentIntentUpdateParams.Shipping.address`, `PaymentIntentConfirmParams.Shipping.address`, `PersonCreateParams.address`, `PersonCreateParams.registered_address`, `PersonUpdateParams.address`, `PersonUpdateParams.registered_address`, `SourceCreateParams.Owner.address`, `SourceUpdateParams.Owner.address`, `TokenCreateParams.Account.Company.address`, `TokenCreateParams.Account.Individual.address`, `TokenCreateParams.Account.Individual.registered_address`, `TokenCreateParams.Person.address`, `TokenCreateParams.Person.registered_address`, and `Terminal.LocationUpdateParams.address` to `AddressParam`
* [#1503](https://github.com/stripe/stripe-node/pull/1503) API Updates
* Add support for `expires_at` on `Apps.Secret` and `AppsSecretCreateParams`

## 10.1.0-beta.1 - 2022-08-03
* [#1498](https://github.com/stripe/stripe-node/pull/1498) API Updates for beta branch
- Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v175
v178
3 changes: 2 additions & 1 deletion lib/apiVersion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File generated from our OpenAPI spec

module.exports = {
ApiVersion: '2022-08-01; server_side_confirmation_beta=v1; orders_beta=v4',
ApiVersion:
'2022-08-01; server_side_confirmation_beta=v1; orders_beta=v4; terminal_interac_refunds_beta=v1',
};
5 changes: 5 additions & 0 deletions lib/resources/Terminal/Readers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ module.exports = StripeResource.extend({
path: '/{reader}/process_setup_intent',
}),

refundPayment: stripeMethod({
method: 'POST',
path: '/{reader}/refund_payment',
}),

setReaderDisplay: stripeMethod({
method: 'POST',
path: '/{reader}/set_reader_display',
Expand Down
52 changes: 8 additions & 44 deletions types/2022-08-01/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ declare module 'stripe' {
/**
* A publicly available mailing address for sending support issues to.
*/
support_address?: BusinessProfile.SupportAddress;
support_address?: Stripe.AddressParam;

/**
* A publicly available email address for sending support issues to.
Expand All @@ -1260,12 +1260,6 @@ declare module 'stripe' {
url?: string;
}

namespace BusinessProfile {
interface SupportAddress extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}

type BusinessType =
| 'company'
| 'government_entity'
Expand Down Expand Up @@ -1676,7 +1670,7 @@ declare module 'stripe' {
/**
* The company's primary address.
*/
address?: Company.Address;
address?: Stripe.AddressParam;

/**
* The Kana variation of the company's primary address (Japan only).
Expand Down Expand Up @@ -1760,10 +1754,6 @@ declare module 'stripe' {
}

namespace Company {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface OwnershipDeclaration {
/**
* The Unix timestamp marking when the beneficial owner attestation was made.
Expand Down Expand Up @@ -1954,7 +1944,7 @@ declare module 'stripe' {
/**
* The individual's primary address.
*/
address?: Individual.Address;
address?: Stripe.AddressParam;

/**
* The Kana variation of the the individual's primary address (Japan only).
Expand Down Expand Up @@ -2049,7 +2039,7 @@ declare module 'stripe' {
/**
* The individual's registered address.
*/
registered_address?: Individual.RegisteredAddress;
registered_address?: Stripe.AddressParam;

/**
* The last four digits of the individual's Social Security Number (U.S. only).
Expand All @@ -2063,10 +2053,6 @@ declare module 'stripe' {
}

namespace Individual {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface Dob {
/**
* The day of birth, between 1 and 31.
Expand All @@ -2086,10 +2072,6 @@ declare module 'stripe' {

type PoliticalExposure = 'existing' | 'none';

interface RegisteredAddress extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
Expand Down Expand Up @@ -2470,7 +2452,7 @@ declare module 'stripe' {
/**
* A publicly available mailing address for sending support issues to.
*/
support_address?: BusinessProfile.SupportAddress;
support_address?: Stripe.AddressParam;

/**
* A publicly available email address for sending support issues to.
Expand All @@ -2493,12 +2475,6 @@ declare module 'stripe' {
url?: string;
}

namespace BusinessProfile {
interface SupportAddress extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}

type BusinessType =
| 'company'
| 'government_entity'
Expand Down Expand Up @@ -2909,7 +2885,7 @@ declare module 'stripe' {
/**
* The company's primary address.
*/
address?: Company.Address;
address?: Stripe.AddressParam;

/**
* The Kana variation of the company's primary address (Japan only).
Expand Down Expand Up @@ -2993,10 +2969,6 @@ declare module 'stripe' {
}

namespace Company {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface OwnershipDeclaration {
/**
* The Unix timestamp marking when the beneficial owner attestation was made.
Expand Down Expand Up @@ -3150,7 +3122,7 @@ declare module 'stripe' {
/**
* The individual's primary address.
*/
address?: Individual.Address;
address?: Stripe.AddressParam;

/**
* The Kana variation of the the individual's primary address (Japan only).
Expand Down Expand Up @@ -3245,7 +3217,7 @@ declare module 'stripe' {
/**
* The individual's registered address.
*/
registered_address?: Individual.RegisteredAddress;
registered_address?: Stripe.AddressParam;

/**
* The last four digits of the individual's Social Security Number (U.S. only).
Expand All @@ -3259,10 +3231,6 @@ declare module 'stripe' {
}

namespace Individual {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface Dob {
/**
* The day of birth, between 1 and 31.
Expand All @@ -3282,10 +3250,6 @@ declare module 'stripe' {

type PoliticalExposure = 'existing' | 'none';

interface RegisteredAddress extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}

interface Verification {
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
Expand Down
10 changes: 10 additions & 0 deletions types/2022-08-01/Apps/Secrets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ declare module 'stripe' {
*/
deleted?: boolean;

/**
* The Unix timestamp for the expiry time of the secret, after which the secret deletes.
*/
expires_at: number | null;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand Down Expand Up @@ -83,6 +88,11 @@ declare module 'stripe' {
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

/**
* The Unix timestamp for the expiry time of the secret, after which the secret deletes.
*/
expires_at?: number;
}

namespace SecretCreateParams {
Expand Down
16 changes: 2 additions & 14 deletions types/2022-08-01/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ declare module 'stripe' {
/**
* Shipping address.
*/
address: Shipping.Address;
address: Stripe.AddressParam;

/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
Expand All @@ -1918,12 +1918,6 @@ declare module 'stripe' {
tracking_number?: string;
}

namespace Shipping {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}

interface TransferData {
/**
* The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account.
Expand Down Expand Up @@ -2002,7 +1996,7 @@ declare module 'stripe' {
/**
* Shipping address.
*/
address: Shipping.Address;
address: Stripe.AddressParam;

/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
Expand All @@ -2024,12 +2018,6 @@ declare module 'stripe' {
*/
tracking_number?: string;
}

namespace Shipping {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}
}

interface ChargeListParams extends PaginationParams {
Expand Down
21 changes: 20 additions & 1 deletion types/2022-08-01/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ declare module 'stripe' {
*/
payment_link: string | Stripe.PaymentLink | null;

/**
* Configure whether a Checkout Session should collect a payment method.
*/
payment_method_collection: Session.PaymentMethodCollection | null;

/**
* Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
*/
Expand Down Expand Up @@ -450,6 +455,8 @@ declare module 'stripe' {

type Mode = 'payment' | 'setup' | 'subscription';

type PaymentMethodCollection = 'always' | 'if_required';

interface PaymentMethodOptions {
acss_debit?: PaymentMethodOptions.AcssDebit;

Expand Down Expand Up @@ -1498,6 +1505,16 @@ declare module 'stripe' {
*/
payment_intent_data?: SessionCreateParams.PaymentIntentData;

/**
* Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.
* This may occur if the Checkout Session includes a free trial or a discount.
*
* Can only be set in `subscription` mode.
*
* If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).
*/
payment_method_collection?: SessionCreateParams.PaymentMethodCollection;

/**
* Payment-method-specific configuration.
*/
Expand Down Expand Up @@ -1952,7 +1969,7 @@ declare module 'stripe' {
/**
* Shipping address.
*/
address: Stripe.AddressParam;
address: Stripe.ShippingAddressParam;

/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
Expand Down Expand Up @@ -1991,6 +2008,8 @@ declare module 'stripe' {
}
}

type PaymentMethodCollection = 'always' | 'if_required';

interface PaymentMethodOptions {
/**
* contains details about the ACSS Debit payment method options.
Expand Down
8 changes: 1 addition & 7 deletions types/2022-08-01/CustomerSources.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ declare module 'stripe' {
/**
* Owner's address.
*/
address?: Owner.Address;
address?: Stripe.AddressParam;

/**
* Owner's email address.
Expand All @@ -121,12 +121,6 @@ declare module 'stripe' {
*/
phone?: string;
}

namespace Owner {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}
}

interface CustomerSourceListParams extends PaginationParams {
Expand Down
16 changes: 2 additions & 14 deletions types/2022-08-01/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ declare module 'stripe' {
/**
* Customer shipping address.
*/
address: Shipping.Address;
address: Stripe.AddressParam;

/**
* Customer name.
Expand All @@ -483,12 +483,6 @@ declare module 'stripe' {
phone?: string;
}

namespace Shipping {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}

interface Tax {
/**
* A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
Expand Down Expand Up @@ -745,7 +739,7 @@ declare module 'stripe' {
/**
* Customer shipping address.
*/
address: Shipping.Address;
address: Stripe.AddressParam;

/**
* Customer name.
Expand All @@ -758,12 +752,6 @@ declare module 'stripe' {
phone?: string;
}

namespace Shipping {
interface Address extends Omit<Stripe.AddressParam, 'line1'> {
line1?: string;
}
}

interface Tax {
/**
* A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
Expand Down
Loading