[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:
Harry
2019-07-25 11:34:57 -07:00
committed by Wesley Wigham
parent d376c1624e
commit 5fd76280b3
2 changed files with 14 additions and 6 deletions
+7 -6
View File
@@ -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>;
}
+7
View File
@@ -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