payxy
v1.0.8
Published
**Payxy** is a lightweight JavaScript SDK that allows merchants and developers to easily integrate the Payxy payment gateway into their web applications via a seamless iframe experience.
Readme
Payxy Payment Gateway SDK
Payxy is a lightweight JavaScript SDK that allows merchants and developers to easily integrate the Payxy payment gateway into their web applications via a seamless iframe experience.
✨ Features
- Seamless iframe-based payment experience.
- Secure communication via
postMessage. - Simple setup and integration.
- Environment-aware (local and production origins).
- Custom callbacks for handling transaction results.
📦 Installation
Using npm
npm install payxyUsing yarn
yarn add payxy🛠️ Usage
1. Import and Initialize
import { Payxy } from "payxy";
const payxy = new Payxy({
accessCode: "YOUR_ACCESS_CODE",
onSuccess: (data) => {
console.log(data)
},
onError: (data) => {
console.log(data)
}
});2. Launch Payment
payxy.init();🧱 SDK Options
| Option | Type | Required | Description |
|--------------|----------|----------|-------------|
| accessCode | string | ✅ | Unique access code generated for the transaction |
| onSuccess | callback | ✅ | A callback function to get success data |
| onError | callback | ❌ | A callback funtion to get error data |
🧹 Cleanup
To close the payment modal or remove the iframe manually:
payxy.close();📄 License
MIT
