Documentation
Website Connect Guide
আপনার ওয়েবসাইটের সাথে Payora BD Auto Payment কানেক্ট করার সম্পূর্ণ গাইড · ধাপে ধাপে
Platform API: http://217.216.38.82:3847
For shop owners
আপনি যদি ডেভেলপার না হন
নিচের পুরো Docs পেজের লিংক এবং আপনার Platform URL + Site API Key ডেভেলপারকে দিলেই যথেষ্ট। তিনি আপনার ওয়েবসাইটের সাথে Payora BD Auto Payment সিস্টেম কানেক্ট করে দিবেন।
- ১. Panel → Websites → সাইট অ্যাড করে Site API Key কপি করুন
- ২. ডেভেলপারকে দিন:
http://217.216.38.82:3847+ Site API Key - ৩. এই পেজের লিংক দিন:
/docs - ৪. ফোনে Auto Payment APK ইনস্টল করে Start রাখুন
- ৫. ডেভেলপারকে বলুন: APK offline হলেও অর্ডার pending রাখতে হবে · paid হলেই ডেলিভারি (Docs → Offline / Pending section)
Section 01
Panel এ Website অ্যাড করুন
প্রথমে মার্চেন্ট প্যানেলে সাইট তৈরি
- Login করুন → Panel → Websites
- Add Website → Shop/site name ও URL দিন (যেমন https://myshop.com)
- Site API Key কপি করুন · এটাই আপনার সাইটের সিক্রেট কী
- Panel → Gateways এ আপনার bKash/Nagad/Rocket নম্বর সেট করুন
- Panel → APK থেকে Secret Connect Key নিয়ে ফোনে অ্যাপ Start করুন
Site API Key কখনো frontend/browser JS এ পাবলিক করবেন না · শুধু server-side / env তে রাখুন।
Section 02
ডেভেলপারকে কী দিতে হবে
দুটো জিনিসই লাগে
1. Platform URL
http://217.216.38.82:3847
API যেখানে call যাবে
2. Site API Key
pk_live_xxxxxxxx…
Panel → Websites থেকে
শুধু Key দিলে হবে না · Platform URL ছাড়া কোড জানে না কোন সার্ভারে request পাঠাবে। দুটোই দিন।
Section 03
Environment variables
সার্ভার / .env এ সেট করুন
আপনার backend অথবা hosting env তে এগুলো রাখুন:
# .env (Node / Next / Laravel / etc.) PAYORA_PLATFORM_URL=http://217.216.38.82:3847 PAYORA_SITE_API_KEY=YOUR_SITE_API_KEY_FROM_PANEL # Optional aliases some projects use: # PAYORA_SITE_KEY=... # PAYORA_API_URL=...
- Vercel / Netlify: Project Settings → Environment Variables
- cPanel / shared host: server config বা wp-config.php তে
- WordPress: wp-config.php বা secure options (client JS এ নয়)
Section 04
Payment flow
কাস্টমার কীভাবে পেমেন্ট করে
- কাস্টমার আপনার সাইটে প্রোডাক্ট/অ্যামাউন্ট সিলেক্ট করে
- আপনার backend Payora BD API তে order create করে
- Response এ
checkout_urlআসে → কাস্টমারকে সেখানে redirect - কাস্টমার bKash/Nagad/Rocket এ পেমেন্ট করে (আপনার নম্বরে)
- ফোনের Auto Payment APK SMS/notification পড়ে TrxID মিলায়
- Order status → PAID (সাধারণত ৫–১০ সেকেন্ড)
- আপনার সাইট status poll করে সাকসেস পেজ দেখায়
Section 05
Source code · Create checkout
ওয়েবসাইট কোডে কী অ্যাড করবেন
Endpoint: POST http://217.216.38.82:3847/api/v1/checkout/create
POST http://217.216.38.82:3847/api/v1/checkout/create
Headers:
Content-Type: application/json
x-site-key: YOUR_SITE_API_KEY
Body (JSON):
{
"amount": 500,
"product_name": "UC Top Up",
"method": "BKASH"
}
Methods: BKASH | NAGAD | ROCKET | BINANCE | REDOTPAY
Success response (example):
{
"ok": true,
"order_id": 123,
"short_id": "Ab12Cd",
"amount": 500,
"checkout_url": "https://www.payorabd.com/pay/Ab12Cd",
"gateway_url": "https://www.payorabd.com/pay/Ab12Cd"
}
→ Redirect customer to checkout_urlBuy / Checkout বাটনে ক্লিক করলে আপনার সার্ভার এই API কল করবে, তারপর কাস্টমারকে checkout_url এ পাঠাবে।
Section 06
Order status চেক করুন
পেমেন্ট হয়েছে কি না জানতে
Checkout পেজ বা আপনার thank-you পেজ থেকে short_id দিয়ে status দেখুন:
GET http://217.216.38.82:3847/api/v1/checkout/order/SHORT_ID
Example response:
{
"short_id": "Ab12Cd",
"status": "pending" | "paid" | "failed",
"amount": 500,
"method": "BKASH",
"trx_id": "..."
}
When status === "paid" → deliver product / mark WooCommerce order completeসাধারণত প্রতি ২–৩ সেকেন্ডে poll করুন (checkout পেজে থাকাকালীন)। Webhook coming soon।
Section 07
WordPress / WooCommerce
ওয়ার্ডপ্রেসে কীভাবে কানেক্ট করবেন
Site API Key কখনো থিম JS বা HTML এ লিখবেন না। Server-side (functions.php / custom plugin) থেকে API কল করুন।
Option A · Custom payment redirect (recommended pattern)
<?php
// wp-config.php
define('PAYORA_PLATFORM_URL', 'http://217.216.38.82:3847');
define('PAYORA_SITE_API_KEY', 'YOUR_SITE_API_KEY');
// functions.php or custom plugin - create Payora checkout & redirect
function payora_create_checkout($amount, $product_name, $method = 'BKASH') {
$res = wp_remote_post(rtrim(PAYORA_PLATFORM_URL, '/') . '/api/v1/checkout/create', [
'timeout' => 30,
'headers' => [
'Content-Type' => 'application/json',
'x-site-key' => PAYORA_SITE_API_KEY,
],
'body' => wp_json_encode([
'amount' => (float) $amount,
'product_name' => $product_name,
'method' => strtoupper($method),
]),
]);
if (is_wp_error($res)) return null;
$data = json_decode(wp_remote_retrieve_body($res), true);
return !empty($data['checkout_url']) ? $data['checkout_url'] : null;
}
// Example: before customer pays, redirect to Payora checkout
add_action('template_redirect', function () {
if (empty($_GET['payora_pay'])) return;
$url = payora_create_checkout(299, 'Premium Package', 'BKASH');
if ($url) {
wp_redirect($url);
exit;
}
wp_die('Payora checkout create failed');
});Option B · After WooCommerce order (advanced)
WooCommerce native gateway হিসেবে প্লাগইন বানালে best। সিম্পল hook উদাহরণ (thankyou তে redirect করার আগে create করা ভালো):
// Create Payora link when customer chooses your custom gateway,
// then redirect to checkout_url instead of default payment.
// After Payora status=paid, mark WC order as processing/completed
// via cron or thank-you page that polls:
// GET /api/v1/checkout/order/{short_id}ডেভেলপার না হলে: এই সেকশন + Platform URL + Site API Key ওয়ার্ডপ্রেস ডেভেলপারকে দিয়ে দিন।
Section 08
Node.js / Next.js example
সার্ভার সাইড fetch
// server-only (API route / backend)
const PLATFORM = process.env.PAYORA_PLATFORM_URL; // http://217.216.38.82:3847
const SITE_KEY = process.env.PAYORA_SITE_API_KEY;
export async function createPayoraCheckout({ amount, productName, method }) {
const res = await fetch(`${PLATFORM}/api/v1/checkout/create`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-site-key": SITE_KEY,
},
body: JSON.stringify({
amount,
product_name: productName,
method, // BKASH | NAGAD | ROCKET | BINANCE | REDOTPAY
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data.message || data.error || "Checkout failed");
return data; // { checkout_url, short_id, ... }
}
// Then: redirect user to data.checkout_url
// Poll: GET ${PLATFORM}/api/v1/checkout/order/${short_id}Section 09
PHP / Laravel
কাস্টম PHP সাইট
<?php
$platform = getenv('PAYORA_PLATFORM_URL') ?: 'http://217.216.38.82:3847';
$siteKey = getenv('PAYORA_SITE_API_KEY');
$payload = json_encode([
'amount' => 500,
'product_name' => 'Diamond Pack',
'method' => 'NAGAD',
]);
$ch = curl_init(rtrim($platform, '/') . '/api/v1/checkout/create');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-site-key: ' . $siteKey,
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
]);
$raw = curl_exec($ch);
$data = json_decode($raw, true);
curl_close($ch);
if (!empty($data['checkout_url'])) {
header('Location: ' . $data['checkout_url']);
exit;
}
echo 'Checkout create failed';Section 10
Auto Payment APK
মোবাইল অ্যাপ ছাড়া অটো ভেরিফাই হবে না
- Panel → APK → APK ডাউনলোড + Secret Connect Key কপি
- Install Guide অনুসারে Play Protect / permissions সেট করুন
- অ্যাপে Key দিয়ে Save → Start
- Panel এ App Connected দেখা যাবে
APK offline থাকলেও কাস্টমার পেমেন্ট করতে পারবে · অর্ডার pending থাকবে · APK online হলে auto verify হবে। বিস্তারিত: Offline / Pending section।
Section 11
Offline / Pending system
ফোন অফলাইন হলেও ওয়েবসাইট কীভাবে চলবে - ডেভেলপার অবশ্যই পড়ুন
মার্চেন্টের ফোনে Auto Payment অ্যাপ বন্ধ বা অফলাইন থাকলেও কাস্টমার ওয়েবসাইট থেকে অর্ডার/চেকআউট করতে পারবে। সিস্টেম অর্ডারকে pending রাখে। অ্যাপ আবার অনলাইন হলে SMS/notification মিলিয়ে auto verify → paid হয়।
Developer must implement
- Checkout create সফল হলেই product deliver করবেন না · শুধু
status === "paid"হলে deliver / WC order complete - Thank-you / waiting পেজে
GET …/checkout/order/{short_id}poll করুন (২–৩ সেকেন্ড) · pending থাকলে “পেমেন্ট যাচাই হচ্ছে…” দেখান - APK offline = error নয় · UX এ pending/waiting রাখুন, fail ধরবেন না
- অনেকক্ষণ pending থাকলেও order panel এ জমা থাকে · APK online হলে সাথে সাথে verify
- Customer-facing message: “পেমেন্ট হয়ে গেলে কিছুক্ষণের মধ্যে কনফার্ম হবে”
Status values you will see
GET http://217.216.38.82:3847/api/v1/checkout/order/SHORT_ID
"status": "pending" → waiting for SMS/APK verify (app may be offline)
"status": "paid" → deliver product / mark order complete
"status": "failed" → show retry / contact support
Pseudocode (any language):
1) create checkout → redirect checkout_url
2) on return/waiting page:
loop every 2–3s:
status = GET /api/v1/checkout/order/{short_id}
if status == "paid": deliver + break
if status == "failed": show fail + break
else: show "Pending · verifying payment…"
3) Do NOT assume paid just because customer opened checkoutনন-ডেভেলপার: এই সেকশন + Platform URL + Site API Key ডেভেলপারকে দিয়ে বলুন - “pending থাকলে poll করে paid হলে ডেলিভারি দিতে হবে, APK offline হলেও সাইট বন্ধ করা যাবে না।”
Section 12
Go-live checklist
লাইভ করার আগে চেকলিস্ট
- ✓Panel এ Website অ্যাড + Site API Key কপি করা
- ✓Env এ PAYORA_PLATFORM_URL + PAYORA_SITE_API_KEY সেট
- ✓Backend এ checkout/create call (server-side)
- ✓Customer redirect → checkout_url
- ✓Status poll → paid হলেই ডেলিভারি (pending এ ডেলিভারি নয়)
- ✓Offline/pending UX: waiting message (APK offline = normal)
- ✓Receive numbers (bKash/Nagad/Rocket) প্যানেলে সেট
- ✓ফোনে Auto Payment APK Start + online
- ✓টেস্ট: APK stop করে অর্ডার → pending → APK start → auto paid