OFFICIAL SDks & QUICKSTART

Integration Guides &
Developer Libraries

Connect your application to GoDialPay's global payment rails with our production-ready client libraries in PHP, Node.js, Python, and cURL.

🐘
PHP SDK
● v2.4 (Latest)
🟢
Node.js
● v1.8 (Latest)
🐍
Python
● v1.4 (Latest)
REST / cURL
● Raw JSON HTTP
STEP 01

Install The SDK

Add the official GoDialPay SDK to your project using your preferred package manager.

Terminal Command Composer / NPM
# For PHP Projects (Composer)
composer require godialpay/godialpay-php

# For Node.js Environments
npm install @godialpay/sdk
STEP 02

Initialize & Create Charge

Authenticate with your API secret key and generate a hosted checkout URL for your customer.

PHP Example (checkout.php) PHP 8.x+
use GoDialPay\GoDialClient;

$client = new GoDialClient([
    'api_key' => 'godial_live_sec_9942a1b7e409'
]);

$charge = $client->charges->create([
    'amount'          => 120.00,
    'currency'        => 'USD',
    'settlement_rail' => 'USDT_TRC20',
    'order_id'        => 'ORD_772184',
    'customer_email'  => 'buyer@domain.com',
    'callback_url'    => 'https://yoursite.com/webhook.php'
]);

// Redirect customer to checkout URL
header('Location: ' . $charge->checkout_url);
exit;
STEP 03

Verify Real-Time Webhook

Confirm transaction finality and credit customer balances automatically when USDT settles.

PHP Webhook Listener (webhook.php) HMAC-SHA256
$payload = file_get_contents('php://input');
$sigHeader = $_SERVER['HTTP_X_GODIAL_SIGNATURE'];
$secret = 'whsec_884920bcf19024';

$isValid = hash_equals(hash_hmac('sha256', $payload, $secret), $sigHeader);

if ($isValid) {
    $event = json_decode($payload, true);
    if ($event['status'] === 'SETTLED_INSTANT') {
        // Unlock subscription or deliver products
    }
    http_response_code(200);
}