Skip to content

Inconsistent behavior of nativeComponent.hide during BLIK payment on Android #1198

Description

@kubeeek

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:

  1. Open example/src/components/Checkout/AdvancedCheckout.tsx.
  2. 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);
}
  1. Navigate to Advanced -> Advanced Checkout -> BLIK.
  2. Enter an incorrect code.
  3. Observe that processError() handles the forced error and calls
    nativeComponent.hide(false).
  4. 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

Image

Smartphone (please complete the following information):

  • Android Emulator API 37.0
  • Adyen RN 2.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportwhen a bug report is created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions