NullPay API Documentation

Integration guide for creating payment URLs, verifying transactions, and downloading ready-made modules.

Welcome To NullPay Docs

Last updated: 2024-06-06

NullPay is a secure payment automation tool designed to use personal accounts as a payment gateway. Here you will find a complete overview for API integration and payment flow handling.

API Introduction

NullPay enables merchants to receive payments by redirecting customers to secure checkout. After payment, customer is returned to merchant site and transaction details are shared.

API Operation

Use Sandbox for testing and Live for production. Your server must support cURL. HTML form POST integration is also available.

Create Payment URL Endpoint
https://secure-pay.nullphpscript.eu.org/api/payment/create
Payment Verify Endpoint
https://secure-pay.nullphpscript.eu.org/api/payment/verify

Parameter Details

Variables required for create payment request

Field NameDescriptionRequiredExample Values
cus_nameCustomer Full NameYesJohn Doe
cus_emailEmail address of the customerYesjohn@gmail.com
amountTotal payable amountYes10 / 10.50 / 10.6
success_urlReturn URL after successful paymentYeshttps://yourdomain.com/success.php
cancel_urlReturn URL after canceled paymentYeshttps://yourdomain.com/cancel.php
meta_dataPass any JSON formatted dataNo{"order":"123"}

Variables required for verify payment request

Field NameDescriptionRequiredExample Values
transaction_idTransaction id received from success URL query parameterYesOVKPXW165414

Headers Details

Header NameValue
Content-Typeapplication/json
API-KEYApp key from API credentials
SECRET-KEYSecret key from API credentials
BRAND-KEYBrand key from Brands

Integration

You can integrate our payment gateway into PHP, Laravel, WordPress, and WooCommerce sites.

Sample Request

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://secure-pay.nullphpscript.eu.org/api/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 =>'{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"016****"},"amount":"10"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ?> 
 <?php $client = new Client(); $headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json' ]; $body = '{ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }'; $request = new Request('POST', 'https://secure-pay.nullphpscript.eu.org/api/payment/create', $headers, $body); $res = $client->sendAsync($request)->wait(); echo $res->getBody(); ?> 
 const axios = require('axios'); let data = JSON.stringify({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }); let config = { method: 'post', maxBodyLength: Infinity, url: 'https://secure-pay.nullphpscript.eu.org/api/payment/create', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json' }, data : data }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); 
 import requests import json url = "https://secure-pay.nullphpscript.eu.org/api/payment/create" payload = json.dumps({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "metadata": { "phone": "016****" }, "amount": "10" }) headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) 
 package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://secure-pay.nullphpscript.eu.org/api/payment/create" method := "POST" payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","metadata":{"phone":"01521412457"},"amount":"10"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } 
Response Details
Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response
Completing payment redirects users to success/cancel page with query params:
yourdomain.com/(success/cancel)?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=pending or success or failed

Verify Request

<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://secure-pay.nullphpscript.eu.org/api/payment/verify', 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 =>'{"transaction_id":"ABCDEFH"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json' ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
<?php
$client = new Client();
$headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json'
];
$body = '{ "transaction_id": "ABCDEFH"
}';
$request = new Request('POST', 'https://secure-pay.nullphpscript.eu.org/api/payment/verify', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?>
const axios = require('axios');
let data = JSON.stringify({ "transaction_id": "ABCDEFH"
});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://secure-pay.nullphpscript.eu.org/api/payment/verify', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json' }, data : data
};
axios.request(config)
.then((response) => { console.log(JSON.stringify(response.data));
})
.catch((error) => { console.log(error);
});
import http.client
import json
conn = http.client.HTTPSConnection("local.pay.expensivepay.com")
payload = json.dumps({ "transaction_id": "ABCDEFH"
})
headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json'
}
conn.request("POST", "/api/payment/verify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import ( "fmt" "strings" "net/http" "io/ioutil"
)
func main() { url := "https://secure-pay.nullphpscript.eu.org/api/payment/verify" method := "POST" payload := strings.NewReader(`{"transaction_id":"ABCDEFH"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))
}
{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": { "phone": "015****" }, "payment_method": "bkash", "status": "COMPLETED"
}
Response Details
Field Name Type Description
Success Response
statusstringCOMPLETED or PENDING or ERROR
cus_nameStringCustomer Name
cus_emailStringCustomer Email
amountStringAmount
transaction_idStringTransaction id generated by system
metadatajsonMetadata used for payment creation
Error Response
statusboolFALSE
messageStringMessage associated with the error response

WordPress Module

See Setup Video: Video here

WHMCS Module

See Setup Video: Video here

SMM Panel Module

See Setup Video: Video here

Modified SMM Panel Module

See Setup Video: Video here

Mobile App

See Setup Video: Video here