The IcadPay SDK simplifies payment integration for your application, enabling seamless processing of card payments, USSD transactions, QR code payments, and bank transfers. This SDK provides secure and efficient payment solutions to enhance your app's capabilities.
- Card Payments: Encrypt card details and securely process payments with OTP verification.
- USSD Payments: Fetch banks, initiate USSD payments, and verify transactions.
- QR Code Payments: Generate dynamic QR codes for transactions.
- Bank Transfers: Create virtual accounts and verify transfer transactions.
- Easy integration with a modular, developer-friendly interface.
Install the SDK via npm:
npm install icadpay-sdk
import IcadPaySDK from "icadpay-sdk";
const sdk = new IcadPaySDK({
publicKey: "your-public-key", // Replace with your public key
apiKey: "your-api-key", // Replace with your API key
environment: "sandbox", // Use "sandbox" or "production"
});
sdk.card
.makePayment(
{
pan: "1234 5678 9876 5432", // Card number
cvv: "123", // CVV
expiryDate: "12/25", // MM/YY
pin: "1234", // Card PIN
},
{
amount: 5000, // Amount in minor units (e.g., kobo for NGN)
customerId: "user@example.com",
transactionRef: "uniqueRef123",
}
)
.then(response => {
console.log("Payment Response:", response);
})
.catch(error => {
console.error("Payment Error:", error.message);
});
sdk.ussd
.getBanks()
.then(banks => {
console.log("Available Banks:", banks);
})
.catch(error => {
console.error("Error Fetching Banks:", error.message);
});
sdk.ussd
.initiatePayment({
amount: 5000,
reference: "uniqueRef123",
bankCode: "123", // Replace with a valid bank code
isBill: false,
})
.then(response => {
console.log("USSD Payment Initiated:", response);
})
.catch(error => {
console.error("USSD Payment Error:", error.message);
});
sdk.qr
.initiatePayment(5000) // Amount in minor units (e.g., kobo for NGN)
.then(response => {
console.log("QR Code Payment Data:", response);
})
.catch(error => {
console.error("QR Payment Error:", error.message);
});
sdk.bankTransfer
.createVirtualAccount({
transaction: {
amount: 5000, // Amount in minor units (e.g., kobo for NGN)
customer: {
firstname: "John",
surname: "Doe",
email: "john.doe@example.com",
mobile_no: "+2347012345678",
},
},
})
.then(response => {
console.log("Virtual Account Created:", response);
})
.catch(error => {
console.error("Bank Transfer Error:", error.message);
});
The SDK supports the following configurations:
Parameter | Type | Description |
---|---|---|
publicKey |
String | Your public key for encryption. |
apiKey |
String | Your API key for authentication. |
environment |
String | Set to "sandbox" for testing or "production" for live transactions. |
All SDK methods return Promises. Use .catch()
to handle errors:
sdk.card
.makePayment(cardDetails, transactionDetails)
.catch(error => {
console.error("Error Message:", error.message);
});
- Clone this repository.
- Run tests using your test framework (e.g., Jest or Mocha).
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push the branch.
- Submit a pull request.
This project is licensed under the MIT License.
If you have questions or need assistance, reach out to our support team:
- Email: support@icadpay.com
- Documentation: icadpay.com/developers
Feel free to customize this template further to suit your brand and SDK requirements.