Example request;
const hsrcpayjs = require("hsrcpay.js");
hsrcpayjs.setConfig({
"username": "XXXX",
"clientid": "XXXX",
"clientsecret": "XXXX",
});
hsrcpayjs.createPayment("usd", "18.68", 0, "hpay", "papara_m").then((data) => {
console.log(data);
});
// 380 or "380";
hsrcpayjs.getPayment("380").then((data) => {
console.log(data);
});
Example request response;
{
"response": { "code": 200, "text": "Success" },
"status": true,
"data": {
"info": "Successfully created",
"payment": {
"id": "380",
"paymentid": "64493b525513e",
"pay_url": "https://hsrcpay.com/payment/pay.php?pid=380",
"price": 18.68,
"bank_code": "hpay",
"currency": "840",
"creation_date": "2023-04-26 17:55:14",
"force_subpayment": "papara_m"
}
}
}
{
"response": { "code": 200, "text": "Success" },
"status": true,
"data": {
"info": "Success",
"payment": {
"id": "380",
"paymentid": "64493b525513e",
"pay_url": "https://hsrcpay.com/payment/pay.php?pid=380",
"price": "18.68",
"bank_code": "hpay",
"currency": "840",
"status": "on the way",
"creation_date": "2023-04-26 17:55:14"
}
}
}