我正在尝试在 Adyen 中实现会话(5.0.0),但似乎没有创建 AdyenCheckout。
在“const checkout”变量中,我得到了这个。
我没有尝试按照 adyne 文档使用“等待”。
任何解决方法?这是我的尝试。
$.ajax({
type: "GET",
url: sessionDataUrl,
dataType: "json",
contentType: 'application/json',
success: function(data) {
try {
const configuration = {
clientKey,
locale: "en_US",
environment: "test",
session: {
id: data.id,
sessionData: data.sessionObject
},
showPayButton: true,
paymentMethodsConfiguration: {
ideal: {
showImage: true,
},
card: {
hasHolderName: true,
holderNameRequired: true,
name: "Credit or debit card",
},
},
onSubmit: (state, component) => {
if (state.isValid) {}
},
onPaymentCompleted: (result, component) => {
console.info("onPaymentCompleted");
console.info(result, component);
},
onError: (error, component) => {
console.error("onError");
console.error(error.name, error.message, error.stack, component);
},
onAdditionalDetails: (state, component) => {
},
};
const checkout = new AdyenCheckout(configuration);
const cardComponent = checkout.create('card').mount(document.getElementById('card'));
} catch (error) {
console.error(error);
}
}
});