I'm setting up a system to let users deposit money into their account. When I try to generate the payment screen, it is returning a blank empty box.
`<?php
global $me;
$amount = (int)$_GET['amount'];
/**
* @category Example1 - Pay-Per-Product (single crypto currency in payment box)
* @package GoUrl Cryptocurrency Payment API
* copyright (c) 2014-2016 Delta Consultants
* @crypto Supported Cryptocoins - Bitcoin, Litecoin, Paycoin, Dogecoin, Dash, Speedcoin, Reddcoin, Potcoin, Feathercoin, Vertcoin, Vericoin, Peercoin, MonetaryUnit
* @website https://gourl.io/bitcoin-payment-gateway-api.html#p1
* @live_demo https://gourl.io/lib/examples/pay-per-product.php
*/
require_once('engine/api/bitcoin/cryptobox.class.php');
/**** CONFIGURATION VARIABLES ****/
$userID = $me['id']; // place your registered userID or md5(userID) here (user1, user7, uo43DC, etc).
// you don't need to use userID for unregistered website visitors
// if userID is empty, system will autogenerate userID and save in cookies
$userFormat = "COOKIE"; // save userID in cookies (or you can use IPADDRESS, SESSION)
$orderID = "invoice00033"; // invoice number - 000383
$amountUSD = $amount; // invoice amount - 2.21 USD
$period = "NOEXPIRY"; // one time payment, not expiry
$def_language = "en"; // default Payment Box Language
$public_key = ""; // from gourl.io
$private_key = "";// from gourl.io
// IMPORTANT: Please read description of options here - https://gourl.io/api-php.html#options
/********************************/
$options = array(
"public_key" => $public_key, // place your public key from gourl.io
"private_key" => $private_key, // place your private key from gourl.io
"webdev_key" => "", // optional, gourl affiliate program key
"orderID" => $orderID, // few your users can have the same orderID but combination 'orderID'+'userID' should be unique
"userID" => $me['id'], // optional; place your registered user id here (user1, user2, etc)
// for example, on premium page you can use for all visitors: orderID="premium" and userID="" (empty)
// when userID value is empty - system will autogenerate unique identifier for every user and save it in cookies
"userFormat" => $userFormat, // save your user identifier userID in cookies. Available: COOKIE, SESSION, IPADDRESS, MANUAL
"amount" => 0, // amount in cryptocurrency or in USD below
"amountUSD" => $amount, // price is 2 USD; it will convert to cryptocoins amount, using Live Exchange Rates
// For convert fiat currencies Euro/GBP/etc. to USD, use function convert_currency_live()
"period" => $period, // payment valid period, after 1 day user need to pay again
"iframeID" => "", // optional; when iframeID value is empty - system will autogenerate iframe html payment box id
"language" => "EN" // text on EN - english, FR - french, please contact us and we can add your language
);
// Initialise Bitcoin Payment Class
$box = new Cryptobox ($options);
// Display payment box with custom width = 560 px and big qr code / or successful result
$payment_box = $box->display_cryptobox(true, 560, 230, "border-radius:15px;border:1px solid #eee;padding:3px 6px;margin:10px;",
"display:inline-block;max-width:580px;padding:15px 20px;border:1px solid #eee;margin:7px;line-height:25px;");
// Log
$message = "";
// A. Process Received Payment
if ($box->is_paid())
{
$message .= "A. User will see this message during 24 hours after payment has been made!";
$message .= "<br>".$box1->amount_paid()." ".$box1->coin_label()." received<br>";
// Your code here to handle a successful cryptocoin payment/captcha verification
// For example, give user 24 hour access to your member pages
// ...
// Please create/use IPN (instant payment notification) function cryptobox_new_payment() for update db records, etc
// Function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") called every time
// when a new payment from any user is received.
// IPN description: https://gourl.io/api-php.html#ipn
}
else $message .= "The payment has not been made yet";
// B. Optional - One-time Process Received Payment
if ($box->is_paid() && !$box->is_processed())
{
$message .= "B. User will see this message one time after payment has been made!";
// Your code here - user see successful payment result
// ...
// Also you can use $box1->is_confirmed() - return true if payment confirmed
// Average transaction confirmation time - 10-20min for 6 confirmations
// Set Payment Status to Processed
$box->set_status_processed();
// Optional, cryptobox_reset() will delete cookies/sessions with userID and
// new cryptobox with new payment amount will be show after page reload.
// Cryptobox will recognize user as a new one with new generated userID
// $box1->cryptobox_reset();
/********************************************************************************************************/
/** This IPN function is used every time a new payment from any user is received successfully **/
/** Function receives paymentID - current payment ID (record id in your mysql table crypto_payments), **/
/** payment details as array and box_status - 'cryptobox_newrecord' OR 'cryptobox_updated'. **/
/** **/
/** Move this function to the bottom of the file cryptobox.class.php or create a separate file **/
/** More info: https://gourl.io/api-php.html#ipn **/
/********************************************************************************************************/
function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "")
{
// Your php code here to handle a successful cryptocoin payment/captcha verification
// for example, send confirmation email to user
// update user membership, etc - https://gourl.io/api-php.html#ipn
// .... ....
return true;
}
}
?>
<!DOCTYPE html><html><head>
<meta http-equiv='cache-control' content='no-cache'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head><body>
<?= $payment_box ?>
<?= $message ?>
</body>
</html>`