我是支付集成的新手。我需要在我的 php 页面中集成 MasterCard 支付网关服务。我有一个按钮PAY
,一旦点击,我就会重定向到下一页。我有以下代码:
<script type="text/javascript">
function errorCallback(error) {
console.log(JSON.stringify(error));
}
function cancelCallback() {
console.log('Payment cancelled');
}
Checkout.configure({
merchant: 'test001000000052',
order: {
amount: 100,
currency: 'AED',
description: 'Ordered goods',
id: '123'
},
interaction: {
merchant: {
name: 'test',
address: {
line1: '200 Sample St',
line2: '1234 Example Town'
},
cancelUrl:'10.0.1.100/?load=parents/online_payment'
}
}
});
</script>
</head>
<body>
<input type="button" value="Pay with Lightbox" onclick="Checkout.showLightbox();" />
<input type="button" value="Pay with Payment Page" onclick="Checkout.showPaymentPage();" />
</body>
当我单击任一按钮时,我在控制台中收到以下错误消息。
XHR failed loading: POST "https://eu-gateway.mastercard.com/api/page/version/51/pay".
{"cause":"INVALID_REQUEST","explanation":"Invalid credentials."}
我正确使用了商家 ID,可能是我遗漏了什么。我有用户名和密码,不知道在哪里添加这些参数。请帮我