react-alatpay
v1.2.6
Published
React-sdk for alatpay
Downloads
191
Maintainers
Readme
Introduction
This is a react library for implementing ALATPAY payment gateway into your web application built with react framework
Installation
npm install react-alatpay
Usage
import React from 'react'
import UseALATPay from "react-alatpay"
Function Page(){
const submit=()=>{
const config= UseALATPay({
amount: 100,
apiKey: "14feff9729184eb09e0385184efc1816",
businessId: "582418f7-032f-48ca-27c8-08dcd31fac98",
currency: "NGN",
email: "[email protected]",
firstName:'John',
lastName:'Doe',
metadata:{},
phone:'09099912345',
onClose: () => {
console.log("Payment popup closed")},
onTransaction: (response:any) => {
console.log("Transaction response:", response);
},
})
config.submit()
}
return (
<>
<p>Enter your Information</p>
<form >
<input/>
<button type='submit' onClick={()=>submit()}>Pay</button>
</form>
</>
)
}
export default PageMetadata field
The metadata field is an objects that allows you to pass other required information
//other required fields
metadata:{referenceNumber:"1234231", state:"Lagos",country:"Nigeria"}
Deployment
Kindly update the apiKey and businessId with your live credentials
To retrive your businessId
- Log in to your account.
- Navigate to Settings.
- Click on Business to find your Business ID.
Obtain your API-Key
- Log in to your account.
- Navigate to Settings.
- Select Business
- Click on View to see your API keys.
- Copy either the Primary Key or the Secondary Key as needed
How to Contribute
- Fork it
- Create a branch :
git checkout -b feature - Commit your changes:
git commit -m 'commit message' - Push to your branch:
git push origin feature - Create a pull request
