1.0.7 • Published 6 months ago

payos-checkout v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Instructions for using the Payos-Checkout library for Payos integrated applications

This library will help you open payment links or payment pop ups on React JS applications

1. Installation

Make sure you have the payos-checkout library installed

     npm install payos-checkout

2. Initialization

import { usePayOS, PayOSConfig } from "payos-checkout";

const payOSConfig: PayOSConfig = {
   RETURN_URL: "YOUR_RETURN_URL",
   ELEMENT_ID:
     "YOUR_ELEMENT_ID is the id of the outermost div containing the react application",
   CHECKOUT_URL: "YOUR_CHECKOUT_URL is the payment Link id",
   onSuccess: (event: any) => {
     //TODO: Action when the order is successfully paid
   },
   onExit: (event: any) => {
     //TODO: Action when the user clicks to exit the checkout
   },
   onCancel: (event: any) => {
     //TODO: Action when the user clicks to cancel order
   },
};

const { exit, open } = usePayOS(payOSConfig);

3. How to use

  • Function open(): Immediately display the payment interface
  • Function exit(): Will close the payment interface

Parameters in events:

     {
         status: string;
     }
1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago