mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
[stripe] Add expandable properties to checkout session (#37005)
* [stripe] Add expandable properties to checkout session * Add type assertions to checkout session tests
This commit is contained in:
Vendored
+7
-6
@@ -2050,9 +2050,9 @@ declare namespace Stripe {
|
||||
client_reference_id?: string;
|
||||
|
||||
/**
|
||||
* ID of customer
|
||||
* ID of customer [Expandable]
|
||||
*/
|
||||
customer?: string;
|
||||
customer?: string | customers.ICustomer;
|
||||
|
||||
/**
|
||||
* Email address of customer
|
||||
@@ -2075,9 +2075,9 @@ declare namespace Stripe {
|
||||
locale?: string;
|
||||
|
||||
/**
|
||||
* ID of payment intent created
|
||||
* ID of payment intent created [Expandable]
|
||||
*/
|
||||
payment_intent?: string;
|
||||
payment_intent?: string | paymentIntents.IPaymentIntent;
|
||||
|
||||
/**
|
||||
* Array of accepted payment methods
|
||||
@@ -2085,9 +2085,9 @@ declare namespace Stripe {
|
||||
payment_method_types?: string[];
|
||||
|
||||
/**
|
||||
* ID of subscription if one was created
|
||||
* ID of subscription if one was created [Expandable]
|
||||
*/
|
||||
subscription?: string;
|
||||
subscription?: string | subscriptions.ISubscription;
|
||||
|
||||
/**
|
||||
* URL to redirect to upon success
|
||||
@@ -7802,6 +7802,7 @@ declare namespace Stripe {
|
||||
|
||||
class Sessions extends StripeResource {
|
||||
create(data: checkouts.sessions.ICheckoutCreationOptions, response?: IResponseFn<checkouts.sessions.ICheckoutSession>): Promise<checkouts.sessions.ICheckoutSession>;
|
||||
retrieve(data: string, options: HeaderOptions, response?: IResponseFn<checkouts.sessions.ICheckoutSession>): Promise<checkouts.sessions.ICheckoutSession>;
|
||||
retrieve(data: string, response?: IResponseFn<checkouts.sessions.ICheckoutSession>): Promise<checkouts.sessions.ICheckoutSession>;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,6 +282,13 @@ stripe.checkout.sessions.create({
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
stripe.checkout.sessions.retrieve('ch_test_123').then(session => {
|
||||
session; // $ExpectType ICheckoutSession
|
||||
});
|
||||
stripe.checkout.sessions.retrieve('ch_test_123', { expand: ['payment_intent'] }).then(session => {
|
||||
session.payment_intent; // $ExpectType string | IPaymentIntent
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region CreditNotes tests
|
||||
|
||||
Reference in New Issue
Block a user