RRM TOPUP

ডেভেলপার ডকুমেন্টস

Header: API-KEY (ব্র্যান্ড পেজে পাবেন)। success, cancel ও webhook URL অবশ্যই ব্র্যান্ডের ডোমেইনে হতে হবে।

১. Create Payment — POST https://www.rmtopupbd.shop/api/payment/create

<?php
$ch = curl_init('https://www.rmtopupbd.shop/api/payment/create');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode([
    'cus_name' => 'John Doe', 'cus_email' => '[email protected]', 'amount' => '900',
    'success_url' => 'https://yourdomain.com/success',
    'cancel_url'  => 'https://yourdomain.com/cancel',
    'metadata'    => ['phone' => '015****'],
  ]),
  CURLOPT_HTTPHEADER => ['API-KEY: YOUR_BRAND_API_KEY', 'Content-Type: application/json'],
]);
$res = json_decode(curl_exec($ch), true);
if ($res['status']) header('Location: ' . $res['payment_url']);
FieldTypeDescription
statusboolTRUE / FALSE
messageStringMessage for status
payment_urlStringPayment link (success হলে)

Redirect

yourdomain.com/(success|cancel)?transactionId=...&paymentMethod=...&paymentAmount=0.00&paymentFee=0.00&status=pending|success|failed

Redirect প্যারামিটার বিশ্বাস করবেন না, সবসময় Verify করে amount মিলিয়ে নিন।

২. Verify — POST https://www.rmtopupbd.shop/api/payment/verify

Node.js

const r = await fetch('https://www.rmtopupbd.shop/api/payment/verify', {
  method: 'POST',
  headers: { 'API-KEY': 'YOUR_BRAND_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ transaction_id: 'ABCDEFH' })
});
console.log(await r.json());

Python

import requests
r = requests.post('https://www.rmtopupbd.shop/api/payment/verify', json={'transaction_id': 'ABCDEFH'},
                  headers={'API-KEY': 'YOUR_BRAND_API_KEY'})
print(r.json())

Sample Response

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