Web POS

Document

PHP Example

<!doctype html>
<html>
<head>
<title>Our web POS integration sample PHP page</title>
<meta charset="utf-8">
</head>
<body>

<?php
$apiKey="XXXX"; ; // It is located in your business panel (Your site is working after it is approved)
$apiSecret="YYYY"; // It is located in your business panel (Your site is working after it is approved)
$successUrl="https://dogecoinpay.tech/posdemoss/successful.php"; // This is the page where the result parameters will be posted when the operation is successful.
$failUrl="https://dogecoinpay.tech/posdemoss/fail.php"; // This is the page where the result parameters will be posted when the operation fails.
$amount="1.00"; // Amount to be withdrawn in dollars
$clientRefCode=mktime();// Your reference number of the transaction
function GetIP(){
if(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} elseif(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (strstr($ip, ',')) {
$tmp = explode (',', $ip);
$ip = trim($tmp[0]);
}
} else {
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}
$ip=GetIP(); // (Customer IP address (If the incoming request does not match the current request, it will receive an error)
$rnd = date("Y-m-d H:i:s"); // transaction date and time
$hashstr = $apiKey . $clientRefCode . $amount . $successUrl . $failUrl . $apiSecret.$rnd;
$hashData = base64_encode(pack('H*',sha1($hashstr)));
?>

<form method="post" action="https://dogecoinpay.tech/Dpos/index.php">
<input type="hidden" name="apikey" value="<?php echo $apiKey ?>">
<input type="hidden" name="apisecret" value="<?php echo $apiSecret ?>">
<input type="hidden" name="successurl" value="<?php echo $successUrl ?>">
<input type="hidden" name="failurl" value="<?php echo $failUrl ?>">
<input type="hidden" name="amount" value="<?php echo $amount ?>">
<input type="hidden" name="clientrefcode" value="<?php echo $clientRefCode ?>">
<input type="hidden" name="ip" value="<?php echo $ip; ?>">
<input type="hidden" name="rnd" value="<?php echo $rnd ?>">
<input type="hidden" name="hashData" value="<?php echo $hashData ?>">
<input type="submit" value="Send" />
</form>
</body>
</html>

  • 1.500 Total
    Members
  • 1.500 Total
    Shopping
  • 1.500 Total Support
    Request