[@types/stripe] Fix IPaymentIntentListOptions (#41204)

* Fix IPaymentIntentListOptions

Added `customer` field and removed `expired` and `files` fields, per [Stripe API](https://stripe.com/docs/api/payment_intents/list).

* Updated stripe-tests.ts

Added customer field to test creation, so we can test listing with customer field set.

* Fix missing semicolon in index.d.ts
This commit is contained in:
Sean Chen
2019-12-26 10:57:29 -06:00
committed by Andrew Branch
parent 29a7bcd6eb
commit 4e717bf915
2 changed files with 7 additions and 9 deletions
+3 -7
View File
@@ -35,6 +35,7 @@
// Aseel Al Dallal <https://github.com/Aseelaldallal>
// Collin Pham <https://github.com/collin-pham>
// Timon van Spronsen <https://github.com/TimonVS>
// Sean Chen <https://github.com/kamiyo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -7590,14 +7591,9 @@ declare namespace Stripe {
interface IPaymentIntentListOptions extends IListOptionsCreated {
/**
* Filter links by their expiration status. By default, all links are returned.
* Only return PaymentIntents for the customer specified by this customer ID.
*/
expired?: boolean;
/**
* Only return links for the given file.
*/
file?: boolean;
customer?: string;
}
}
+4 -2
View File
@@ -2091,6 +2091,7 @@ stripe.paymentIntents.create(
amount: 2000,
currency: 'eur',
payment_method_types: ['card', 'ideal', 'sepa_debit'],
customer: 'cus_5rfJKDJkuxzh5Q',
},
(err, intent) => {},
);
@@ -2100,6 +2101,7 @@ stripe.paymentIntents
amount: 2000,
currency: 'eur',
payment_method_types: ['card', 'ideal', 'sepa_debit'],
customer: 'cus_5rfJKDJkuxzh5Q',
})
.then(intent => {});
@@ -2107,8 +2109,8 @@ stripe.paymentIntents.list({}, (err, intent) => {});
stripe.paymentIntents.list({}).then(intent => {});
stripe.paymentIntents.list((err, intent) => {});
stripe.paymentIntents.list().then(intent => {});
stripe.paymentIntents.list({ expired: true }, (err, intent) => {});
stripe.paymentIntents.list({ expired: true }).then(intent => {});
stripe.paymentIntents.list({ customer: 'cus_5rfJKDJkuxzh5Q' }, (err, intent) => {});
stripe.paymentIntents.list({ customer: 'cus_5rfJKDJkuxzh5Q' }).then(intent => {});
stripe.paymentIntents.update(
'pi_Aabcxyz01aDfoo',