Describe the bug
In the Advanced flow on Android, calling nativeComponent.hide(false) for a server request failure causes Adyen Drop-in to emit onError.
Our application first handles the original network request error in the catch block surrounding the /payments or /payments/ details API request.
Android Drop-in then emits onError with a second unknown error, causing the same payment failure to be handled twice.
This does not happen on iOS.
To Reproduce
Configure BLIK with code to be available as one of the payment methods. In tne example app:
- Open
example/src/components/Checkout/AdvancedCheckout.tsx.
- Add a forced failure before the
ApiClient.payments() call:
try {
throw new Error('Forced payment failure');
const result = await ApiClient.payments(
data,
configuration,
data.returnUrl
);
// Existing result handling.
} catch (error) {
processError(error, nativeComponent);
}
- Navigate to Advanced -> Advanced Checkout -> BLIK.
- Enter an incorrect code.
- Observe that processError() handles the forced error and calls
nativeComponent.hide(false).
- Observe that the Adyen onError (processAdyenError) callback is subsequently invoked
with another error.
Expected behavior
nativeComponent.hide(false) does not cause AdyenCheckout.onError to fire. unknown is included in ErrorCode enum
Screenshots
Smartphone (please complete the following information):
- Android Emulator API 37.0
- Adyen RN 2.11.1
Describe the bug
In the Advanced flow on Android, calling
nativeComponent.hide(false)for a server request failure causes Adyen Drop-in to emitonError.Our application first handles the original network request error in the catch block surrounding the /payments or /payments/ details API request.
Android Drop-in then emits
onErrorwith a secondunknownerror, causing the same payment failure to be handled twice.This does not happen on iOS.
To Reproduce
Configure BLIK with code to be available as one of the payment methods. In tne example app:
example/src/components/Checkout/AdvancedCheckout.tsx.ApiClient.payments()call:nativeComponent.hide(false).
with another error.
Expected behavior
nativeComponent.hide(false)does not causeAdyenCheckout.onErrorto fire.unknownis included inErrorCodeenumScreenshots
Smartphone (please complete the following information):