ZiniPay Documentation
ZiniPay Documentation
Introduction to ZiniPay
ZiniPay is a simple and secure payment automation tool designed to use personal accounts as a payment gateway, allowing you to accept payments from customers through your website. This documentation provides a complete overview of how ZiniPay works and how you can integrate the ZiniPay API into your website.
API Introduction
ZiniPay Payment Gateway enables Merchants to receive money from their customers by temporarily redirecting them to ZiNiPay.com. The gateway connects multiple payment terminals including card systems, mobile financial systems, and local and international wallets. After the payment is complete, the customer is returned to the merchant's site, and seconds later the Merchant receives notification about the payment along with the details of the transaction.
API Operation
REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order URL with your test credentials to make calls to the Sandbox URIs. When you're set to go live, use the live credentials assigned to your new signature key to generate a live order URL to be used with the live URIs. Your server must support the cURL system.
Live API End Point (For Create Payment URL):
https://api.zinipay.com/v1/payment/create
Create Payment Examples
The following examples show how to create a payment request with the ZiniPay API in various programming languages.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.zinipay.com/v1/payment/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"redirect_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","metadata":{"phone":"016****"},"amount":"10"}',
CURLOPT_HTTPHEADER => array(
'zini-api-key: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Response Example
{
"status": true,
"message": "Payment URL generated successfully",
"payment_url": "https://secure.zinipay.com/payment/abc123xyz456"
}
Required Parameters
Parameter | Description | Required | Example |
---|---|---|---|
amount | The payment amount in your currency | Yes | 10.00 |
redirect_url | URL where customer will be redirected after successful payment | Yes | yourdomain.com/success |
cancel_url | URL where customer will be redirected after cancellation | Yes | yourdomain.com/cancel |
Verify Payment
After a payment is completed, you might want to verify its status. ZiniPay provides an API endpoint to verify payment status using the transaction ID.
Payment Verify API:
https://api.zinipay.com/v1/payment/verify
Variables Needed For Payment Verification
Field Name | Description | Required | Example Values |
---|---|---|---|
val_id | Transaction ID received as a query parameter from the success URL provided during payment creation. | No | OVKPXW165414 |
invoiceId | Transaction ID received as a query parameter from the success URL provided during payment creation. | Yes | 553ca0ac-28c0-41f7-adc0-6243710b1e1b |
<?php
// Verify Payment Example
$apiKey = "YOUR_API_KEY";
$secretKey = "YOUR_SECRET_KEY";
// Initialize cURL session
$ch = curl_init();
// Transaction ID received from success URL
$invoiceId = $_GET['invoiceId'];
// Prepare data for API request
$data = [
'invoiceId' => $invoiceId,
'merchantId' => 'YOUR_MERCHANT_ID',
'apiKey' => $apiKey
];
// Configure cURL request
curl_setopt($ch, CURLOPT_URL, 'https://api.zinipay.com/v1/payment/verify');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $secretKey
]);
// Execute request and get response
$response = curl_exec($ch);
curl_close($ch);
// Process the response
$paymentData = json_decode($response, true);
if ($paymentData && isset($paymentData['status']) && $paymentData['status'] === 'success') {
// Payment is verified, process order
echo "Payment verified successfully!";
echo "Transaction ID: " . $paymentData['data']['transactionId'];
echo "Amount: " . $paymentData['data']['amount'];
// Update your database, fulfill the order, etc.
} else {
// Payment verification failed
echo "Payment verification failed: " . ($paymentData['message'] ?? 'Unknown error');
}
?>
Response Example
{
"status": "success",
"message": "Payment verification successful",
"data": {
"transactionId": "OVKPXW165414",
"invoiceId": "553ca0ac-28c0-41f7-adc0-6243710b1e1b",
"amount": "900.00",
"currency": "USD",
"paymentMethod": "card",
"status": "COMPLETED",
"customerName": "John Doe",
"customerEmail": "[email protected]",
"metadata": {
"orderId": "ORD-12345",
"productId": "PROD-567"
},
"createdAt": "2023-09-15T14:23:45Z"
}
}
API Reference
Comprehensive documentation of all available ZiniPay API endpoints.
Payment Endpoints
- POST/v1/payment/create
- POST/v1/payment/verify
Tools & SDKs
ZiniPay provides various tools and SDKs to help you integrate faster.
WordPress Plugin
Easy integration with WordPress sites. Add ZiniPay payment gateway to your WooCommerce store.
DownloadWordPress & WooCommerce Integration
ZiniPay offers a seamless integration with WordPress and WooCommerce, allowing you to accept payments in Bangladesh through bKash, Nagad, and Rocket with a simple plugin installation. Our automatic payment gateway solution works with both merchant and personal accounts.
Plugin Download:
Download ZiniPay WordPress Plugin v1.2Features of ZiniPay WordPress Plugin
bKash Integration
Accept payments through bKash personal or merchant accounts with automatic transaction verification.
Nagad Integration
Process payments via Nagad personal accounts with automated payment confirmation.
Rocket Payment Gateway
Accept Rocket payments through our automated system without manual verification.
WooCommerce Compatible
Fully compatible with WooCommerce for seamless e-commerce integration.
Installation Guide
Download the Plugin
Download the latest version of the ZiniPay WordPress plugin from the link above.
Install the Plugin
Login to your WordPress admin dashboard. Go to Plugins - Add New - Upload Plugin. Choose the downloaded ZIP file and click "Install Now".
Activate the Plugin
After installation, click "Activate Plugin" to enable ZiniPay on your WordPress site.
Configure Settings
Go to WooCommerce - Settings - Payments. Find "ZiniPay" and click "Manage". Enter your ZiniPay API credentials and customize settings according to your needs.
Enable Payment Methods
Choose which payment methods to enable (bKash, Nagad, Rocket) and save your settings.
Configuration Options
Option | Description | Example |
---|---|---|
API Key | Your ZiniPay API key from your dashboard | zp_api_abc123xyz789 |
Secret Key | Your ZiniPay Secret Key for secure transactions | zp_secret_def456uvw321 |
Payment Title | Text displayed to customers during checkout | Pay with bKash/Nagad/Rocket |
Payment Description | Detailed description of the payment method | Pay securely using your mobile banking app |
Benefits of Using ZiniPay with WordPress
No Merchant Account Required - Use personal bKash, Nagad, or Rocket accounts for accepting payments.
Automatic Payment Verification - No need to manually check transactions; our system automatically verifies payments.
Easy Customer Experience - Seamless checkout process with clear payment instructions.
Automatic Order Status Updates - Orders automatically transition from "Pending" to "Processing" upon successful payment.
Important Note
Make sure to configure IPN (Instant Payment Notification) URL in your ZiniPay dashboard to match your WordPress site's URL. This ensures automatic payment verification works correctly.