Ppay
Ppay
php
// Request Data
$reqData = [
"amount" => $amountInCents,
"mchOrderNo" => "SXMMANISH" . rand(11111111, 99999999),
"wayCode" => "801",
"appId" => $appId,
"notifyUrl" => utf8_encode($notifyUrl),
"mchNo" => $mchNo,
"customerName" => $customerName, // Add the customer's name
"customerEmail" => $customerEmail, // Add the customer's email
"customerPhone" => $customerPhone // Add the customer's phone number
];
ksort($reqData);
$str = "";
foreach ($reqData as $k => $v) {
$str .= "$k=$v&";
}
$str .= "key=$secret";
// MD5 encryption
$sign = strtoupper(md5($str));
$reqData["sign"] = $sign;
$jsonStr = json_encode($reqData);
list($returnCode, $returnContent) = http_post_json($url, $jsonStr);
$response = json_decode($returnContent, true);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment Amount Form</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
flex-direction: column;
}
h1 {
color: #d32f2f;
text-align: center;
font-size: 2.5rem;
margin-bottom: 20px;
}
form {
background-color: #fff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 450px;
height: 620px;
}
label {
font-size: 16px;
margin-bottom: 10px;
display: block;
color: #333;
}
input[type="number"], input[type="submit"] {
width: 100%;
padding: 15px;
margin: 10px 0 20px 0;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 16px;
transition: all 0.3s ease;
}
input[type="number"] {
background-color: #fafafa;
color: #333;
}
input[type="number"]:focus {
border-color: #4CAF50;
outline: none;
background-color: #fff;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
font-size: 18px;
border: none;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #45a049;
transform: translateY(-2px);
}
input[type="submit"]:active {
transform: translateY(1px);
}
.note {
padding: 20px;
background-color: #f9f9f9;
border: 1px solid #cccccc00;
border-radius: 8px;
width: 100%;
max-width: 450px;
text-align: center;
}
.note p {
font-size: 16px;
color: #333;
margin-bottom: 15px;
}
.note button {
background-color: #4CAF50;
color: white;
font-size: 16px;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.note button:hover {
background-color: #45a049;
}
.contact {
margin-top: 20px;
font-size: 14px;
}
.contact a {
color: #4CAF50;
text-decoration: none;
font-weight: bold;
}
.contact a:hover {
text-decoration: underline;
}
h1 {
font-size: 2rem;
}
.note {
width: 100%;
}
}
</style>
</head>
<body>
<div>
<form action="" method="POST">
<h1>PPay Test File</h1>
<label for="amount">Amount :</label>
<input type="number" id="amount" name="amount" value="100" required>
<input type="submit" value="Submit Payment">
<div class="note">
<p><strong>How to Use:</strong></p>
<p>Enter the amount in cents (e.g., enter 100 for ₹100.00 or $100.00).
Click the "Submit Payment" button to proceed with the payment.</p>
<button onclick="alert('Thank you for using our payment
form!')">OK</button>
</div>
<div class="contact">
<p><strong>Contact Developer:</strong></p>
<p>If you have any issues or need support, feel free to reach out to
the developer via <a href="https://t.me/sxm_manishjh69"
target="_blank">Telegram</a>.</p>
</div>
</form>
</div>
</body>
</html>