-
Notifications
You must be signed in to change notification settings - Fork 128
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
paymentMethodRequestable fires unexpectedly after receiving a payload from requestPaymentMethod #718
Comments
I think this is intentional. The event payload includes a property Can you go into more detail about how your integration works? In most cases, once |
Oh, I missed that in the docs and and didn't think to check what was being passed to the event handler. Good to know, thanks.
Sure thing. I'm displaying drop-in as the final step of my multi-step checkout process:
The problem for me is what the customer does between steps 3 and 4. I'd like to have a single button that is a Save credit card and then changes to Submit order once a valid card is chosen. With cc entry at least, the crux of the issue is the "Choose another way to pay" button. I have no way of knowing if they've clicked this and entered a new card. And because of that I don't know if I should request a new nonce or I can use the one I have and submit the order. ( Is there a reason there isn't a built-in button for committing the entered card? There are other buttons for editing and deleting saved payments, no? Without that button it means I need one and to worry about keeping my ui in sync with the component. For now my workaround is to just request the nonce and submit the order in one go but it's not great. |
In retrospect, I wish we had gone that route. That certainly would put the credit card form in line with how the other payment methods work. I think the only real difficulty is figuring out the right language for it, because it certainly isn't "saving" the card if you don't intend to vault it afterward. Something to think about as we design the next major version of Drop-in. I'll mark this issue with the v2 label so we can revisit it as we work on the next major version. For now, using the |
General information
Issue description
While entering credit card for an anonymous customer, paymentMethodRequestable event is firing when it shouldn't.
To reproduce:
dropin.create
instance.on('paymentMethodRequestable', () => {
instance.requestPaymentMethod((err, payload) => {
paymentMethodRequestable fires once as soon as the form is complete (correct) and once after the payload is returned from
requestPaymentMethod
:^== in the image doit() is just
window.doit = () => instance.requestPaymentMethod
This makes it difficult to know if I should show a show a save payment method button or know the order is ready to be submitted.
The text was updated successfully, but these errors were encountered: