我无法在我的 IONIC4 和 Angular8 应用程序中使用自定义卡安全字段呈现 Adyen Payment
我每一步都遵循 Adyen 文档,但它仍然没有呈现。我已经在我的 Index.html、我的 PaymentsPage.html 文件中进行了修改
1 Index.html file
//Added checkout script and stylesheet
<head>
<script src="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.2.0/adyen.js"></script>
<link rel="stylesheet" href="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.2.0/adyen.css" />
</head>
//Added configuration,checkout mount in my body of Index.html in the
bottom
<body>
<script type="text/javascript">
const configuration = {
rootNode: 'securedfields',
showPayButton: true,
onSubmit: handleOnSubmit,
amount: { // Optional. Used to display the amount in the Pay
Button.
value: 1000,
currency: 'EUR'
}
};
const checkout = new AdyenCheckout(configuration);
const sf = checkout.create('securedfields', {
type: 'card',
groupTypes: ['mc', 'visa', 'amex', 'bcmc', 'maestro'],
styles: {
error: {
color: 'red'
},
validated: {
color: 'green'
},
placeholder: {
color: '#d8d8d8'
}
},
placeholders: {
encryptedCardNumber: '9999 9999 9999 9999',
encryptedExpiryDate: 'mm/yy',
encryptedSecurityCode: '1234'
},
ariaLabels: {
lang: 'en-GB',
encryptedCardNumber: {
label: 'Credit or debit card number field'
}
},
// Events
onChange: function() {},
onValid : function() {},
onLoad: function() {},
onConfigSuccess: function() {},
onFieldValid : function() {},
onBrand: function() {},
onError: function() {},
onFocus: function() {},
onBinValue: function(bin) {}
}).mount('#securedfields');
function handleOnSubmit(state, component) {
state.isValid // True or false. Specifies if all the information that the
shopper provided is valid.
state.data // Provides the data that you need to pass in the `/payments`
call.
component // Provides the active component instance that called this
event.
}
</script>
</body>
2) 我的securepayment.page.html 文件中的更改
<div id="securedfields">
<label>
<span>Card number:</span>
<span data-cse="encryptedCardNumber"></span>
</label>
<label>
<span>Expiry date:</span>
<span data-cse="encryptedExpiryDate"></span>
</label>
<label>
<span>CVV/CVC:</span>
<span data-cse="encryptedSecurityCode"></span>
</label>
</div>
我收到错误消息 - 无法安装未找到组件根节点。
我期待我应该看到支付页面,当我提交它应该以加密方式提交数据