-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FPX types #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed two small issues but 👍 after that
types/stripe-js/elements.d.ts
Outdated
*/ | ||
create( | ||
elementType: 'fpxBank', | ||
options?: StripeFpxBankElementOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options?: StripeFpxBankElementOptions | |
options: StripeFpxBankElementOptions |
I think options
must be passed with at least a accountHolderType
field.
on( | ||
eventType: 'change', | ||
handler: (event: StripeFpxBankElementChangeEvent) => any | ||
): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
): void; | |
): StripeFpxBankElement; |
? I think so, it looks like the other element types have this wrong too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating them all.
Summary & motivation
Add the types for the FPX PaymentMethod and the
fpxBank
element.https://stripe.com/docs/js/payment_intents/confirm_fpx_payment
https://stripe.com/docs/js/elements_object/create_element?type=fpxBank
https://stripe.com/docs/payments/fpx#web
Testing & documentation
Documentation is available in the Stripe docs.
I added type level tests.