Open mortend opened 2 years ago
Hey @mortend
Thanks for reaching out!
Could you please share the video or gif? Not sure that I understand what you mean.
Hey @descorp
I am talking about this drawer when I say drop-in component:
didSubmit
for many seconds), and because the Adyen drawer is still usable and visible, it is possible to start another payment while waiting for the first one to go through. It is currently possible to pay for the same thing twice in our app on iOS.We're using Adyen SDK via React Native using this module: https://github.com/ancon-labs/react-native-adyen-dropin
We have tried hacking around a bit in this code without success:
Called dismiss
on a UIViewController
we found. This caused the app to hang probably because we're tearing down Adyen while payments are in progress.
Found a UIView
and set isHidden = true
. It turns out this will hide the entire app.
So, we think we need a Swift method we can call when we want to hide the Adyen drawer shown on the picture, without breaking payments. We probably want to call this method from didSubmit
.
Hey @mortend
Thanks for details. I think I understand now:
Called dismiss on a UIViewController we found. This caused the app to hang probably because we're tearing down Adyen while payments are in progress.
You can try using AdyenActionComponent instead of handling actions via dropInComponent.handle(action)
, so instance of AdyenActionComponent will be persisted and not affected by DropIn's life cycle.
@descorp Thanks for the pointer.
We tried to implement this in https://github.com/fusetools/react-native-adyen-dropin/commit/b17e58bdbef52ef83d674928125457c56958bcee, but it looks like it isn't enough.
Credit Card payment still works.
Vipps payment no longer works. The drawer closes but the transaction never completes/app seems to hang.
I have a feeling that calling dismiss
too early isn't what we want. I wish there was a hide
method that just hides the drawer while leaving everything else intact.
Any news on this? Will it be possible to hide the drawer without calling dismiss?
Hey @mortend
sorry, just got back from vacation 😁
Will it be possible to hide the drawer without calling dismiss?
Not on iOS. This is one of the differences between Android and iOS. However, this should not be an issue..
We tried to implement this in fusetools/react-native-adyen-dropin@b17e58b, but it looks like it isn't enough.
I believe you are missing delegate
and presentationDelegate
:
internal lazy var actionComponent: AdyenActionComponent = {
let handler = AdyenActionComponent(apiContext: apiContext)
handler.delegate = self
handler.presentationDelegate = self
return handler
}()
Not sure if this is React Native issue or SDK issue: I don't know how reliable is bridge between JS and native when app leaves foreground.
I'll try to reproduce on local vanila RN setup.
UPD
On my local RN setup Vipps worked as expected.
Another thing from your fork:
this doesn't sound like a good idea.
DropIn have build-in "waiting" UI while Action is expected.
If you need to dismiss DropIn after shopper finished payment and redirected back to your app, I would rather move this line to didProvide
, before calling apiClient?.perform(request, completionHandler: paymentResponseHandler)
(line 400)
Hey @mortend
Were you able to resolve the issue? Do you need any extra help?
I am going to close this ticket due to a lack of activity. Please, feel free to reopen it.
@descorp, I am sorry for the delayed response.
The issue is not yet resolved in our app. I have now attached a video demonstrating the issue.
Sometimes the server is even slower in returning its response so the user will have good time to enter the credit card info while we're still processing the earlier Vipps payment.
All changes we have tried so far in https://github.com/fusetools/react-native-adyen-dropin (including the ones you suggested) only results in other errors with the app - i.e. payments not working anymore.
So, we are looking for a method to hide (or disable) the Adyen drop-in component while our middleware is processing the Vipps payment.
https://user-images.githubusercontent.com/247798/149893895-d9a73069-41d1-45f9-9f55-5b773ecf0b9d.mp4
I am going to close this ticket due to a lack of activity. Please, feel free to reopen it.
I am not able to reopen this ticket myself.
I am not able to reopen this ticket myself.
oh, sorry. I didn't know that it is not re-openable 🤔
So, we are looking for a method to hide (or disable) the Adyen drop-in component while our middleware is processing the Vipps payment.
Indeed.. So far I can only suggest one of the following:
Inside of func didProvide(_ data: ActionComponentData, from component: DropInComponent):
a) disable UI for DropIn like component.viewController.view.isUserInteractionEnabled = false
OR
b) dismiss DropIn before making network call here (this could interfere with Apple Pay flow, if you are going to use one).
We will consider adding some sort of user-friendly waiting UI for this cases.
Thank you @descorp!
Option a) works and now it's blocking input while processing the Vipps payment. This solves the "pay twice" issue for us.
We will consider adding some sort of user-friendly waiting UI for this cases.
Nice - this sounds like a better user experience than blocking input. Keep us updated. :)
@descorp A client of ours is pushing quite a bit for us to improve the UX here. Anything you can share about prioritization/roadmap for this feature?
We need a method to hide the drop-in component (
DropInComponent
).Sometimes when opening an external app from the drop-in component and performing payment, the response from our middleware is very slow (implemented in
didSubmit
) and the drop-in component is still visible and usable while waiting for this response.The problem is that it is currently possible to start a new payment while in this state and this might confuse the user and cause problems with the payment that is already in progress.
We want to hide the drop-in component while in this state to avoid the problem.