Reputation: 11
I try to integrate the Adyen Drop-in in a prototype.
After successful creating a session the sessionData is filled in a textarea with id="sessiondata". Next I want to call the drop-in:
const configuration = {
environment: 'test', // Change to one of the environment values specified in step 4.
clientKey: 'test_***', // Public key used for client-side authentication: https://docs.adyen.com/development-resources/client-side-authentication
analytics: {
enabled: false // Set to false to not send analytics data to Adyen.
},
session: {
id: $('#pcid').val(), // Unique identifier for the payment session.
sessionData: $('#sessiondata').val() // The payment session data.
},
onPaymentCompleted: (result, component) => {
console.info(result, component);
},
onError: (error, component) => {
console.error(error.name, error.message, error.stack, component);
},
// Any payment method specific configuration. Find the configuration specific to each payment method: https://docs.adyen.com/payment-methods
// For example, this is 3D Secure configuration for cards:
paymentMethodsConfiguration: {
card: {
hasHolderName: true,
holderNameRequired: true,
billingAddressRequired: true
}
}
};
// Create an instance of AdyenCheckout using the configuration object.
const checkout = await AdyenCheckout(configuration);
// Create an instance of Drop-in and mount it to the container you created.
const dropinComponent = checkout.create('dropin').mount('#dropin-container');
}
It returns with:
tp.ts:50 POST https://checkoutshopper-test.adyen.com/checkoutshopper/v1/sessions/***/setup?clientKey=test_*** 422 lj @ http.ts:50 sj @ http.ts:108 T3 @ setup-session.ts:19 value @ CheckoutSession.ts:63 value @ core.ts:46 (anonymous) @ index.ts:14 _ @ regeneratorRuntime.js:53 (anonymous) @ regeneratorRuntime.js:135 (anonymous) @ regeneratorRuntime.js:79 Qd @ asyncToGenerator.js:4 i @ asyncToGenerator.js:23 (anonymous) @ asyncToGenerator.js:28 t @ export.js:18 (anonymous) @ asyncToGenerator.js:20 Y3 @ index.ts:15 (anonymous) @ index.ts:12 goDropin2 @ adyen.js:69 error @ adyen.js:32 c @ jquery.min.js:2 fireWith @ jquery.min.js:2 l @ jquery.min.js:2 (anonymous) @ jquery.min.js:2 load (async) send @ jquery.min.js:2 ajax @ jquery.min.js:2 S.<computed> @ jquery.min.js:2 goDropin @ adyen.js:3 onclick @ VM28 Adyen-Start:1 adyen.js:55 NETWORK_ERROR The provided session identifier or data is invalid. NETWORK_ERROR: The provided session identifier or data is invalid. at cj (https://checkoutshopper-test.adyen.com/checkoutshopper/sdk/5.39.0/adyen.js:1:198100)
How can I find out, what data is invalid?
Can anyone help please?
Upvotes: 0
Views: 611
Reputation: 11
The session id in the configuration for drop-in is not the reference for the sessions call. It's from the response ("id").
Upvotes: 1