-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello @jesperjohansson @mortend
After selecting the "Credit Card" payment method, I am filling the card details and when I press on "Pay" button it got failed and stopped the process with just this message: "Http 403 error". I have debug the code and it goes in rejectCallback:
AdyenDropInModule.start(
cleanedPaymentMethodsResponse,
resolveCallback,
rejectCallback
);
My implementation:
import AdyenDropIn, { isCancelledError, isSuccessResult, PaymentResult, } from '@ancon/react-native-adyen-dropin';
const adyenDropIn = AdyenDropIn.setModuleConfig({
// Required
baseUrl: "API_BASE_URL",
// Optional
debug: true,
// Optional
// headers: {
// Authorization: 'Bearer 123',
// },
// // Optional
endpoints: {
makePayment: '/makePayment',
makeDetailsCall: '/details',
disableStoredPaymentMethod: '/disable',
},
}).setDropInConfig({
// Required
clientKey: ADYEN_CLIENT_KEY,
// Required
environment: ADYEN_ENV,
// Required
countryCode: COUNTRY_CODE,
// Required
amount: {
value: payableAmount,
currencyCode:
_.get(paymentDetails, "currency", DEFAULT_CURRENCY_CODE) ||
DEFAULT_CURRENCY_CODE,
},
// Optional
// applePay: {
// label: 'Example Company',
// amount: { value: 1, currencyCode: 'SEK' },
// configuration: {
// merchantId: config.applePay?.configuration?.merchantId,
// },
// },
// // Optional
// showRemovePaymentMethodButton: config.showRemovePaymentMethodButton,
// // Optional, required for recurring payments/saved payment method
// shopperReference: config.shopperReference,
});
const tempMethods = await getPaymentMethods();
adyenDropIn
.start(tempMethods)
.then((res: PaymentResult) => {
console.log('result:');
console.log(res);
if (isSuccessResult(res)) {
console.log('Success', `Payment success: ${res.resultCode}`);
} else {
console.log('Refused', `Payment refused: ${res.refusalReason}`);
}
})
.catch((err: Error) => {
if (isCancelledError(err)) {
console.log('Cancelled');
} else {
console.log('Error', `Payment error: ${err.message}`, JSON.stringify(err));
console.error(err);
}
})
.finally(() => {
setIsLoading(false);
});
Can you please help me with this issue?
Metadata
Metadata
Assignees
Labels
No labels