Welcome To দেশি পে Docs Last updated: 2024-06-06

দেশি পে is a simple and secure payment automation tool designed to use your personal account as a payment gateway, enabling you to accept payments from your customers through your website. Here you will find a complete overview of how দেশি পে works and how you can integrate the দেশি পে API into your website.

API Introduction

দেশি পে Payment Gateway enables merchants to receive money from their customers by temporarily redirecting them to www.দেশি পে.com. The gateway connects multiple payment terminals including card systems, mobile financial services, and local and international wallets. After the payment is complete, the customer is returned to the merchant's site and seconds later the merchant receives a notification about the payment along with the details of the transaction. This document is intended to be utilized by technical personnel supporting the online merchant's website. Working knowledge of HTML forms or cURL is required. You will probably require test accounts for which you need to open accounts by contacting দেশি পে.com or use the ones already provided to you.

API Operation

REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order URL with your test credentials to make calls to the Sandbox URIs. When you’re set to go live, use the live credentials assigned to your new signature key to generate a live order URL to be used with the live URIs. Your server has to support the cURL system. For HTML Form submission, please review the section after the cURL part; we provide the HTML POST method URL as well.

Live API End Point (For Create Payment URL)

https://paybd.one/api/payment/create

Payment Verify API

https://paybd.one/api/payment/verify

Parameter Details

Variables needed to POST to initialize the payment process in the gateway URL.
Field Name Description Required Example Values
cus_name Customer Full Name Yes John Doe
cus_email Email address of the customer Yes [email protected]
amount The total amount payable. Please note that you should skip the trailing zeros in case the amount is a natural number. Yes 10 or 10.50 or 10.6
success_url URL to which the customer will be returned when the payment is made successfully. Yes https://yourdomain.com/success.php
cancel_url URL to return the customer to your product page or home page. Yes https://yourdomain.com/cancel.php
meta_data Pass any JSON formatted data No JSON Formatted
Variables needed for Payment Verify.
Field Name Description Required Example Values
transaction_id Transaction ID received as a query parameter from the success URL. Yes OVKPXW165414

Headers Details

Header Name Value
Content-Type application/json
API-KEY App Key from API credentials
SECRET-KEY Secret Key from API credentials
BRAND-KEY Brand Key from Brands

Integration

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

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://paybd.one/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","webhook_url":"yourdomain.com/webhook","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",
  "webhook_url": "yourdomain.com/webhook",
  "metadata": {
    "phone": "016****"
  },
  "amount": "10"
}';
$request = new Request('POST', 'https://paybd.one/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",
  "webhook_url": "yourdomain.com/webhook",
  "metadata": {
    "phone": "016****"
  },
  "amount": "10"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://paybd.one/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://paybd.one/api/payment/create"

payload = json.dumps({
  "success_url": "yourdomain.com/success",
  "cancel_url": "yourdomain.com/cancel",
  "webhook_url": "yourdomain.com/webhook",
  "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://paybd.one/api/payment/create"
  method := "POST"

  payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","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 the Payment Page task, you will be redirected to the success or cancel page based on the transaction status with the following Query Parameters:

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://paybd.one/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://paybd.one/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://paybd.one/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://paybd.one/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))
}

Sample Response

{
    "cus_name": "John Doe",
    "cus_email": "[email protected]",
    "amount": "900.000",
    "transaction_id": "OVKPXW165414",
    "metadata": {
      "phone": "015****",
    },
    "payment_method": "bkash",
    "status": "COMPLETED"
}

Response Details

Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
cus_name String Customer Name
cus_email String Customer Email
amount String Amount
transaction_id String Transaction id Generated by System
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

WordPress Module

Integrate our payment gateway into your WordPress website effortlessly. Whether you run an e-commerce store, a membership site, or a donation platform, our WordPress module makes it easy to accept payments online. Download now and start accepting payments with ease!

Download WP Plugin

WHMCS Module

Integrate our payment gateway seamlessly into your WHMCS setup. With our module, you can easily accept payments from your customers, manage invoices, and track transactions effortlessly. Get started with just a few clicks!

Download WHMCS Module

SMM Panel Module

Enhance your SMM panel with our payment gateway integration module. Streamline the payment process for your social media marketing services and provide a seamless experience for your clients. Download the module now and take your SMM panel to the next level!

Download SMM Module

Mobile App

See Setup Video: Video here

Download Mobile App Now