-
Notifications
You must be signed in to change notification settings - Fork 35
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
Drop in Android screen loading without any feedback of dropin (Android Only) #565
Comments
Hey @badredaha Could you provide more info:
Is it a
Do you mean network response from your backend API, right?
How is this behaviour different from iOS? |
Hi @descorp |
How is you |
@descorp the problem is when the drop-in is shown and I call my API with async to fetch data the return seem to be blocked ! I can see that I get response from my monitoring network (Reactotron or Flipper) but my app don't receive a response! For iOS it's works good (until now) the same code :/ |
@descorp we are a Little bit blocked |
Sorry @badredaha I am not sure if this is related to the SDK. Could you determine what line of code is causing "hanging"? |
Hello @descorp I found a hack, In Submit I call component.hide(true/or false) and I can manage the response returned from the API no problem! but It's weird and not stable :/ |
Not sure if I follow you. How is your |
Yes @descorp AdyenCheckout<AdyenCheckout
paymentMethods={adyenPaymentMethodsResponse}
config={setupAdyenConfiguration(
getTotalAmountToPay(amount)
appSettingsReducer.currency
)}
onComplete={(data, component) => {
useCallback(() => {
handleOnCompleteAdyenPayment(data, component);
}, []);
}}
onError={(error, component) => {
useCallback(() => {
handleErrorAdyenPayment(error, component);
}, []);
}}
onSubmit={onSubmitRequest}
> onSubmitRequest Methodconst onSubmitRequest = useCallback(
async (data: PaymentMethodData, component: AdyenActionComponent) => {
const inputsBookingProcess = prepareInputsCheckoutPaymentProcess(
data,
component
);
try {
startCheckoutPaymentProcess(inputsBookingProcess, {
onError: (error) => {
component.hide(false);
Logger.error("Error on payment", error);
showError();
},
onSuccess: (data: MbBookingProcessType) => {
component.hide(true);
goToPaymentConfirmation(data.confirmationNumber);
},
onChallenge: (data) => {
component.handle(data);
Logger.error("onChallenge Data", data);
},
});
} catch (error) {
Logger.error("Unhandled error on payment", error);
showError();
}
},
[]
); startCheckoutPaymentProcessexport function startCheckoutPaymentProcess(
processRequestInput: MbBookingProcessRequestInputType,
result?: CheckoutPaymentResult
) {
mutationBookingProcess(processRequestInput)
.then((response) => {
const error = handlePaymentErrors(response.error);
if (error) {
result?.onError(error);
return;
}
const checkoutPaymentResponse = response.data.bookingProcess;
if (
checkoutPaymentResponse?.status === CreateBookingStatus.ActionRequired
) {
result?.onChallenge(checkoutPaymentResponse.adyenAction);
return;
}
if (checkoutPaymentResponse?.status === CreateBookingStatus.Success) {
const checkoutSuccessResponse = {
confirmationNumber: checkoutPaymentResponse?.confirmationNumber,
transactionId: checkoutPaymentResponse?.transactionId,
};
result?.onSuccess(checkoutSuccessResponse);
return;
}
result?.onError(getDefaultError());
})
.catch((error) => {
result?.onError(handlePaymentErrors(error) ?? getDefaultError());
});} |
At first glance, the code looks fine. Is this before "hack" or after? |
Yes before! the Hack is when the submit call, I force component.hide(true)! and when I get the response from API the call is triggered. |
Dismissing component prematurely is a bad idea if you are planing to use any payment method that requires actions (3DS2, redirects etc.) Just to clarify: Can you provide a logger inside |
The is the issue ... its not called! like the Adyen Thread UI block ! |
Hello @descorp, |
Hey @badredaha Have you checked inside of |
Hey @descorp
|
Hey @badredaha What version of Adyen React Native you are using?
I am a bit confused which one is it. Looking at your code I have noticed that catch (error) {
Logger.error("Unhandled error on payment", error);
showError();
} Could that be a reason? |
Hi @descorp We use
No change :/ |
hm..
It could be possible, but we need a way to reproduce this behavior. Could you create a blank app that we can debug? Please send it to [email protected] to avoid sharing any sensitive information. Don't forget to mention this issue in your email. Additionally, it would be helpful if you could include a recording of your app along with the logs from Android Studio and Metro. |
Yes, I will do this and get you notified. Best regards |
Describe the bug
The Drop-in is started, and I enter the card information. After pressing the “Pay” button in the Drop-in, I observe the following behavior in the debug process:
1. The call to our API is made.
2. I receive the response, either indicating success or an error.
3. Despite receiving the response, the loading view remains visible and does not disappear.
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: