Skip to content

A library for making online payment by using Moyasar payment gateway developed by UNICODE Team.

License

Notifications You must be signed in to change notification settings

UNICODE-Venture/uni-pay-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 (🇸🇦💙🇧🇩❤️🇪🇬).

Features support

UniPay Payment

  • Apple Pay
  • Card support (Mada, Visa, AMEX and Mastercard)
  • stc pay

UniPay

Getting started and make your payment using the gateway.

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",
    },
  }),
});

Get payment transaction details from Moyasar using the paymentId or transactionId

UniPay.getPaymentTransactionById({
  config: new UniPayConfig({ sKey: "sk_test_key" }),
  transactionId: "abc12345",
});

Verify transaction from the callback url using the query-params, by your own if needed.

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.",
  }),
});

If you enjoyed it, then give it a star ⭐️ and like 👍🏻 and for more arts & crafts 🎨 from our team kindly visit here Team UNICODE. Until next time, keep coding and stay awesome 😉

About

A library for making online payment by using Moyasar payment gateway developed by UNICODE Team.

Resources

License

Stars

Watchers

Forks