1. Documentation

Bohudur PHP Integration Guide


This guide walks you through integrating the Bohudur payment gateway using PHP.

Download bohudur.phpfile.

Download php-sample.zipfile.

Step 1: Include the Bohudur Library

define('BOHUDUR', true);
require 'bohudur.php';

Step 2: Initialize Bohudur

$bohudur = new Bohudur("YOUR_API_KEY");

Step 3: Create a Payment Request

Create create.php:

define('BOHUDUR', true); require 'bohudur.php'; $bohudur = new Bohudur("YOUR_API_KEY"); $data = [ 'fullname' => 'Jane Doe', 'email' => '[email protected]', 'amount' => 100, 'return_type' => 'GET', 'currency' => 'BDT', 'redirect_url' => 'http://yourdomain.com/callback.php', 'cancelled_url' => 'http://yourdomain.com/cancelled.php' ]; $response = $bohudur->sendRequest($data); if (isset($response['payment_url'])) { header('Location: ' . $response['payment_url']); exit; } else { echo $response['message']; }

Step 4: Handle Callback (Success)

Create callback.php:

define('BOHUDUR', true); require 'bohudur.php'; if (isset($_GET['payment_key'])) { $paymentkey = $_GET['payment_key']; $bohudur = new Bohudur("YOUR_API_KEY"); $response = $bohudur->executePayment($paymentkey); if (isset($response['Status']) && $response['Status'] === 'EXECUTED') { echo json_encode($response); } else { echo $response['message']; } } else { exit; }

Step 5: Handle Cancellation

Create cancelled.php:

<?php exit("Payment Cancelled");

Step 6: Verify Payment (Optional)

You can verify a payment manually:

$response = $bohudur->verifyPayment("PAYMENT_KEY");
echo json_encode($response);

Important Notes

Execute / Verify Response (Example)

When a payment is successfully executed or verified, the response will look like this:

    {
      "Full Name": "Demo",
      "Email": "[email protected]",
      "Amount": 10,
      "Converted Amount": 10,
      "Total Amount": 10,
      "Currency": "BDT",
      "Currency Value": 1,
      "Metadata": "[]",
      "Time": "2025-05-21 12:07:53",
      "Payment Key": "qIHoHsKVC1IBkRWUE1r0",
      "Webhook": "[]",
      "MFS": "bkash",
      "Method": "Send Money",
      "Number": "01700000000",
      "Transaction ID": "CETO5L00E8",
      "Payment Time": "10/03/2025 10:49",
      "Status": "EXECUTED"
    }