if I use storedCardPayment object in my card.create and want to pay or click pay I get this error clientside in my console log
IMPLEMENTATION_ERROR: Could not submit the payment
server.js
const client = new Client({apiKey: "xxx", environment: "TEST"});
const checkout = new CheckoutAPI(client);
const orderRef = uuidv4();
const paymentMethods = await checkout.paymentMethods({
countryCode: 'DE',
amount: { currency: 'EUR', value: 10000 },
merchantAccount: 'xxx',
shopperReference: 'AHHH',
})
return json({paymentMethods});
React
export const cf = {
storePaymentMethod: true,
paymentMethodsConfiguration: {
ideal: {
showImage: true,
},
storedCard: {
hideCVC: true,
showInstallmentAmounts: true,
styles: {
height: 100,
width: 200,
backgroundColor: 'red'
}
},
card: {
hasHolderName: true,
holderNameRequired: true,
name: "Credit or debit card",
amount: {
value: 10000, // 100€ in minor units
currency: "EUR",
},
},
},
enableStoreDetails: true,
locale: "de_DE",
showPayButton: true,
clientKey: 'xxx',
environment: "test",
}
...
useEffect(() => {
if(fetcher.data && paymentData.session === null) {
setPaymentData(fetcher.data);
console.log('HIEE');
const createCheckout = async () => {
const checkout = await AdyenCheckout({
...cf,
paymentMethodsResponse: fetcher.data.paymentMethods,
onPaymentCompleted: (response: any, _component: any) =>
console.log(response),
onError: (error: any, _component: any) => {
console.error(error);
},
});
const storedPaymentMethod = checkout.paymentMethodsResponse.storedPaymentMethods[0];
const card = checkout.create("card", storedPaymentMethod).mount(paymentContainer.current);
};
createCheckout();
}
}, [fetcher]);
return (
<div className="payment-container">
<div ref={paymentContainer} className="payment"></div>
<div ref={paymentContainer} id="stored-card">
</div>
</div>
)
Can anyone help me why I got this error ?
if I remove "storedPaymentMethod" at card.create then I can pay but I want to pay with a stored payment method.
I hope anyone can help me