PHP API Integration Integration
Streamline your custom PHP applications with a direct, server-to-server cryptocurrency gateway. By including the lightweight PayerUrlRequest.php class, you can securely process Binance Pay and multi-chain crypto transactions straight to your private wallet. Automate order statuses instantly via secure backend webhooks (notify_url) with 0% middleman fees and absolute server-side security.
About This Integration
Everything you need to know about setting up this payment gateway
Elevate your custom PHP web applications with a direct, server-to-server gateway powered by PayerURL. Our lightweight integration class (PayerUrlRequest.php) removes frontend friction and connects your backend natively to secure crypto processing. Direct Wallet Integration: Accept Binance Pay and major cryptocurrencies straight to your private wallet instantly with zero middleman holding windows. Automated Webhooks: Features an asynchronous notify_url callback structure to credit accounts or update order statuses the moment the blockchain confirms the block. Total Security: Handled completely server-side via backend APIs, keeping your credentials hidden and giving you total design custody over user flow.
Need a Custom Solution?
For high-volume marketplaces, multi-vendor stores, and large enterprises. Get custom token integrations, dedicated API routing, and 24/7 priority developer support.
Why Developers Choose This Package
No Merchant Account Needed
Payments go directly to your crypto wallet with zero middleman holding
169+ Fiat Currencies
USD, EUR, GBP, CAD and more โ converted at live real-time rates
5-Minute Integration
Include one lightweight PHP class and you're live
Server-Side Security
Credentials stay hidden โ all calls are backend only
Binance QR Code Payments
Customers scan and pay without ever leaving your site
Zero Hidden Fees
No network surcharges or platform fees on the integration
PHP 7.4+ Compatible
Works with any modern PHP version โ just curl + json
Async Webhook Callbacks
notify_url receives server-to-server POST on every payment
Installation Guide
Follow these steps to get up and running in 5 Min Setup
1๐ Requirements
- PHP 7.4 or higher
- PHP extensions: curl, json
- A publicly accessible HTTPS domain for the notify_url webhook
- Free PayerURL merchant account at dash.payerurl.com
2๐ Get Your API Keys (Free)
- Sign up at dash.payerurl.com โ takes under 2 minutes
- Go to Dashboard โ Get API Credentials
- Copy your Public Key and Secret Key
๐ No credit card required. Get your keys at: dash.payerurl.com/profile/api-management
3โ๏ธ Quick Start Configuration
Set your order details, customer info, and API keys:
// 1. Set your order details
$invoiceid = floor(microtime(true) * 1000); // unique order ID
$amount = 120.00;
$currency = 'usd';
// 2. Set customer info
$billing_fname = 'John';
$billing_lname = 'Doe';
$billing_email = '[email protected]';
// 3. Set URLs
$redirect_to = 'https://yoursite.com/payment-success';
$notify_url = 'https://yoursite.com/payment-notify';
$cancel_url = 'https://yoursite.com/checkout';
// 4. Set API keys (use env vars in production)
$payerurl_public_key = $_ENV['PAYERURL_PUBLIC_KEY'];
$payerurl_secret_key = $_ENV['PAYERURL_SECRET_KEY'];4๐ Build the Items Array
Each item must use underscores instead of spaces in the name:
$items = [
[
'name' => 'Product_Name', // No spaces โ use underscore
'qty' => '2', // String, integer value
'price' => '60.00', // String, float value
]
];5๐ Full Payment Request Example
<?php
$invoiceid = floor(microtime(true) * 1000);
$amount = 120.00;
$currency = 'usd';
$billing_fname = 'John';
$billing_lname = 'Doe';
$billing_email = '[email protected]';
$redirect_to = 'https://yoursite.com/payment-success';
$notify_url = 'https://yoursite.com/payment-notify';
$cancel_url = 'https://yoursite.com/checkout';
$payerurl_public_key = $_ENV['PAYERURL_PUBLIC_KEY'];
$payerurl_secret_key = $_ENV['PAYERURL_SECRET_KEY'];
$items = [
['name' => 'Product_Name', 'qty' => '10', 'price' => '12.00']
];
$args = [
'order_id' => $invoiceid,
'amount' => $amount,
'items' => $items,
'currency' => strtolower(trim($currency)),
'billing_fname' => $billing_fname,
'billing_lname' => $billing_lname,
'billing_email' => $billing_email,
'redirect_to' => $redirect_to,
'notify_url' => $notify_url,
'cancel_url' => $cancel_url,
'type' => 'php',
];
ksort($args);
$args = http_build_query($args);
$signature = hash_hmac('sha256', $args, $payerurl_secret_key);
$authStr = base64_encode($payerurl_public_key . ':' . $signature);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api-v2.payerurl.com/api/payment',
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $args,
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',
'Authorization: Bearer ' . $authStr,
],
]);
$response = json_decode(curl_exec($ch));
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200 && !empty($response->redirectTO)) {
header('Location: ' . $response->redirectTO);
}
exit();6๐ Webhook โ Payment Notify Handler
PayerURL POSTs to your notify_url after every payment. Add your order update logic where shown:
// โ
All security checks passed at this point
$data = ['status' => 2040, 'message' => $GETDATA];
// YOUR CODE HERE โ e.g.:
// DB::update('orders', ['status' => 'paid'], ['id' => $GETDATA['order_id']]);
// sendConfirmationEmail($GETDATA['billing_email']);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);
exit();โ ๏ธ notify_url must be a publicly accessible HTTPS URL. Localhost will not receive callbacks.
Supported Coin Networks
140433544912โโAPI Reference
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | int | โ | Unique order ID โ must never repeat |
amount | float | โ | Total order amount (e.g. 120.00) |
currency | string | โ | Lowercase currency code (e.g. usd, eur) |
items | array | โ | List of order items |
billing_fname | string | โ | Customer first name |
billing_lname | string | โ | Customer last name |
billing_email | string | โ | Customer email address |
redirect_to | string | โ | URL after successful payment |
notify_url | string | โ | Server-to-server payment callback URL |
cancel_url | string | โ | URL if customer cancels |
type | string | โ | Always set to "php" |
Webhook Status Codes
| status_code | Meaning | Action |
|---|---|---|
200 | Payment successful | โ Update order to paid |
20000 | Payment cancelled | โ Mark order as cancelled |
Other | Payment incomplete | โ Do not fulfil the order |
URL Roles
| URL | When It's Called |
|---|---|
redirect_to | Customer is sent here after successful payment |
notify_url | PayerURL POSTs payment details here (server-to-server) |
cancel_url | Customer is sent here if they cancel the payment |
Full Payment Flow
Your PHP app builds the signed payment payload and POSTs to PayerURL API
API returns a redirectTO checkout URL on success (HTTP 200)
Customer is redirected to the secure hosted checkout page
Customer pays via Binance QR code or any supported crypto network
Blockchain confirms the transaction โ funds land directly in your wallet
PayerURL POSTs a signed webhook to your notify_url with full payment data
Your PHP App โ PayerURL API โ Checkout Page โ Customer Pays (Binance/Crypto)
โ
Your Wallet โ Funds (instant) โ Payment Verified โ Blockchain
โ
Your notify_url โ Webhook POST (signed, with full order data)๐ก๏ธ Security Checklist
- Public key verified before processing
- HMAC-SHA256 signature verified with hash_equals() (timing-safe)
- transaction_id and order_id presence validated
- status_code checked before fulfilling order
- Check that order_id exists in your database
- Prevent replay โ check order not already marked paid
- Validate confirm_rcv_amnt matches expected order amount
๐ Never expose your secret_key in client-side code. Always use environment variables in production.
Requirements
- PHP 7.4+ with curl and json extensions
- Free PayerURL merchant account
- A crypto wallet address to receive payments
- Publicly accessible HTTPS domain for notify_url
- No KYC required for basic accounts
๐งพ MIT License โ free for personal and commercial use.