0% found this document useful (0 votes)
9 views5 pages

Ppay

The document is a PHP script that handles a payment form submission using the PPay payment API. It collects payment details, constructs a request, and processes the payment, redirecting the user based on the response. The HTML part of the document provides a user interface for entering the payment amount and includes styling and instructions for use.

Uploaded by

adityaforqqtube1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Ppay

The document is a PHP script that handles a payment form submission using the PPay payment API. It collects payment details, constructs a request, and processes the payment, redirecting the user based on the response. The HTML part of the document provides a user interface for entering the payment amount and includes styling and instructions for use.

Uploaded by

adityaforqqtube1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

<?

php

//ppay by sxm manish For more information contact us //

if ($_SERVER['REQUEST_METHOD'] === 'POST') {


// Your Merchant ID
$mchNo = "M514003";
// Your Application ID (AppId)
$appId = "679b7a2be4b014d312dadd1e";
// Your Payment Callback URL
$notifyUrl = "https://pay.ppaypro.com/api/pay/query";
// Your Secret Key
$secret =
"yY5gsxA7NarxSudyXSW2gxkaMIgdNF9NOibvUkx524AauTgamOLrQ88YY4X5naGt23biJGx62bbj7dBrgM
0fuKaP3mXuYx3dOY2hziLnFyXGSAI6J3c30L1qotwCsR9H";

// Payment API Endpoint


$url = "https://pay.ppaypro.com/api/pay/pay";
$amount = $_POST['amount'];
$amountInCents = $amount * 100;
$customerName = "sXm Manish";
$customerEmail = "13800138000@gmail.com";
$customerPhone = "13800138000";

// 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);

if (isset($response['data']['payData']) && !empty($response['data']


['payData'])) {
header("Location: " . $response['data']['payData']);
exit();
} else {
echo "Error: " . (isset($response['msg']) ? $response['msg'] : 'Unknown
Error');
echo "<pre>";
print_r($response);
echo "</pre>";
}
}

function http_post_json($url, $jsonStr) {


$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json; charset=utf-8",
"Content-Length: " . strlen($jsonStr)
));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return array($httpCode, $response);
}
?>

<!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;
}

@media (max-width: 600px) {


form {
padding: 30px;
}

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>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy