SDK Library

Official client libraries for PHP, Node.js, Python, React, HTML & vanilla JavaScript. All SDKs follow the same flow: createPayment → hosted checkout → poll status → verify.

Quick start
Replace pk_live_xxx with your public key from Dashboard → API Keys.
<?php
require 'FastPayGlobal.php';
use FastPayGlobal\Client;

$ps = new Client([
  'publicKey'     => 'pk_live_xxx',
  'webhookSecret' => 'whsec_xxx',
]);

$p = $ps->createPayment([
  'amount'   => 500,
  'currency' => 'BDT',
  'orderId'  => 'ORDER-' . time(),
  'customer' => ['email' => 'buyer@example.com'],
]);

header('Location: ' . $p['hostedUrl']);

// Webhook receiver:
$raw = file_get_contents('php://input');
if ($ps->verifyWebhook($raw, $_SERVER['HTTP_X_SIGNATURE'] ?? '')) {
  $event = json_decode($raw, true);
  // mark order paid
}
Common API

createPayment(input) → returns { id, hostedUrl, status, expiresAt }

getPayment(id) → returns the latest payment object

verifyPayment(id, trxId, sender?) → manually attach a transaction id

verifyWebhook(rawBody, signature) → HMAC-SHA256 with your webhook_signing_secret

States: pending → awaiting_confirmation → paid | expired | failed | cancelled

Errors: network_error, api_error_4xx/5xx, timeout