payunitjs

1.0.8 • Public • Published

Payunit SDK for Javascript applications.

This SDK is designed to support applications developed in vanilla Javascript and some popular frontend frameworks like React and VueJs. However, If you develop applications using the angular framework, you may consider using our angular sdk for Payunit.

Installation

In the terminal, run

npm install payunitjs

Usage

In your checkout js file, do as follows;

 import { PayUnit } from "node_modules/payunitjs/dist/payunit.min.js";
  PayUnit(
    {
      apiUsername: "",
      apiPassword: "",
      x_api_key: "",
      mode: "",
    },
    {
      return_url: " ",
      notify_url: " ",
      description: "",
      purchaseRef: "",
      total_amount: "",
      name: "",
      currency: "XAF"
    }
  );

Using the sdk from its official CDN

<script type="module">
  import { PayUnit } from "https://cdn.jsdelivr.net/npm/payunitjs@1.0.8/dist/payunit.min.js";
  PayUnit(
    {
      apiUsername: "",
      apiPassword: "",
      x_api_key: "",
      mode: "",
    },
    {
      return_url: " ",
      notify_url: " ",
      description: "",
      purchaseRef: "",
      total_amount: "",
      name: "",
      currency: "XAF"
    }
  );
</script>

In the template or html file, type the following

  <button id = "payunit-pay"> Pay </button>

After successfully integrating and testing in sandbox, to go live, you simply need to change to live credentials and the mode to live mode.

Package Sidebar

Install

npm i payunitjs

Weekly Downloads

0

Version

1.0.8

License

ISC

Unpacked Size

4.47 kB

Total Files

3

Last publish

Collaborators

  • sinclairekambang