Skip to content

Commit

Permalink
Merge 5d8d519 into faf0ea7
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed May 8, 2024
2 parents faf0ea7 + 5d8d519 commit 0c0339c
Show file tree
Hide file tree
Showing 23 changed files with 315 additions and 21 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
* Change `GiftCards.Card.code` and `GiftCards.Card.transactions` to be optional
* Change `Tax.Calculation.ship_from_details` and `Tax.Transaction.ship_from_details` to be required

## 15.5.0 - 2024-05-02
* [#2072](https://github.com/stripe/stripe-node/pull/2072) Update generated code
* Add support for new value `shipping_address_invalid` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
* Fix properties incorrectly marked as required in the OpenAPI spec.
* Change `Apps.Secret.payload`, `BillingPortal.Configuration.features.subscription_update.products`, `Charge.refunds`, `ConfirmationToken.payment_method_preview.klarna.dob`, `Identity.VerificationReport.document.dob`, `Identity.VerificationReport.document.expiration_date`, `Identity.VerificationReport.document.number`, `Identity.VerificationReport.id_number.dob`, `Identity.VerificationReport.id_number.id_number`, `Identity.VerificationSession.provided_details`, `Identity.VerificationSession.verified_outputs.dob`, `Identity.VerificationSession.verified_outputs.id_number`, `Identity.VerificationSession.verified_outputs`, `Issuing.Dispute.balance_transactions`, `Issuing.Transaction.purchase_details`, `PaymentMethod.klarna.dob`, `Tax.Calculation.line_items`, `Tax.CalculationLineItem.tax_breakdown`, `Tax.Transaction.line_items`, `Treasury.FinancialAccount.financial_addresses[].aba.account_number`, `Treasury.ReceivedCredit.linked_flows.source_flow_details`, `Treasury.Transaction.entries`, `Treasury.Transaction.flow_details`, and `Treasury.TransactionEntry.flow_details` to be optional
* Add support for `paypal` on `Dispute.payment_method_details`
* Change type of `Dispute.payment_method_details.type` from `literal('card')` to `enum('card'|'paypal')`
* Change type of `Entitlements.FeatureUpdateParams.metadata` from `map(string: string)` to `emptyable(map(string: string))`
* Add support for `payment_method_types` on `PaymentIntentConfirmParams`
* Add support for `ship_from_details` on `Tax.CalculationCreateParams`, `Tax.Calculation`, and `Tax.Transaction`
* Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, and `om` on `Tax.Registration.country_options` and `Tax.RegistrationCreateParams.country_options`
* [#2077](https://github.com/stripe/stripe-node/pull/2077) Deprecate Node methods and params based on OpenAPI spec
- Mark as deprecated the `approve` and `decline` methods on `Issuing.Authorization`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
- Mark as deprecated the `persistent_token` property on `ConfirmationToken.PaymentMethodPreview.Link`, `PaymentIntent.PaymentMethodOptions.Link`, `PaymentIntentResource.PaymentMethodOptions.Link`, `PaymentMethod.Link.persistent_token`. `SetupIntents.PaymentMethodOptions.Card.Link.persistent_token`, `SetupIntentsResource.persistent_token`. This is a legacy parameter that no longer has any function.
* [#2074](https://github.com/stripe/stripe-node/pull/2074) Add a more explicit comment on `limit` param in `autoPagingToArray`

## 15.5.0-beta.1 - 2024-04-25
* [#2070](https://github.com/stripe/stripe-node/pull/2070) Update generated code for beta
* Add support for `payment_method_settings` on `AccountSessionCreateParams.components`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1008
v1015
4 changes: 4 additions & 0 deletions src/resources/TestHelpers/Treasury/OutboundPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import {StripeResource} from '../../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const OutboundPayments = StripeResource.extend({
update: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}',
}),
fail: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail',
Expand Down
5 changes: 5 additions & 0 deletions src/resources/TestHelpers/Treasury/OutboundTransfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import {StripeResource} from '../../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const OutboundTransfers = StripeResource.extend({
update: stripeMethod({
method: 'POST',
fullPath:
'/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}',
}),
fail: stripeMethod({
method: 'POST',
fullPath:
Expand Down
2 changes: 1 addition & 1 deletion test/resources/generated_examples_test.spec.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion types/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ declare module 'stripe' {
deleted?: void;

/**
* Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true.
* Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://stripe.com/connect/onboarding) to finish submitting account details.
*/
details_submitted: boolean;

Expand Down
12 changes: 6 additions & 6 deletions types/AccountsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,12 @@ declare module 'stripe' {
address?: Stripe.AddressParam;

/**
* The Kana variation of the the individual's primary address (Japan only).
* The Kana variation of the individual's primary address (Japan only).
*/
address_kana?: Stripe.JapanAddressParam;

/**
* The Kanji variation of the the individual's primary address (Japan only).
* The Kanji variation of the individual's primary address (Japan only).
*/
address_kanji?: Stripe.JapanAddressParam;

Expand All @@ -1146,7 +1146,7 @@ declare module 'stripe' {
first_name?: string;

/**
* The Kana variation of the the individual's first name (Japan only).
* The Kana variation of the individual's first name (Japan only).
*/
first_name_kana?: string;

Expand Down Expand Up @@ -2674,12 +2674,12 @@ declare module 'stripe' {
address?: Stripe.AddressParam;

/**
* The Kana variation of the the individual's primary address (Japan only).
* The Kana variation of the individual's primary address (Japan only).
*/
address_kana?: Stripe.JapanAddressParam;

/**
* The Kanji variation of the the individual's primary address (Japan only).
* The Kanji variation of the individual's primary address (Japan only).
*/
address_kanji?: Stripe.JapanAddressParam;

Expand All @@ -2699,7 +2699,7 @@ declare module 'stripe' {
first_name?: string;

/**
* The Kana variation of the the individual's first name (Japan only).
* The Kana variation of the individual's first name (Japan only).
*/
first_name_kana?: string;

Expand Down
4 changes: 1 addition & 3 deletions types/Capabilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ declare module 'stripe' {
currently_due: Array<string>;

/**
* If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`.
* If the capability is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.other`, `platform_paused`, `rejected.inactivty`, or `rejected.unsupported_business`.
*
* `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses).
*
* `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details.
*
* If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance.
*/
disabled_reason: string | null;

Expand Down
2 changes: 1 addition & 1 deletion types/Capital/FinancingSummary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare module 'stripe' {
advance_amount: number;

/**
* The time at which the funds were paid out the the Connected account's Stripe balance. Given in milliseconds since unix epoch.
* The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch.
*/
advance_paid_out_at: number | null;

Expand Down
7 changes: 7 additions & 0 deletions types/ConfirmationTokens.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ declare module 'stripe' {

alipay?: PaymentMethodPreview.Alipay;

/**
* This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
*/
allow_redisplay?: PaymentMethodPreview.AllowRedisplay;

amazon_pay?: PaymentMethodPreview.AmazonPay;

au_becs_debit?: PaymentMethodPreview.AuBecsDebit;
Expand Down Expand Up @@ -262,6 +267,8 @@ declare module 'stripe' {

interface Alipay {}

type AllowRedisplay = 'always' | 'limited' | 'unspecified';

interface AmazonPay {}

interface AuBecsDebit {
Expand Down
2 changes: 1 addition & 1 deletion types/CreditNotesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ declare module 'stripe' {
list(options?: RequestOptions): ApiListPromise<Stripe.CreditNote>;

/**
* When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
* When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
*/
listLineItems(
id: string,
Expand Down
36 changes: 36 additions & 0 deletions types/EventTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ declare module 'stripe' {
| TreasuryOutboundPaymentFailedEvent
| TreasuryOutboundPaymentPostedEvent
| TreasuryOutboundPaymentReturnedEvent
| TreasuryOutboundPaymentTrackingDetailsUpdatedEvent
| TreasuryOutboundTransferCanceledEvent
| TreasuryOutboundTransferCreatedEvent
| TreasuryOutboundTransferExpectedArrivalDateUpdatedEvent
| TreasuryOutboundTransferFailedEvent
| TreasuryOutboundTransferPostedEvent
| TreasuryOutboundTransferReturnedEvent
| TreasuryOutboundTransferTrackingDetailsUpdatedEvent
| TreasuryReceivedCreditCreatedEvent
| TreasuryReceivedCreditFailedEvent
| TreasuryReceivedCreditSucceededEvent
Expand Down Expand Up @@ -4205,6 +4207,23 @@ declare module 'stripe' {
}
}

/**
* Occurs whenever tracking_details on an OutboundPayment is updated.
*/
interface TreasuryOutboundPaymentTrackingDetailsUpdatedEvent
extends EventBase {
type: 'treasury.outbound_payment.tracking_details_updated';
data: TreasuryOutboundPaymentTrackingDetailsUpdatedEvent.Data;
}

namespace TreasuryOutboundPaymentTrackingDetailsUpdatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.Treasury.OutboundPayment;

previous_attributes?: Partial<Stripe.Treasury.OutboundPayment>;
}
}

/**
* Occurs whenever an OutboundTransfer is canceled.
*/
Expand Down Expand Up @@ -4302,6 +4321,23 @@ declare module 'stripe' {
}
}

/**
* Occurs whenever tracking_details on an OutboundTransfer is updated.
*/
interface TreasuryOutboundTransferTrackingDetailsUpdatedEvent
extends EventBase {
type: 'treasury.outbound_transfer.tracking_details_updated';
data: TreasuryOutboundTransferTrackingDetailsUpdatedEvent.Data;
}

namespace TreasuryOutboundTransferTrackingDetailsUpdatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.Treasury.OutboundTransfer;

previous_attributes?: Partial<Stripe.Treasury.OutboundTransfer>;
}
}

/**
* Occurs whenever a received_credit is created as a result of funds being pushed by another account.
*/
Expand Down
2 changes: 2 additions & 0 deletions types/Events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,14 @@ declare module 'stripe' {
| 'treasury.outbound_payment.failed'
| 'treasury.outbound_payment.posted'
| 'treasury.outbound_payment.returned'
| 'treasury.outbound_payment.tracking_details_updated'
| 'treasury.outbound_transfer.canceled'
| 'treasury.outbound_transfer.created'
| 'treasury.outbound_transfer.expected_arrival_date_updated'
| 'treasury.outbound_transfer.failed'
| 'treasury.outbound_transfer.posted'
| 'treasury.outbound_transfer.returned'
| 'treasury.outbound_transfer.tracking_details_updated'
| 'treasury.received_credit.created'
| 'treasury.received_credit.failed'
| 'treasury.received_credit.succeeded'
Expand Down
7 changes: 7 additions & 0 deletions types/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ declare module 'stripe' {

alipay?: PaymentMethod.Alipay;

/**
* This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
*/
allow_redisplay?: PaymentMethod.AllowRedisplay;

amazon_pay?: PaymentMethod.AmazonPay;

au_becs_debit?: PaymentMethod.AuBecsDebit;
Expand Down Expand Up @@ -169,6 +174,8 @@ declare module 'stripe' {

interface Alipay {}

type AllowRedisplay = 'always' | 'limited' | 'unspecified';

interface AmazonPay {}

interface AuBecsDebit {
Expand Down
2 changes: 1 addition & 1 deletion types/Quotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ declare module 'stripe' {
line_items?: ApiList<Stripe.LineItem>;

/**
* A list of lines on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
* A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
*/
lines?: Array<string> | null;

Expand Down
4 changes: 2 additions & 2 deletions types/QuotesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ declare module 'stripe' {
line_items?: Array<QuoteCreateParams.LineItem>;

/**
* A list of lines on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
* A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
*/
lines?: Array<QuoteCreateParams.Line>;

Expand Down Expand Up @@ -1791,7 +1791,7 @@ declare module 'stripe' {
line_items?: Array<QuoteUpdateParams.LineItem>;

/**
* A list of lines on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
* A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
*/
lines?: Array<QuoteUpdateParams.Line>;

Expand Down
7 changes: 7 additions & 0 deletions types/SubscriptionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ declare module 'stripe' {
SubscriptionCreateParams.PendingInvoiceItemInterval
>;

/**
* How to handle a customer's pending invoice items if an invoice will be generated. Defaults to `include` if the parameter is omitted.
*/
pending_invoice_items_behavior?: SubscriptionCreateParams.PendingInvoiceItemsBehavior;

/**
* If specified, the invoicing for the given billing cycle iterations will be processed now.
*/
Expand Down Expand Up @@ -959,6 +964,8 @@ declare module 'stripe' {
type Interval = 'day' | 'month' | 'week' | 'year';
}

type PendingInvoiceItemsBehavior = 'exclude' | 'include';

interface Prebilling {
/**
* This is used to determine the number of billing cycles to prebill.
Expand Down
67 changes: 66 additions & 1 deletion types/TestHelpers/Treasury/OutboundPaymentsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,62 @@
declare module 'stripe' {
namespace Stripe {
namespace TestHelpers {
namespace Treasury {
interface OutboundPaymentUpdateParams {
/**
* Details about network-specific tracking information.
*/
tracking_details: OutboundPaymentUpdateParams.TrackingDetails;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

namespace OutboundPaymentUpdateParams {
interface TrackingDetails {
/**
* ACH network tracking details.
*/
ach?: TrackingDetails.Ach;

/**
* The US bank account network used to send funds.
*/
type: TrackingDetails.Type;

/**
* US domestic wire network tracking details.
*/
us_domestic_wire?: TrackingDetails.UsDomesticWire;
}

namespace TrackingDetails {
interface Ach {
/**
* ACH trace ID for funds sent over the `ach` network.
*/
trace_id: string;
}

type Type = 'ach' | 'us_domestic_wire';

interface UsDomesticWire {
/**
* IMAD for funds sent over the `us_domestic_wire` network.
*/
imad?: string;

/**
* OMAD for funds sent over the `us_domestic_wire` network.
*/
omad?: string;
}
}
}
}

namespace Treasury {
interface OutboundPaymentFailParams {
/**
Expand All @@ -29,7 +85,7 @@ declare module 'stripe' {
expand?: Array<string>;

/**
* Optional hash to set the the return code.
* Optional hash to set the return code.
*/
returned_details?: OutboundPaymentReturnOutboundPaymentParams.ReturnedDetails;
}
Expand Down Expand Up @@ -60,6 +116,15 @@ declare module 'stripe' {

namespace Treasury {
class OutboundPaymentsResource {
/**
* Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
*/
update(
id: string,
params: OutboundPaymentUpdateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Treasury.OutboundPayment>>;

/**
* Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
*/
Expand Down

0 comments on commit 0c0339c

Please sign in to comment.