You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 use AdyenCheckout.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 the onReady dropin hook, because when AdyenCheckout.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
Preserve selected payment option when remounting Dropin
Add a public method or other way to update amount without remounting Dropin
A configuration value that specifies which payment method to open upon mounting the Dropin
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:
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.
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.
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.
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: