我的应用程序是适用于Android的ionic 4移动应用程序。我正在使用PayHere沙箱作为付款网关。我在我的应用程序中安装了cordova-payhere-client,但没有任何有关如何使用它的文档。如果有人可以为打字稿实现提供示例代码,那就太好了。谢谢
window.payhereClient.checkout({
merchantId: '<PAYHERE_SANDBOX_MERCHANT_ID>',
merchantSecret: '<PAYHERE_SANDBOX_MERCHANT_SECRET>',
amount: 1180.50, // Amount which the customer should
pay
currency: 'LKR',
orderId: '123',
itemsDescription: 'Desc',
custom1: '',
custom2: '',
customer: {
firstName: 'Dan',
lastName: 'Jay',
email: 'shandanjay@gmail.com',
phone: '0715753168'
},
billing: {
address: '5A',
city: 'Colombo',
country: 'Sri Lanka'
},
shipping: {
address: 'Park Avenue',
city: '5A',
country: ''
}
},
function (param) {
console.log(param);
},
function (param) {
console.log(param);
}
);
我已使用此代码,并且payhereClient未定义。我该如何解决打字稿问题?