[stripe-v3] Add typings for paymentRequestButton.on('paymentmethod') (#36871)

* [stripe-v3] Add typings for paymentRequestButton.on('paymentmethod')

Relevant documentation: https://stripe.com/docs/stripe-js/reference#payment-response-object

* Update index.d.ts

* Fix linting error
This commit is contained in:
Pascal Sthamer
2019-07-18 12:05:57 -07:00
committed by Andrew Branch
parent 26fcfa878e
commit d91639eff2
+5
View File
@@ -623,12 +623,17 @@ declare namespace stripe {
source: Source;
}
interface StripePaymentMethodPaymentResponse extends StripePaymentResponse {
paymentMethod: paymentMethod.PaymentMethod;
}
interface StripePaymentRequest {
canMakePayment(): Promise<{ applePay?: boolean } | null>;
show(): void;
update(options: StripePaymentRequestUpdateOptions): void;
on(event: 'token', handler: (response: StripeTokenPaymentResponse) => void): void;
on(event: 'source', handler: (response: StripeSourcePaymentResponse) => void): void;
on(event: 'paymentmethod', handler: (response: StripePaymentMethodPaymentResponse) => void): void;
on(event: 'cancel', handler: () => void): void;
on(event: 'shippingaddresschange', handler: (response: { updateWith: (options: UpdateDetails) => void, shippingAddress: ShippingAddress }) => void): void;
on(event: 'shippingoptionchange', handler: (response: { updateWith: (options: UpdateDetails) => void, shippingOption: ShippingOption }) => void): void;