Uname:
Linux yisu-647059427c03a 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Software:
nginx/1.22.1
PHP version:
7.3.31 [ PHP INFO ] PHP os:
Linux
Server Ip:
103.146.158.90
Your Ip:
216.73.216.141
User:
www (1000) | Group:
www (1000)
Safe Mode:
OFF
Disable Function:
passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment URL Generator</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: 0 auto;
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
textarea {
width: 100%;
height: 150px;
padding: 10px;
border-radius: 4px;
border: 1px solid #ddd;
margin-bottom: 10px;
font-family: monospace;
font-size: 14px;
background-color: #f9f9f9;
}
button {
display: block;
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
margin-top: 10px;
}
button:hover {
background-color: #0056b3;
}
#paymentUrl {
margin-top: 15px;
text-align: center;
font-size: 16px;
color: green;
}
#paymentUrl a {
color: green;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Payment URL Generator</h1>
<textarea id="jsonInput" placeholder="Paste your JSON here..."></textarea>
<button onclick="generatePaymentUrl()">Generate Payment URL</button>
<div id="paymentUrl"></div>
</div>
<script>
function generatePaymentUrl() {
const jsonInput = document.getElementById("jsonInput").value.trim();
// Parse the JSON input and extract the access token
let jsonData;
try {
jsonData = JSON.parse(jsonInput);
} catch (error) {
alert("Invalid JSON. Please check the format.");
return;
}
const accessToken = jsonData.accessToken;
console.log(accessToken);
if (!accessToken) {
alert("Access token not found in the JSON.");
return;
}
// Send a request to the backend API to generate the payment URL
fetch("/api/backend-api/payments/checkout", {
method: "POST",
headers: {
"Authorization": `Bearer ${accessToken}`,
},
})
.then(response => response.json())
.then(data => {
const paymentUrl = data.url;
if (paymentUrl) {
// Display the payment URL
document.getElementById("paymentUrl").innerHTML = `Payment URL: <a href="${paymentUrl}" target="_blank">${paymentUrl}</a>`;
} else {
alert("Failed to generate payment URL.");
}
})
.catch(error => {
alert("An error occurred while generating the payment URL.");
console.error(error);
});
}
</script>
</body>
</html>