-
Notifications
You must be signed in to change notification settings - Fork 131
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
A way to specify payment method when mounting Dropin #1510
Comments
Hi @geext-dk , Thanks for reaching out and for sharing the alternatives as well. The good news is that this improvement is already on our backlog 😃 I will update this ticket as soon as this feature is released. |
Hey, I have a similar problem. I think the approach klarna has for solving this problem is quite good. They allow you to lock the UI with a suspend function when performing external actions that affect the session. And then a resume function that unlocks the UI, that also refetches the internal amount in klarnas' session. You could provide a way to patch the session via api and then mimick this behaviour in the mount / remount function. That provides a good DX which abstracts much of the logic. |
Hi all! A BETA version of Web v6 is now available on Github. Feel free to take a look and give us feedback! We aim to release the official v6 in the coming weeks. More information can be found here. |
Hi all, We release v6.0.0 this week which exposes the functionality to pre-select payment method when mounting Drop-in. Ex: const dropin = new Dropin(checkout, {
openPaymentMethod: {
type: 'ideal',
}
}); Try it out and let us know in case you guys face any issues with that. Cheers! |
Is your feature request related to a problem? Please describe.
We have a case when our payment amount may change after initializing the Dropin. The documentation advices to remount (unmount and mount) the widget in case it changes. But payment methods configuration (some of which also require
amount
) is specified in the global configuration only, so it also should be updated. That's why I useAdyenCheckout.update
method to update the configuration and remount dropin automatically. Yet it introduces another problem - after remounting, the dropin doesn't open the payment method that was opened before unmounting.Without updating the amount, Google Pay and Apple Pay show outdated amount in their widgets.
To workaround that, I get the current payment method type (
this.dropin.activePaymentMethod?.type
) and I find the needed payment method in the DOM via this selector.adyen-checkout__payment-method--${type}
and call.click()
to simulate choice. And all of that should be done in theonReady
dropin hook, because whenAdyenCheckout.update
resolves dropin is not yet fully mounted. I think that's not how it should be done.Of course it's possible I'm doing it the totally wrong way.
Describe the solution you'd like
Add a public method for selecting a payment method by its type
Describe alternatives you've considered
Additional context
Our dropin is integrated the old way (before 5.0.0).
Package version we use (
@adyen/adyen-web
): 5.3.1.The text was updated successfully, but these errors were encountered: