@togtokh.dev/hipay
v0.0.2
Published
hipay is a library for payment gateway.
Downloads
7
Readme
HIPAY
Example
import HIPAY from "@togtokh.dev/HIPAY";
HIPAY.auth
.TOKEN("staging", {
entityId: "sellerte",
token: "FQ5ByAS79LwoVtDT3UyDPp",
})
.then(async (r) => {
console.log(r);
const invoice = await HIPAY.payment.eCommerce.CREATE({
entityId: "sellerte",
amount: 100,
currency: "MNT",
});
if (invoice.success && invoice.data) {
const payment = await HIPAY.payment.eCommerce.PAYMENT({
checkoutId: invoice.data?.checkoutId,
shopperResultUrl: "https://developers.hipay.mn/",
shopperCancelUrl: "https://developers.hipay.mn/",
lang: "mn",
});
console.log(payment);
const check = await HIPAY.payment.eCommerce.CHECKOUT(
invoice.data?.checkoutId
);
console.log(check);
}
})
.catch((e) => {
console.log(e);
});