From 0cd1aa77f2a14f4446bc6190c908e78244f19c3b Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com> Date: Tue, 2 Aug 2022 15:38:20 -0700 Subject: [PATCH 01/10] Update CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf86495cf2..db3c37dc73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## 10.0.0 - 2022-08-02 -Major version release for API version 2022-08-01. Default API version changed to "2022-08-01". +This release includes breaking changes resulting from: -Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v10. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01. +* Moving to use the new API version "2022-08-01". To learn more about these changes to Stripe products, see https://stripe.com/docs/upgrades#2022-08-01 +* Cleaning up the SDK to remove deprecated/unused APIs and rename classes/methods/properties to sync with product APIs. Read more detailed description at https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v10. "⚠️" symbol highlights breaking changes. From ad1e4f3846cee01829927545a90252102371f477 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Fri, 5 Aug 2022 08:09:53 -0700 Subject: [PATCH 02/10] API Updates (#1503) Codegen for openapi v176 --- OPENAPI_VERSION | 2 +- .../resources/generated_examples_test.spec.js | 51 ------------------- types/2022-08-01/Apps/Secrets.d.ts | 10 ++++ 3 files changed, 11 insertions(+), 52 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 714ead9782..3d5e0744c5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v174 \ No newline at end of file +v176 \ No newline at end of file diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 0c0b414ae9..66d147d35c 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -306,57 +306,6 @@ describe('FinancialConnections.Session', function() { }); }); -describe('Order', function() { - it('create method', async function() { - const order = await stripe.orders.create({ - description: 'description', - currency: 'usd', - line_items: [{description: 'my line item'}], - }); - expect(order).not.to.be.null; - }); - - it('retrieve method', async function() { - const order = await stripe.orders.retrieve('order_xyz'); - expect(order).not.to.be.null; - }); - - it('update method', async function() { - const order = await stripe.orders.update('order_xyz', { - metadata: {reference_number: '123'}, - ip_address: '0.0.0.0', - }); - expect(order).not.to.be.null; - }); - - it('cancel method', async function() { - const order = await stripe.orders.cancel('order_xyz'); - expect(order).not.to.be.null; - }); - - it('listLineItems method', async function() { - const lineItems = await stripe.orders.listLineItems('order_xyz'); - expect(lineItems).not.to.be.null; - }); - - it('reopen method', async function() { - const order = await stripe.orders.reopen('order_xyz'); - expect(order).not.to.be.null; - }); - - it('submit method', async function() { - const order = await stripe.orders.submit('order_xyz', { - expected_total: 100, - }); - expect(order).not.to.be.null; - }); - - it('list method', async function() { - const orders = await stripe.orders.list({limit: 3}); - expect(orders).not.to.be.null; - }); -}); - describe('PaymentIntent', function() { it('create method', async function() { const paymentIntent = await stripe.paymentIntents.create({ diff --git a/types/2022-08-01/Apps/Secrets.d.ts b/types/2022-08-01/Apps/Secrets.d.ts index d274df3c9e..fc04e17226 100644 --- a/types/2022-08-01/Apps/Secrets.d.ts +++ b/types/2022-08-01/Apps/Secrets.d.ts @@ -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. */ @@ -83,6 +88,11 @@ declare module 'stripe' { * Specifies which fields in the response should be expanded. */ expand?: Array; + + /** + * The Unix timestamp for the expiry time of the secret, after which the secret deletes. + */ + expires_at?: number; } namespace SecretCreateParams { From cc0ae34ac5bad2dd7636b3e85113f65e6ed2dd92 Mon Sep 17 00:00:00 2001 From: yejia-stripe <90646909+yejia-stripe@users.noreply.github.com> Date: Tue, 9 Aug 2022 14:07:48 -0400 Subject: [PATCH 03/10] Simplify AddressParam definitions (#1505) r? @pakrym-stripe cc @stripe/api-libraries ## Summary - Rename `AddressParam` to `ShippingAddressParam`: shipping address is the only address that requires `line1` - Rename `AccountAddressParam` to `AddressParam`: `AccountAddressParam` was not referenced - Change instances of `Address extends Omit {line1?: string}` to `AddressParam`, which is the same type, and more concise ## Changelog - 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` --- types/2022-08-01/Accounts.d.ts | 52 +++---------------- types/2022-08-01/Charges.d.ts | 16 +----- types/2022-08-01/Checkout/Sessions.d.ts | 2 +- types/2022-08-01/CustomerSources.d.ts | 8 +-- types/2022-08-01/Customers.d.ts | 16 +----- types/2022-08-01/Invoices.d.ts | 28 ++-------- types/2022-08-01/Orders.d.ts | 32 ++---------- types/2022-08-01/PaymentIntents.d.ts | 48 +++-------------- types/2022-08-01/PaymentMethods.d.ts | 16 +----- types/2022-08-01/Persons.d.ts | 24 ++------- types/2022-08-01/SetupIntents.d.ts | 24 ++------- types/2022-08-01/Sources.d.ts | 20 ++----- types/2022-08-01/Terminal/Locations.d.ts | 8 +-- types/2022-08-01/Terminal/Readers.d.ts | 14 +++++ types/2022-08-01/Tokens.d.ts | 31 ++--------- .../2022-08-01/Treasury/OutboundPayments.d.ts | 8 +-- types/shared.d.ts | 42 +++------------ 17 files changed, 68 insertions(+), 321 deletions(-) diff --git a/types/2022-08-01/Accounts.d.ts b/types/2022-08-01/Accounts.d.ts index b3e52d3427..1d21c0a39d 100644 --- a/types/2022-08-01/Accounts.d.ts +++ b/types/2022-08-01/Accounts.d.ts @@ -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. @@ -1260,12 +1260,6 @@ declare module 'stripe' { url?: string; } - namespace BusinessProfile { - interface SupportAddress extends Omit { - line1?: string; - } - } - type BusinessType = | 'company' | 'government_entity' @@ -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). @@ -1760,10 +1754,6 @@ declare module 'stripe' { } namespace Company { - interface Address extends Omit { - line1?: string; - } - interface OwnershipDeclaration { /** * The Unix timestamp marking when the beneficial owner attestation was made. @@ -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). @@ -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). @@ -2063,10 +2053,6 @@ declare module 'stripe' { } namespace Individual { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -2086,10 +2072,6 @@ declare module 'stripe' { type PoliticalExposure = 'existing' | 'none'; - interface RegisteredAddress extends Omit { - line1?: string; - } - interface Verification { /** * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. @@ -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. @@ -2493,12 +2475,6 @@ declare module 'stripe' { url?: string; } - namespace BusinessProfile { - interface SupportAddress extends Omit { - line1?: string; - } - } - type BusinessType = | 'company' | 'government_entity' @@ -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). @@ -2993,10 +2969,6 @@ declare module 'stripe' { } namespace Company { - interface Address extends Omit { - line1?: string; - } - interface OwnershipDeclaration { /** * The Unix timestamp marking when the beneficial owner attestation was made. @@ -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). @@ -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). @@ -3259,10 +3231,6 @@ declare module 'stripe' { } namespace Individual { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -3282,10 +3250,6 @@ declare module 'stripe' { type PoliticalExposure = 'existing' | 'none'; - interface RegisteredAddress extends Omit { - line1?: string; - } - interface Verification { /** * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. diff --git a/types/2022-08-01/Charges.d.ts b/types/2022-08-01/Charges.d.ts index 226b2d0006..645135cd66 100644 --- a/types/2022-08-01/Charges.d.ts +++ b/types/2022-08-01/Charges.d.ts @@ -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. @@ -1918,12 +1918,6 @@ declare module 'stripe' { tracking_number?: string; } - namespace Shipping { - interface Address extends Omit { - 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. @@ -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. @@ -2024,12 +2018,6 @@ declare module 'stripe' { */ tracking_number?: string; } - - namespace Shipping { - interface Address extends Omit { - line1?: string; - } - } } interface ChargeListParams extends PaginationParams { diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-08-01/Checkout/Sessions.d.ts index 180a348fae..ba56fc52bc 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-08-01/Checkout/Sessions.d.ts @@ -1952,7 +1952,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. diff --git a/types/2022-08-01/CustomerSources.d.ts b/types/2022-08-01/CustomerSources.d.ts index 385e460abf..d0bd884645 100644 --- a/types/2022-08-01/CustomerSources.d.ts +++ b/types/2022-08-01/CustomerSources.d.ts @@ -104,7 +104,7 @@ declare module 'stripe' { /** * Owner's address. */ - address?: Owner.Address; + address?: Stripe.AddressParam; /** * Owner's email address. @@ -121,12 +121,6 @@ declare module 'stripe' { */ phone?: string; } - - namespace Owner { - interface Address extends Omit { - line1?: string; - } - } } interface CustomerSourceListParams extends PaginationParams { diff --git a/types/2022-08-01/Customers.d.ts b/types/2022-08-01/Customers.d.ts index f2b39884c8..c8151a1b52 100644 --- a/types/2022-08-01/Customers.d.ts +++ b/types/2022-08-01/Customers.d.ts @@ -470,7 +470,7 @@ declare module 'stripe' { /** * Customer shipping address. */ - address: Shipping.Address; + address: Stripe.AddressParam; /** * Customer name. @@ -483,12 +483,6 @@ declare module 'stripe' { phone?: string; } - namespace Shipping { - interface Address extends Omit { - 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. @@ -745,7 +739,7 @@ declare module 'stripe' { /** * Customer shipping address. */ - address: Shipping.Address; + address: Stripe.AddressParam; /** * Customer name. @@ -758,12 +752,6 @@ declare module 'stripe' { phone?: string; } - namespace Shipping { - interface Address extends Omit { - 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. diff --git a/types/2022-08-01/Invoices.d.ts b/types/2022-08-01/Invoices.d.ts index 5403d1874a..bf36d26427 100644 --- a/types/2022-08-01/Invoices.d.ts +++ b/types/2022-08-01/Invoices.d.ts @@ -1950,7 +1950,7 @@ declare module 'stripe' { /** * The customer's address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * The customer's shipping information. Appears on invoices emailed to this customer. @@ -1974,15 +1974,11 @@ declare module 'stripe' { } namespace CustomerDetails { - interface Address extends Omit { - line1?: string; - } - interface Shipping { /** * Customer shipping address. */ - address: Shipping.Address; + address: Stripe.AddressParam; /** * Customer name. @@ -1995,12 +1991,6 @@ declare module 'stripe' { phone?: string; } - namespace Shipping { - interface Address extends Omit { - 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. @@ -2508,7 +2498,7 @@ declare module 'stripe' { /** * The customer's address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * The customer's shipping information. Appears on invoices emailed to this customer. @@ -2532,15 +2522,11 @@ declare module 'stripe' { } namespace CustomerDetails { - interface Address extends Omit { - line1?: string; - } - interface Shipping { /** * Customer shipping address. */ - address: Shipping.Address; + address: Stripe.AddressParam; /** * Customer name. @@ -2553,12 +2539,6 @@ declare module 'stripe' { phone?: string; } - namespace Shipping { - interface Address extends Omit { - 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. diff --git a/types/2022-08-01/Orders.d.ts b/types/2022-08-01/Orders.d.ts index 7ea8745bc4..8c36cd00fc 100644 --- a/types/2022-08-01/Orders.d.ts +++ b/types/2022-08-01/Orders.d.ts @@ -977,7 +977,7 @@ declare module 'stripe' { /** * The billing address provided by the customer. */ - address?: BillingDetails.Address; + address?: Stripe.AddressParam; /** * The billing email provided by the customer. @@ -995,12 +995,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Discount { /** * ID of the coupon to create a new discount for. @@ -1946,7 +1940,7 @@ declare module 'stripe' { /** * The shipping address for the order. */ - address: ShippingDetails.Address; + address: Stripe.AddressParam; /** * The name of the recipient of the order. @@ -1959,12 +1953,6 @@ declare module 'stripe' { phone?: string; } - namespace ShippingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface TaxDetails { /** * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. @@ -2135,7 +2123,7 @@ declare module 'stripe' { /** * The billing address provided by the customer. */ - address?: BillingDetails.Address; + address?: Stripe.AddressParam; /** * The billing email provided by the customer. @@ -2153,12 +2141,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Discount { /** * ID of the coupon to create a new discount for. @@ -3113,7 +3095,7 @@ declare module 'stripe' { /** * The shipping address for the order. */ - address: ShippingDetails.Address; + address: Stripe.AddressParam; /** * The name of the recipient of the order. @@ -3126,12 +3108,6 @@ declare module 'stripe' { phone?: string; } - namespace ShippingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface TaxDetails { /** * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. diff --git a/types/2022-08-01/PaymentIntents.d.ts b/types/2022-08-01/PaymentIntents.d.ts index 3e87fc985f..ec91244390 100644 --- a/types/2022-08-01/PaymentIntents.d.ts +++ b/types/2022-08-01/PaymentIntents.d.ts @@ -2171,7 +2171,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -2189,12 +2189,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -3507,7 +3501,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. @@ -3530,12 +3524,6 @@ declare module 'stripe' { tracking_number?: string; } - namespace Shipping { - interface Address extends Omit { - line1?: string; - } - } - interface TransferData { /** * The amount that will be transferred automatically when a charge succeeds. @@ -3895,7 +3883,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -3913,12 +3901,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -5224,7 +5206,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. @@ -5247,12 +5229,6 @@ declare module 'stripe' { tracking_number?: string; } - namespace Shipping { - interface Address extends Omit { - line1?: string; - } - } - interface TransferData { /** * The amount that will be transferred automatically when a charge succeeds. @@ -5754,7 +5730,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -5772,12 +5748,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -7090,7 +7060,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. @@ -7112,12 +7082,6 @@ declare module 'stripe' { */ tracking_number?: string; } - - namespace Shipping { - interface Address extends Omit { - line1?: string; - } - } } interface PaymentIntentIncrementAuthorizationParams { diff --git a/types/2022-08-01/PaymentMethods.d.ts b/types/2022-08-01/PaymentMethods.d.ts index 03832d780a..0022efe622 100644 --- a/types/2022-08-01/PaymentMethods.d.ts +++ b/types/2022-08-01/PaymentMethods.d.ts @@ -1008,7 +1008,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -1026,12 +1026,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -1420,7 +1414,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -1438,12 +1432,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Card { diff --git a/types/2022-08-01/Persons.d.ts b/types/2022-08-01/Persons.d.ts index 6fdaacd200..122c1b3eff 100644 --- a/types/2022-08-01/Persons.d.ts +++ b/types/2022-08-01/Persons.d.ts @@ -591,7 +591,7 @@ declare module 'stripe' { /** * The person's address. */ - address?: PersonCreateParams.Address; + address?: Stripe.AddressParam; /** * The Kana variation of the person's address (Japan only). @@ -706,7 +706,7 @@ declare module 'stripe' { /** * The person's registered address. */ - registered_address?: PersonCreateParams.RegisteredAddress; + registered_address?: Stripe.AddressParam; /** * The relationship that this person has with the account's legal entity. @@ -725,10 +725,6 @@ declare module 'stripe' { } namespace PersonCreateParams { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -786,10 +782,6 @@ declare module 'stripe' { } } - interface RegisteredAddress extends Omit { - line1?: string; - } - interface Relationship { /** * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. @@ -872,7 +864,7 @@ declare module 'stripe' { /** * The person's address. */ - address?: PersonUpdateParams.Address; + address?: Stripe.AddressParam; /** * The Kana variation of the person's address (Japan only). @@ -987,7 +979,7 @@ declare module 'stripe' { /** * The person's registered address. */ - registered_address?: PersonUpdateParams.RegisteredAddress; + registered_address?: Stripe.AddressParam; /** * The relationship that this person has with the account's legal entity. @@ -1006,10 +998,6 @@ declare module 'stripe' { } namespace PersonUpdateParams { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -1067,10 +1055,6 @@ declare module 'stripe' { } } - interface RegisteredAddress extends Omit { - line1?: string; - } - interface Relationship { /** * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/types/2022-08-01/SetupIntents.d.ts b/types/2022-08-01/SetupIntents.d.ts index 086febcce5..40d5a4eeed 100644 --- a/types/2022-08-01/SetupIntents.d.ts +++ b/types/2022-08-01/SetupIntents.d.ts @@ -916,7 +916,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -934,12 +934,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -1771,7 +1765,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -1789,12 +1783,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { @@ -2708,7 +2696,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -2726,12 +2714,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - interface Blik {} interface Boleto { diff --git a/types/2022-08-01/Sources.d.ts b/types/2022-08-01/Sources.d.ts index dfc541b042..20864d8718 100644 --- a/types/2022-08-01/Sources.d.ts +++ b/types/2022-08-01/Sources.d.ts @@ -915,7 +915,7 @@ declare module 'stripe' { /** * Owner's address. */ - address?: Owner.Address; + address?: Stripe.AddressParam; /** * Owner's email address. @@ -933,12 +933,6 @@ declare module 'stripe' { phone?: string; } - namespace Owner { - interface Address extends Omit { - line1?: string; - } - } - interface Receiver { /** * The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. @@ -998,7 +992,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. @@ -1179,7 +1173,7 @@ declare module 'stripe' { /** * Owner's address. */ - address?: Owner.Address; + address?: Stripe.AddressParam; /** * Owner's email address. @@ -1197,12 +1191,6 @@ declare module 'stripe' { phone?: string; } - namespace Owner { - interface Address extends Omit { - line1?: string; - } - } - interface SourceOrder { /** * List of items constituting the order. @@ -1244,7 +1232,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. diff --git a/types/2022-08-01/Terminal/Locations.d.ts b/types/2022-08-01/Terminal/Locations.d.ts index e3b3dcd5de..41a2daae37 100644 --- a/types/2022-08-01/Terminal/Locations.d.ts +++ b/types/2022-08-01/Terminal/Locations.d.ts @@ -134,7 +134,7 @@ declare module 'stripe' { /** * The full address of the location. */ - address?: LocationUpdateParams.Address; + address?: Stripe.AddressParam; /** * The ID of a configuration that will be used to customize all readers in this location. @@ -157,12 +157,6 @@ declare module 'stripe' { metadata?: Stripe.Emptyable; } - namespace LocationUpdateParams { - interface Address extends Omit { - line1?: string; - } - } - interface LocationListParams extends PaginationParams { /** * Specifies which fields in the response should be expanded. diff --git a/types/2022-08-01/Terminal/Readers.d.ts b/types/2022-08-01/Terminal/Readers.d.ts index f33c841438..d17c0355cd 100644 --- a/types/2022-08-01/Terminal/Readers.d.ts +++ b/types/2022-08-01/Terminal/Readers.d.ts @@ -114,6 +114,20 @@ declare module 'stripe' { * Most recent PaymentIntent processed by the reader. */ payment_intent: string | Stripe.PaymentIntent; + + /** + * Represents a per-transaction override of a reader configuration + */ + process_config?: ProcessPaymentIntent.ProcessConfig; + } + + namespace ProcessPaymentIntent { + interface ProcessConfig { + /** + * Override showing a tipping selection screen on this transaction. + */ + skip_tipping?: boolean; + } } interface ProcessSetupIntent { diff --git a/types/2022-08-01/Tokens.d.ts b/types/2022-08-01/Tokens.d.ts index 3069d1b496..1592dcdaef 100644 --- a/types/2022-08-01/Tokens.d.ts +++ b/types/2022-08-01/Tokens.d.ts @@ -135,7 +135,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). @@ -224,10 +224,6 @@ declare module 'stripe' { } namespace Company { - interface Address extends Omit { - line1?: string; - } - interface OwnershipDeclaration { /** * The Unix timestamp marking when the beneficial owner attestation was made. @@ -293,7 +289,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). @@ -388,7 +384,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). @@ -402,10 +398,6 @@ declare module 'stripe' { } namespace Individual { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -425,11 +417,6 @@ declare module 'stripe' { type PoliticalExposure = 'existing' | 'none'; - interface RegisteredAddress - extends Omit { - line1?: string; - } - interface Verification { /** * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. @@ -550,7 +537,7 @@ declare module 'stripe' { /** * The person's address. */ - address?: Person.Address; + address?: Stripe.AddressParam; /** * The Kana variation of the person's address (Japan only). @@ -655,7 +642,7 @@ declare module 'stripe' { /** * The person's registered address. */ - registered_address?: Person.RegisteredAddress; + registered_address?: Stripe.AddressParam; /** * The relationship that this person has with the account's legal entity. @@ -674,10 +661,6 @@ declare module 'stripe' { } namespace Person { - interface Address extends Omit { - line1?: string; - } - interface Dob { /** * The day of birth, between 1 and 31. @@ -735,10 +718,6 @@ declare module 'stripe' { } } - interface RegisteredAddress extends Omit { - line1?: string; - } - interface Relationship { /** * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. diff --git a/types/2022-08-01/Treasury/OutboundPayments.d.ts b/types/2022-08-01/Treasury/OutboundPayments.d.ts index dfb154d496..43782fa09d 100644 --- a/types/2022-08-01/Treasury/OutboundPayments.d.ts +++ b/types/2022-08-01/Treasury/OutboundPayments.d.ts @@ -362,7 +362,7 @@ declare module 'stripe' { /** * Billing address. */ - address?: Stripe.Emptyable; + address?: Stripe.Emptyable; /** * Email address. @@ -380,12 +380,6 @@ declare module 'stripe' { phone?: string; } - namespace BillingDetails { - interface Address extends Omit { - line1?: string; - } - } - type Type = 'financial_account' | 'us_bank_account'; interface UsBankAccount { diff --git a/types/shared.d.ts b/types/shared.d.ts index 1a9e47de82..2863f08495 100644 --- a/types/shared.d.ts +++ b/types/shared.d.ts @@ -87,9 +87,9 @@ declare module 'stripe' { town: string | null; } - interface AccountAddressParam { + interface AddressParam { /** - * City, district, suburb, town, or village. + * City, district, suburb, town, village, or ward. */ city?: string; @@ -99,7 +99,7 @@ declare module 'stripe' { country?: string; /** - * Address line 1 (e.g., street, PO Box, or company name). + * Address line 1 (e.g., street, block, PO Box, or company name). */ line1?: string; @@ -114,49 +114,19 @@ declare module 'stripe' { postal_code?: string; /** - * State, county, province, or region. + * State, county, province, prefecture, or region. */ state?: string; } - interface AddressParam extends AccountAddressParam { + interface ShippingAddressParam extends AddressParam { /** * Address line 1 (e.g., street, PO Box, or company name). */ line1: string; } - interface JapanAddressParam { - /** - * City or ward. - */ - city?: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country?: string; - - /** - * Block or building number. - */ - line1?: string; - - /** - * Building details. - */ - line2?: string; - - /** - * Postal code. - */ - postal_code?: string; - - /** - * Prefecture. - */ - state?: string; - + interface JapanAddressParam extends AddressParam { /** * Town or cho-me. */ From f6863f5832333aa582ef8dc8db540096965e204f Mon Sep 17 00:00:00 2001 From: yejia-stripe <90646909+yejia-stripe@users.noreply.github.com> Date: Tue, 9 Aug 2022 15:15:28 -0400 Subject: [PATCH 04/10] API Updates (#1506) Update openapi version --- OPENAPI_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3d5e0744c5..f0478776cd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v176 \ No newline at end of file +v177 \ No newline at end of file From 0dee83476e6d51cae0b9e42d6238da674bbc579c Mon Sep 17 00:00:00 2001 From: Yejia Chen Date: Tue, 9 Aug 2022 15:26:48 -0400 Subject: [PATCH 05/10] Bump version to 10.1.0 --- CHANGELOG.md | 9 +++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db3c37dc73..803565adf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 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.0.0 - 2022-08-02 This release includes breaking changes resulting from: diff --git a/VERSION b/VERSION index a13e7b9c87..4149c39eec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.0 +10.1.0 diff --git a/package.json b/package.json index 897b3e6b29..032fe6be99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.0.0", + "version": "10.1.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From a8b941d375f7532a73e40ffe7c20b68bfa1e4ae8 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 11 Aug 2022 11:42:22 -0700 Subject: [PATCH 06/10] Codegen for openapi v178 --- OPENAPI_VERSION | 2 +- types/2022-08-01/Checkout/Sessions.d.ts | 19 ++++++++++++++++ types/2022-08-01/PaymentLinks.d.ts | 29 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f0478776cd..fe5aa3c019 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v177 \ No newline at end of file +v178 \ No newline at end of file diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-08-01/Checkout/Sessions.d.ts index ba56fc52bc..1b5a0479b2 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-08-01/Checkout/Sessions.d.ts @@ -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. */ @@ -450,6 +455,8 @@ declare module 'stripe' { type Mode = 'payment' | 'setup' | 'subscription'; + type PaymentMethodCollection = 'always' | 'if_required'; + interface PaymentMethodOptions { acss_debit?: PaymentMethodOptions.AcssDebit; @@ -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. */ @@ -1991,6 +2008,8 @@ declare module 'stripe' { } } + type PaymentMethodCollection = 'always' | 'if_required'; + interface PaymentMethodOptions { /** * contains details about the ACSS Debit payment method options. diff --git a/types/2022-08-01/PaymentLinks.d.ts b/types/2022-08-01/PaymentLinks.d.ts index 5a850b029c..29b530cb6a 100644 --- a/types/2022-08-01/PaymentLinks.d.ts +++ b/types/2022-08-01/PaymentLinks.d.ts @@ -80,6 +80,11 @@ declare module 'stripe' { */ payment_intent_data: PaymentLink.PaymentIntentData | null; + /** + * Configuration for collecting a payment method during checkout. + */ + payment_method_collection: PaymentLink.PaymentMethodCollection; + /** * 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). */ @@ -190,6 +195,8 @@ declare module 'stripe' { type SetupFutureUsage = 'off_session' | 'on_session'; } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay' @@ -583,6 +590,15 @@ declare module 'stripe' { */ payment_intent_data?: PaymentLinkCreateParams.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?: PaymentLinkCreateParams.PaymentMethodCollection; + /** * The list of payment method types that customers can use. 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)). */ @@ -750,6 +766,8 @@ declare module 'stripe' { type SetupFutureUsage = 'off_session' | 'on_session'; } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay' @@ -1124,6 +1142,15 @@ declare module 'stripe' { */ metadata?: Stripe.MetadataParam; + /** + * 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?: PaymentLinkUpdateParams.PaymentMethodCollection; + /** * The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). */ @@ -1222,6 +1249,8 @@ declare module 'stripe' { } } + type PaymentMethodCollection = 'always' | 'if_required'; + type PaymentMethodType = | 'affirm' | 'afterpay_clearpay' From 8e22df2d715123fe377494ae1a1f9ec6e388a3ac Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 11 Aug 2022 14:32:54 -0700 Subject: [PATCH 07/10] Bump version to 10.2.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 803565adf4..99ca7bd20b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 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` diff --git a/VERSION b/VERSION index 4149c39eec..2bd6f7e392 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.1.0 +10.2.0 diff --git a/package.json b/package.json index 032fe6be99..e21d61e7ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.1.0", + "version": "10.2.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 8d87410db7cb23c993790359f7098b3e57eee425 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 11 Aug 2022 14:49:42 -0700 Subject: [PATCH 08/10] Set version to 10.2.0 to simplify merge --- VERSION | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 73295a539d..2bd6f7e392 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.1.0-beta.1 +10.2.0 diff --git a/package.json b/package.json index db1b481258..e21d61e7ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.1.0-beta.1", + "version": "10.2.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 860f3c43d982da7aa9516a976b7813121af5e439 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 11 Aug 2022 14:49:43 -0700 Subject: [PATCH 09/10] Reset version to 10.1.0-beta.1 --- VERSION | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2bd6f7e392..73295a539d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.2.0 +10.1.0-beta.1 diff --git a/package.json b/package.json index e21d61e7ea..db1b481258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.2.0", + "version": "10.1.0-beta.1", "description": "Stripe API wrapper", "keywords": [ "stripe", From 7cdfef5338209f9f90e27fcb4adda204440e8c1c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 11 Aug 2022 14:50:16 -0700 Subject: [PATCH 10/10] Codegen for openapi v178 --- OPENAPI_VERSION | 2 +- lib/apiVersion.js | 3 +- lib/resources/Terminal/Readers.js | 5 + .../resources/generated_examples_test.spec.js | 51 ++++++++++ types/2022-08-01/SubscriptionItems.d.ts | 7 +- types/2022-08-01/SubscriptionSchedules.d.ts | 26 +++++- types/2022-08-01/Subscriptions.d.ts | 3 + types/2022-08-01/Terminal/Readers.d.ts | 92 +++++++++++++++++++ .../TestHelpers/Terminal/Readers.d.ts | 16 +++- 9 files changed, 196 insertions(+), 9 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9b1d84c43d..fe5aa3c019 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v175 \ No newline at end of file +v178 \ No newline at end of file diff --git a/lib/apiVersion.js b/lib/apiVersion.js index f8b1fad901..d68367c30f 100644 --- a/lib/apiVersion.js +++ b/lib/apiVersion.js @@ -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', }; diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index 05a8a53ef5..eb905a4053 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -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', diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 66d147d35c..0c0b414ae9 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -306,6 +306,57 @@ describe('FinancialConnections.Session', function() { }); }); +describe('Order', function() { + it('create method', async function() { + const order = await stripe.orders.create({ + description: 'description', + currency: 'usd', + line_items: [{description: 'my line item'}], + }); + expect(order).not.to.be.null; + }); + + it('retrieve method', async function() { + const order = await stripe.orders.retrieve('order_xyz'); + expect(order).not.to.be.null; + }); + + it('update method', async function() { + const order = await stripe.orders.update('order_xyz', { + metadata: {reference_number: '123'}, + ip_address: '0.0.0.0', + }); + expect(order).not.to.be.null; + }); + + it('cancel method', async function() { + const order = await stripe.orders.cancel('order_xyz'); + expect(order).not.to.be.null; + }); + + it('listLineItems method', async function() { + const lineItems = await stripe.orders.listLineItems('order_xyz'); + expect(lineItems).not.to.be.null; + }); + + it('reopen method', async function() { + const order = await stripe.orders.reopen('order_xyz'); + expect(order).not.to.be.null; + }); + + it('submit method', async function() { + const order = await stripe.orders.submit('order_xyz', { + expected_total: 100, + }); + expect(order).not.to.be.null; + }); + + it('list method', async function() { + const orders = await stripe.orders.list({limit: 3}); + expect(orders).not.to.be.null; + }); +}); + describe('PaymentIntent', function() { it('create method', async function() { const paymentIntent = await stripe.paymentIntents.create({ diff --git a/types/2022-08-01/SubscriptionItems.d.ts b/types/2022-08-01/SubscriptionItems.d.ts index 5776cf793b..726ce7ef42 100644 --- a/types/2022-08-01/SubscriptionItems.d.ts +++ b/types/2022-08-01/SubscriptionItems.d.ts @@ -76,7 +76,7 @@ declare module 'stripe' { tax_rates: Array | null; /** - * Current trial configuration on this item. + * Options that configure the trial on the subscription item. */ trial?: SubscriptionItem.Trial | null; } @@ -195,7 +195,7 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * Define options to configure the trial on the subscription. + * Options that configure the trial on the subscription item. */ trial?: SubscriptionItemCreateParams.Trial; } @@ -281,6 +281,9 @@ declare module 'stripe' { type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } diff --git a/types/2022-08-01/SubscriptionSchedules.d.ts b/types/2022-08-01/SubscriptionSchedules.d.ts index 2225c4b556..1fda16c4b4 100644 --- a/types/2022-08-01/SubscriptionSchedules.d.ts +++ b/types/2022-08-01/SubscriptionSchedules.d.ts @@ -423,7 +423,7 @@ declare module 'stripe' { tax_rates?: Array | null; /** - * Current trial configuration on this item. + * Options that configure the trial on the subscription item. */ trial?: Item.Trial | null; } @@ -911,7 +911,7 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * Settings for trials + * Options that configure the trial on the subscription item. */ trial?: Item.Trial; } @@ -989,6 +989,9 @@ declare module 'stripe' { } interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } @@ -1436,7 +1439,7 @@ declare module 'stripe' { tax_rates?: Stripe.Emptyable>; /** - * Settings for trials + * Options that configure the trial on the subscription item. */ trial?: Item.Trial; } @@ -1514,6 +1517,9 @@ declare module 'stripe' { } interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } @@ -1739,6 +1745,9 @@ declare module 'stripe' { */ set?: DiscountAction.Set; + /** + * Determines the type of discount action. + */ type: DiscountAction.Type; } @@ -1803,6 +1812,9 @@ declare module 'stripe' { */ set?: ItemAction.Set; + /** + * Determines the type of item action. + */ type: ItemAction.Type; } @@ -1834,7 +1846,7 @@ declare module 'stripe' { tax_rates?: Array; /** - * Current trial configuration on this item. + * Options that configure the trial on the subscription item. */ trial?: Add.Trial; } @@ -1853,6 +1865,9 @@ declare module 'stripe' { } interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } @@ -1914,6 +1929,9 @@ declare module 'stripe' { } interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } diff --git a/types/2022-08-01/Subscriptions.d.ts b/types/2022-08-01/Subscriptions.d.ts index 0357282baf..bfa8d170fa 100644 --- a/types/2022-08-01/Subscriptions.d.ts +++ b/types/2022-08-01/Subscriptions.d.ts @@ -956,6 +956,9 @@ declare module 'stripe' { } interface Trial { + /** + * Determines the type of trial for this item. + */ type: Trial.Type; } diff --git a/types/2022-08-01/Terminal/Readers.d.ts b/types/2022-08-01/Terminal/Readers.d.ts index d17c0355cd..988e51af5d 100644 --- a/types/2022-08-01/Terminal/Readers.d.ts +++ b/types/2022-08-01/Terminal/Readers.d.ts @@ -92,6 +92,11 @@ declare module 'stripe' { */ process_setup_intent?: Action.ProcessSetupIntent; + /** + * Represents a reader action to refund a payment + */ + refund_payment?: Action.RefundPayment; + /** * Represents a reader action to set the reader display */ @@ -139,6 +144,47 @@ declare module 'stripe' { setup_intent: string | Stripe.SetupIntent; } + interface RefundPayment { + /** + * The amount being refunded. + */ + amount?: number; + + /** + * Charge that is being refunded. + */ + charge?: string | Stripe.Charge; + + /** + * Payment intent that is being refunded. + */ + payment_intent?: string | Stripe.PaymentIntent; + + /** + * The reason for the refund. + */ + reason?: RefundPayment.Reason; + + /** + * Unique identifier for the refund object. + */ + refund?: string | Stripe.Refund; + + /** + * Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + */ + refund_application_fee?: boolean; + + /** + * Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + */ + reverse_transfer?: boolean; + } + + namespace RefundPayment { + type Reason = 'duplicate' | 'fraudulent' | 'requested_by_customer'; + } + interface SetReaderDisplay { /** * Cart object to be displayed by the reader. @@ -199,6 +245,7 @@ declare module 'stripe' { type Type = | 'process_payment_intent' | 'process_setup_intent' + | 'refund_payment' | 'set_reader_display'; } @@ -368,6 +415,38 @@ declare module 'stripe' { expand?: Array; } + interface ReaderRefundPaymentParams { + /** + * A positive integer in __cents__ representing how much of this charge to refund. + */ + amount?: number; + + /** + * ID of the Charge to refund. + */ + charge?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * ID of the PaymentIntent to refund. + */ + payment_intent?: string; + + /** + * Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + */ + refund_application_fee?: boolean; + + /** + * Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + */ + reverse_transfer?: boolean; + } + interface ReaderSetReaderDisplayParams { /** * Type @@ -524,6 +603,19 @@ declare module 'stripe' { options?: RequestOptions ): Promise>; + /** + * Initiates a refund on a Reader + */ + refundPayment( + id: string, + params?: ReaderRefundPaymentParams, + options?: RequestOptions + ): Promise>; + refundPayment( + id: string, + options?: RequestOptions + ): Promise>; + /** * Sets reader display to show cart details. */ diff --git a/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts b/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts index dc76395376..0205ef2a6b 100644 --- a/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts +++ b/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts @@ -15,10 +15,15 @@ declare module 'stripe' { */ expand?: Array; + /** + * Simulated data for the interac_present payment method + */ + interac_present?: ReaderPresentPaymentMethodParams.InteracPresent; + /** * Simulated payment type */ - type?: 'card_present'; + type?: ReaderPresentPaymentMethodParams.Type; } namespace ReaderPresentPaymentMethodParams { @@ -28,6 +33,15 @@ declare module 'stripe' { */ number?: string; } + + interface InteracPresent { + /** + * Card Number + */ + number?: string; + } + + type Type = 'card_present' | 'interac_present'; } }