Introduction
Welcome to the Tech Vishal Boss Gateway API. This guide contains everything you need to seamlessly integrate our secure payment gateway into your application. Just plug and play these 3 simple files.
Base API URL
https://gateway.vishalboss.sbs/
The Checkout Form
Create checkout.html on your server. This is the frontend interface where customers enter their details before proceeding to pay.
<!DOCTYPE html>
<html>
<head>
<title>Checkout</title>
<style>
body { font-family: Arial, sans-serif; padding: 50px; background: #f4f4f9; }
.form-box { background: white; padding: 30px; border-radius: 10px; max-width: 400px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 15px; }
input { padding: 12px; width: 100%; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }
button { padding: 12px; width: 100%; background: #000000; color: white; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; }
</style>
</head>
<body>
<div class="form-box">
<h2>Complete Payment</h2>
<form action="process_pay.php" method="POST">
<div class="form-group">
<label>Full Name:</label>
<input type="text" name="name" required placeholder="John Doe">
</div>
<div class="form-group">
<label>Phone Number:</label>
<input type="tel" name="phone" required placeholder="9876543210" pattern="[0-9]{10}">
</div>
<div class="form-group">
<label>Amount (INR):</label>
<input type="number" name="amount" required placeholder="500" min="1">
</div>
<button type="submit">Pay Securely</button>
</form>
</div>
</body>
</html>
Backend Processor
Create process_pay.php. This script securely catches the form data and sends a secret server-to-server request to the Tech Vishal Boss Hub API to generate a checkout session.
<?php
// process_pay.php
$name = $_POST['name'] ?? '';
$phone = $_POST['phone'] ?? '';
$amount = $_POST['amount'] ?? '';
if(empty($name) || empty($phone) || empty($amount)) {
die("Error: All fields are required.");
}
// Tech Vishal Boss Hub API Endpoint
$api_url = "https://gateway.vishalboss.sbs/api_create_order.php";
$post_data = [
'customer_name' => $name,
'customer_phone' => $phone,
'amount' => $amount
];
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if ($result && isset($result['status']) && $result['status'] === 'success') {
// Redirect user to the secure payment popup
header("Location: " . $result['payment_url']);
exit;
} else {
echo "<h3>Payment Initiation Failed</h3>";
echo "<p>Error: " . htmlspecialchars($result['message'] ?? 'Server unreachable.') . "</p>";
}
?>
Verify Status
Create verify_payment.php. Never trust client-side messages. Use this script to securely verify the final status of the transaction from our servers before delivering your service.
<?php
// verify_payment.php
$order_id = $_GET['order_id'] ?? "ORDER_123456789";
if(empty($order_id)) {
die("Order ID is missing.");
}
// Tech Vishal Boss Hub Status Check API
$api_url = "https://gateway.vishalboss.sbs/api_check_status.php?order_id=" . urlencode($order_id);
$response = file_get_contents($api_url);
$data = json_decode($response, true);
if ($data && $data['status'] === 'success') {
if ($data['payment_status'] === 'PAID' || $data['payment_status'] === 'SUCCESS') {
echo "<h2 style='color:green;'>Payment Successful!</h2>";
echo "<p>You paid ₹" . htmlspecialchars($data['amount']) . ". Thank you!</p>";
// Give product access here
} else if ($data['payment_status'] === 'PENDING') {
echo "<h2 style='color:orange;'>Payment Processing</h2>";
} else {
echo "<h2 style='color:red;'>Payment Failed</h2>";
}
} else {
echo "<h2>Error checking status</h2>";
}
?>