Payment Gateway Library Crafted by the UNICODE Team.
A lightweight library for processing online payments and generating invoices with Moyasar, providing seamless payment info retrieval as well (🇸🇦💙🇧🇩❤️🇪🇬).
- Apple Pay
- Card support (Mada, Visa, AMEX and Mastercard)
- stc pay
UniPay.makePayment({
config: new UniPayConfig({
sKey: "sk_test_key",
environment: UniPayEnv.staging,
locale: UniPayLocale.ar,
}),
paymentData: new UniPayInvoiceDTO({
amount: 150.99 * 100, // (150.99 * 100) because 1 sr == 100 Halala's.
currency: UniPayCurrency.sar,
description: "Test payment",
expiredAt: "expiredAt - optional",
successUrl: "https://your-website.com/success",
backUrl: "https://your-website.com/back",
metadata: {
product_name: "your-product-name",
product_id: "abc123",
},
}),
});
UniPay.getPaymentTransactionById({
config: new UniPayConfig({ sKey: "sk_test_key" }),
transactionId: "abc12345",
});
UniPay.verifyPaymentByQueryParams({
config: new UniPayConfig({
sKey: "sk_test_key",
urlSearchParams:
"Optional: you can provide your own query-params, otherwise it will use the current url as default.",
}),
});