Skip to content

Commit

Permalink
Update generated code (#1990)
Browse files Browse the repository at this point in the history
* Update generated code for v745

* Update generated code for v747

* Update generated code for v748

* Update generated code for v750

* Update generated code for v752

* Update generated code for v753

* Update generated code for v755

* Update generated code for v755

* Update generated code for v755

* Update generated code for v755

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Jan 12, 2024
1 parent 2be4b01 commit 46e067a
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 30 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v742
v755
1 change: 1 addition & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export {Charges} from './resources/Charges.js';
export {CountrySpecs} from './resources/CountrySpecs.js';
export {Coupons} from './resources/Coupons.js';
export {CreditNotes} from './resources/CreditNotes.js';
export {CustomerSessions} from './resources/CustomerSessions.js';
export {Customers} from './resources/Customers.js';
export {Disputes} from './resources/Disputes.js';
export {EphemeralKeys} from './resources/EphemeralKeys.js';
Expand Down
7 changes: 7 additions & 0 deletions src/resources/CustomerSessions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const CustomerSessions = StripeResource.extend({
create: stripeMethod({method: 'POST', fullPath: '/v1/customer_sessions'}),
});
12 changes: 12 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,18 @@ describe('Generated tests', function() {
expect(creditNote).not.to.be.null;
});

it('test_customer_sessions_post', async function() {
const customerSession = await stripe.customerSessions.create({
customer: 'cus_123',
components: {
buy_button: {
enabled: true,
},
},
});
expect(customerSession).not.to.be.null;
});

it('test_customers_balance_transactions_get', async function() {
const customerBalanceTransactions = await stripe.customers.listBalanceTransactions(
'cus_xxxxxxxxxxxxx',
Expand Down
12 changes: 6 additions & 6 deletions types/BalanceTransactions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ declare module 'stripe' {
status: string;

/**
* Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
* Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
*/
type: BalanceTransaction.Type;
}
Expand Down Expand Up @@ -129,12 +129,8 @@ declare module 'stripe' {
| 'issuing_authorization_release'
| 'issuing_dispute'
| 'issuing_transaction'
| 'obligation_inbound'
| 'obligation_outbound'
| 'obligation_payout'
| 'obligation_payout_failure'
| 'obligation_reversal_inbound'
| 'obligation_reversal_outbound'
| 'payment'
| 'payment_failure_refund'
| 'payment_network_reserve_hold'
Expand All @@ -157,7 +153,11 @@ declare module 'stripe' {
| 'transfer'
| 'transfer_cancel'
| 'transfer_failure'
| 'transfer_refund';
| 'transfer_refund'
| 'obligation_inbound'
| 'obligation_payout'
| 'obligation_payout_failure'
| 'obligation_reversal_outbound';
}
}
}
2 changes: 1 addition & 1 deletion types/BalanceTransactionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare module 'stripe' {
source?: string;

/**
* Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
* Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
*/
type?: string;
}
Expand Down
78 changes: 78 additions & 0 deletions types/CustomerSessions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
/**
* A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
* control over a customer.
*/
interface CustomerSession {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'customer_session';

/**
* The client secret of this customer session. Used on the client to set up secure access to the given `customer`.
*
* The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
*/
client_secret: string;

/**
* Configuration for the components supported by this customer session.
*/
components?: CustomerSession.Components;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;

/**
* The customer the customer session was created for.
*/
customer: string | Stripe.Customer;

/**
* The timestamp at which this customer session will expire.
*/
expires_at: number;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
}

namespace CustomerSession {
interface Components {
/**
* This hash contains whether the buy button is enabled.
*/
buy_button?: Components.BuyButton;

/**
* This hash contains whether the pricing table is enabled.
*/
pricing_table?: Components.PricingTable;
}

namespace Components {
interface BuyButton {
/**
* Whether the buy button is enabled.
*/
enabled: boolean;
}

interface PricingTable {
/**
* Whether the pricing table is enabled.
*/
enabled: boolean;
}
}
}
}
}
62 changes: 62 additions & 0 deletions types/CustomerSessionsResource.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
interface CustomerSessionCreateParams {
/**
* Configuration for each component. 1 component must be enabled.
*/
components: CustomerSessionCreateParams.Components;

/**
* The ID of an existing customer for which to create the customer session.
*/
customer: string;

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

namespace CustomerSessionCreateParams {
interface Components {
/**
* Configuration for buy button.
*/
buy_button?: Components.BuyButton;

/**
* Configuration for the pricing table.
*/
pricing_table?: Components.PricingTable;
}

namespace Components {
interface BuyButton {
/**
* Whether the buy button is enabled.
*/
enabled: boolean;
}

interface PricingTable {
/**
* Whether the pricing table is enabled.
*/
enabled: boolean;
}
}
}

class CustomerSessionsResource {
/**
* Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
*/
create(
params: CustomerSessionCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CustomerSession>>;
}
}
}
2 changes: 2 additions & 0 deletions types/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,12 +1095,14 @@ declare module 'stripe' {
| 'card'
| 'cashapp'
| 'customer_balance'
| 'eps'
| 'fpx'
| 'giropay'
| 'grabpay'
| 'ideal'
| 'konbini'
| 'link'
| 'p24'
| 'paynow'
| 'paypal'
| 'promptpay'
Expand Down
4 changes: 4 additions & 0 deletions types/InvoicesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,14 @@ declare module 'stripe' {
| 'card'
| 'cashapp'
| 'customer_balance'
| 'eps'
| 'fpx'
| 'giropay'
| 'grabpay'
| 'ideal'
| 'konbini'
| 'link'
| 'p24'
| 'paynow'
| 'paypal'
| 'promptpay'
Expand Down Expand Up @@ -1069,12 +1071,14 @@ declare module 'stripe' {
| 'card'
| 'cashapp'
| 'customer_balance'
| 'eps'
| 'fpx'
| 'giropay'
| 'grabpay'
| 'ideal'
| 'konbini'
| 'link'
| 'p24'
| 'paynow'
| 'paypal'
| 'promptpay'
Expand Down
6 changes: 3 additions & 3 deletions types/Issuing/Cardholders.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,20 @@ declare module 'stripe' {
namespace Individual {
interface CardIssuing {
/**
* Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
* Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program.
*/
user_terms_acceptance: CardIssuing.UserTermsAcceptance | null;
}

namespace CardIssuing {
interface UserTermsAcceptance {
/**
* The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users.
* The Unix timestamp marking when the cardholder accepted the Authorized User Terms.
*/
date: number | null;

/**
* The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users.
* The IP address from which the cardholder accepted the Authorized User Terms.
*/
ip: string | null;

Expand Down
4 changes: 2 additions & 2 deletions types/Issuing/CardholdersResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ declare module 'stripe' {
namespace Individual {
interface CardIssuing {
/**
* Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
* Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program.
*/
user_terms_acceptance?: CardIssuing.UserTermsAcceptance;
}
Expand Down Expand Up @@ -1296,7 +1296,7 @@ declare module 'stripe' {
namespace Individual {
interface CardIssuing {
/**
* Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
* Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program.
*/
user_terms_acceptance?: CardIssuing.UserTermsAcceptance;
}
Expand Down
12 changes: 6 additions & 6 deletions types/PaymentIntentsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<AcssDebit.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: AcssDebit.VerificationMethod;
}
Expand Down Expand Up @@ -2072,7 +2072,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<UsBankAccount.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: UsBankAccount.VerificationMethod;
}
Expand Down Expand Up @@ -3107,7 +3107,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<AcssDebit.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: AcssDebit.VerificationMethod;
}
Expand Down Expand Up @@ -4186,7 +4186,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<UsBankAccount.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: UsBankAccount.VerificationMethod;
}
Expand Down Expand Up @@ -5359,7 +5359,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<AcssDebit.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: AcssDebit.VerificationMethod;
}
Expand Down Expand Up @@ -6438,7 +6438,7 @@ declare module 'stripe' {
setup_future_usage?: Stripe.Emptyable<UsBankAccount.SetupFutureUsage>;

/**
* Verification method for the intent
* Bank account verification method.
*/
verification_method?: UsBankAccount.VerificationMethod;
}
Expand Down
4 changes: 2 additions & 2 deletions types/Reporting/ReportRunsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ declare module 'stripe' {
| 'issuing_dispute'
| 'issuing_transaction'
| 'network_cost'
| 'obligation'
| 'other_adjustment'
| 'partial_capture_reversal'
| 'payout'
Expand All @@ -102,7 +101,8 @@ declare module 'stripe' {
| 'topup_reversal'
| 'transfer'
| 'transfer_reversal'
| 'unreconciled_customer_funds';
| 'unreconciled_customer_funds'
| 'obligation';

type Timezone =
| 'Africa/Abidjan'
Expand Down
Loading

0 comments on commit 46e067a

Please sign in to comment.