Bitcoin PHP Open Source Payment Gateway


bitcoin payments api

Bitcoin Payment API PHP Examples

Bitcoin PHP API - Instruction  and  Download PHP Class/Script »

API - ASP.NET & PHP & Laravel & JSON & Python-Django & Others...

Wordpress:  Wordpress Plugins  and  WP API for your site

Affiliate program:  0.50% from all Bitcoin payments

Bitcoin (BTC) Price: 1 BTC  /  US$63392 per 1 BTC

Website: https://bitcoin.org

Block Explorer: https://blockchain.info

Exchange: https://www.bitstamp.net





14 Live Examples with Bitcoin Payments on PHP/ASP.NET

new 1. Bitcoin Payment Box 2024 (white label, your own logo, mobile, bootstrap, customize)
Customize your payment box and get live generated php/html box code for your website
Simple JSON Instruction here »

2. Pay-Per-Product - Bitcoin only 3. Pay-Per-Product - Multiple currencies 4. Pay-Per-Download - Bitcoin only 5. Pay-Per-Download - Multiple currencies 6. Pay-Per-Post - Bitcoin only 7. Pay-Per-Post - Multiple currencies 8. Pay-Per-Registration - Bitcoin only 9. Pay-Per-Registration - Multiple currencies 10. Pay-Per-View/Page - Bitcoin only 11. Pay-Per-View/Page - Multiple currencies 12. Pay-Per-Membership - Bitcoin only 13. Pay-Per-Membership - Multiple currencies 14. Direct Payments between your website users





You have three choices to display bitcoin payment box/data on your webpage/applications -

  • By Using html Iframe bitcoin payment box. Example below »
  • By using JSON data Client Side (jquery ajax) - Customize box / black & white themes / generate php code here (bottom of page). Instruction here
  • JSON Server Side (php curl method) - Alternatively, you can receive JSON values through curl on server side. White Label Bitcoin Payment Box with your logo, customize box - generate php/html code for your website online

JSON Examples - Payment Not Received Payment Received jQuery & JSON Box Example



Bitcoin Payment Box (iframe)

Send bitcoins to the address in the payment box below and you will see how it changes

Language:  


See new version - 2024 White Label Mobile Friendly Payment Box Demo Here »






affiliate bitcoin


or

You can use an alternative affiliate program - 'Referral a friend' which gives payment commissions to your affiliate website user who has referred another user/seller/buyer to your website. This will make your website much more attractive and help to advertise your website on the internet. Read here








Start Now

Note: If you want to integrate Bitcoin/altcoin payments in your Wordpress Plugin, please use our wordpress instruction »


Bitcoin Live Price






GoUrl Bitcoin Payment API Features

Our Payment Gateway with Bitcoin Instant Checkout allows you to easily organise your website -

Please note different currencies have different transaction confirmation times. There are no other differences (except period of confirmation time) between Dogecoin, Bitcoin, Litecoin and other cryptocoins in GoUrl Payment API.












1. Customize Bitcoin Payment Box (json, 2024 year)

White label bitcoin payment box with your own logo, mobile friendly, themes


Examples -

    JSON - payment not received   HTML Demo     and    JSON - payment received   HTML Demo


JSON data will allow you to easily customise your bitcoin payment boxes. For example, you can display payment amount and bitcoin payment address with your own text, you can also accept payments in android/windows and other applications.


PHP/JSON Payment Box (screenshot) -


Instruction -


I. Goto here and customize payment box using options on webpage. On bottom of webpage you will receive ready to use php/html code for your website. You can save this file in php payment class main directory (near example_basic.php)

WHITE LABEL Bitcoin Payment Box - simple select method = "curl" and your own logo here

Demo - Dark Theme, Grey Theme, Funny Theme, Light Theme, Your logo on payment box, Result Page Preview, Single Coin Payment Box, Multiple Coins Payment Box, etc (use customize options).

II. PHP Bitcoin Payment Class (Open Source) available on github. PHP Class installation instruction. Please use Dogecoins or send dummy payment data to your website for tests.

III. Add your additional actions when payment received (send confirmation email, update database, update user membership, etc) to IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = ""). This function is used every time a new payment from any user is received successfully. It is calling from cryptobox.callback.php. Read more about IPN here

Done!










2. Bitcoin Pay-Per-Product API (iFrame, 2017 year)

Example of php code (Bitcoin Pay-Per-Product Payment Gateway) for your website -

No visitors registration is needed. Easy to use!  Also see API Function Descriptions

Live Example1 (bitcoin only)       Live Example2 (multiple cryptocurrencies)

pay per product bitcoin api

For wordpress plugins, use our wp instruction »

Simple Basic php Payment Example (accept payments in one crypto currency) -

<?
	require_once( "cryptobox.class.php" );

	$orderID	=  "your_product1_or_signuppage1_etc";
	$userID		= "";
	$def_language	= "en";	// default payment box language; en - English, es - Spanish, fr - French, etc

	// Remove all the characters from the string other than a..Z0..9_-@. 
	$orderID = preg_replace('/[^A-Za-z0-9\.\_\-\@]/', '', $orderID);
	$userID = preg_replace('/[^A-Za-z0-9\.\_\-\@]/', '', $userID);

	$options = array( 
		"public_key"  => "",         // place your public key from gourl.io
		"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"      => $userID, 	// 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"  => "COOKIE",   // save your user identifier userID in cookies. Available: COOKIE, SESSION, IPADDRESS, MANUAL
		"amount"   	  => 0,			// amount in cryptocurrency or in USD below
		"amountUSD"   => 2,			// 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"      => "24 HOUR",  // 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"	  => $def_language // 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;"); 

	// Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);

    // 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 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 ($box1->is_paid() && !$box1->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
		$box1->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(); 


		// ...
		// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
		// for send confirmation email, update database, update user membership, etc.
		// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
		// ...

	}
}
?>
<!DOCTYPE html><html><head>
<meta http-equiv='cache-control' content='no-cache'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head><body>

<div style='margin:30px 0 5px 480px'>Language: &#160; <?= $languages_list ?></div>
<?= $payment_box ?>
<?= $message ?>

</body>
</html>

Example PHP Source





1.2 Bitcoin Pay-Per-Product API - Multiple Currencies



Live Example1 (bitcoin only)       Live Example2 (multiple cryptocurrencies)



payment api

Example - accept multiple crypto currencies on your website and allow users to change payment box display language

<?
	require_once( "cryptobox.class.php" );

	/**** CONFIGURATION VARIABLES ****/ 
	
	$userID 		= "";				// place your registered userID or md5(userID) here (user1, user7, uo43DC, etc).
										// if userID is empty, it will autogenerate userID and save in cookies
	$userFormat		= "COOKIE";			// save userID in cookies (or you can use IPADDRESS, SESSION)
	$orderID 		= "invoice000383";	// invoice number - 000383
	$amountUSD		= 2.21;				// invoice amount - 2.21 USD
										// for convert fiat currencies Euro/GBP/etc. to USD, use function convert_currency_live()
	$period			= "NOEXPIRY";		// one time payment, not expiry
	$def_language	= "en";				// default Payment Box Language
	$def_payment	= "bitcoin";		// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dogecoin', 'dash', 'speedcoin', 'reddcoin', 'potcoin', 'feathercoin', 
						'vertcoin', 'peercoin', 'monetaryunit');
	
	
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
		
	/********************************/
	
	
	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
	
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language);
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// order id or product name
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// product price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use product price in USD
			"period"      => $period, 		// payment valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name(); 
	
	// Successful Cryptocoin Payment received
	if ($box->is_paid()) 
	{
    	// Optional - use IPN (instant payment notification) function cryptobox_new_payment() for update db records, etc
    	// IPN description: https://gourl.io/api-php.html#ipn 	
	
		if (!$box->is_confirmed()) {
			$message =  "Thank you for payment (payment #".$box->payment_id()."). Awaiting transaction/payment confirmation";
		}											
		else 
		{ // payment confirmed (6+ confirmations)

			// one time action
			if (!$box->is_processed())
			{
				// One time action after payment has been made/confirmed
				 
				$message = "Thank you for order (order #".$orderID.", payment #".$box->payment_id()."). We will send soon";
				
				// Set Payment Status to Processed
				$box->set_status_processed();  
			}
			else $message = "Thank you. Your order is in process"; // General message
		}
	}
	else $message = "This invoice has not been paid yet";
	
	
	
	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...

	
?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Product Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:13px;color:#666;margin:0'>
<div align='center'>

<h1>Invoice (Example)</h1>
<br>
<img style='position:absolute;margin-left:auto;margin-right:auto;left:0;right:0;' alt='status'  
	src='https://gourl.io/images/<?= ($box->is_paid()?"paid":"unpaid")  ?>.png'>
<img alt='Invoice' border='0' height='500' src='https://gourl.io/images/invoice.png'>
<br><br>
<? if (!$box->is_paid()) echo $coins_list . "<br><br><h2>Pay Invoice Now - </h2>";  ?>
<br><br>
<div style='margin:30px 0 5px 300px'>Language: &#160; <?= $languages_list ?></div>
<?= $box->display_cryptobox() ?>
<br><br><br>
<h3>Message :</h3>
<h2 style='color:#999'><?= $message ?></h2>
<br><br><br><br><br><br>
</div>
</body>
</html>






3. Pay-Per-Download Bitcoin (iFrame, 2017 year)

Example of php code (Bitcoin Pay-Per-Download Payment Gateway) for your website. Use Pay-Per-Download system for your files and for any other digital content of your website online. Make money.
Your website visitors will need to send you a set amount of cryptocoins for every file download, which they make from your website. You can use the received cryptocoins to support your website, etc.
Your files need to store in protected directory with .htaccess file: deny from all. It protects your files from direct downloads

Live Example3 (bitcoin only)       Live Example4 (multiple cryptocurrencies)


pay-per-download bitcoin api

No visitors registration is needed. This will be quick and easy for your visitors!

<?	
	require_once( "cryptobox.class.php" );

	/**** CONFIGURATION VARIABLES ****/ 
	
	$filename 		= "my_file1.zip";	// filename for download
	$dir 			= "protected"; 		// name of your directory with your files; nobody should have direct web access to directory
	$userID 		= "";				// place your registered userID or md5(userID) here (user1, user7, uo43DC, etc).
										// if userID is empty, it will autogenerate userID and save in cookies
	$userFormat		= "COOKIE";			// save userID in cookies (or you can use IPADDRESS, SESSION)
	$orderID 		= md5($dir.$filename);	// file name hash as order id
	$amountUSD		= 0.2;				// file download price (0.2 USD)
	$period			= "24 HOURS";		// download link will be valid for 24 hours
	$def_language	= "en";				// default Payment Box Language
	$def_payment	= "bitcoin";		// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 
						'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit');
		
		
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
		
	/********************************/
	
	
	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
	
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language, 60, "margin: 80px 0 0 0");
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// file name hash as order id
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// file price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use file price in USD
			"period"      => $period, 		// download link valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name(); 
	
	// Generate Download Link
	$download_link =  "//$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" . 
						(strpos($_SERVER["REQUEST_URI"], "?")?"&":"?")."dd=1";
	$download_link = "href='".htmlspecialchars($download_link, ENT_QUOTES, 'UTF-8')."'";
	
	// Warning message if not paid
	if (!$box->is_paid()) 
		$download_link = "onclick='alert(\"You need to send ".$coinName."s first !\")' href='#a'";

	// Check if file exists on your server 
	$file = rtrim($dir, "/ ")."/".$filename;
	if (!file_exists($file)) 
		echo "<h1><center><font color=red>Warning: $file not exists</font></center></h1>";
	
	// User Paid - Send file to user browser
	if ($box->is_paid() && isset($_GET["dd"]) && $_GET["dd"] == "1") 
	{
		// Starting Download
		$size = filesize($file);
		header('Content-Description: File Transfer');
		header('Content-Type: application/octet-stream');
		header('Content-Disposition: attachment; filename='.basename($file));
		header('Expires: 0');
		header('Cache-Control: must-revalidate');
		header('Pragma: public');
		header('Content-Length: ' . $size);
		readfile($file);
		
		// Set Status - User Downloaded File
		if ($size) $box->set_status_processed();
		
		die;
	}
	
	
	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...

	 	
	?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Download Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:13px;color:#666;margin:0'>
<div align='center'>

<br><br><br><h1>File: <?= $filename ?></h1>

Price: ~<?= $amountUSD ?> US$<br>

<a <?= $download_link ?>><img alt='Download File' border='0' src='https://gourl.io/images/zip.png'></a><br>
<a <?= $download_link ?>>Download File</a>

<? if (!$box->is_paid()) echo $coins_list; else echo "<br><br><br><br>" ?>

<div style='margin:30px 0 5px 300px'>Language: &#160; <?= $languages_list ?></div>
<?= $box->display_cryptobox() ?>

<br><br><br><br><br><br>
</div>
</body>
</html>






4. Pay-Per-Post Bitcoin

Example of php code (Bitcoin Pay-Per-Post Payment Gateway) for your website.
Sell right to publish new posts on your website

Live Example5 (bitcoin only)       Live Example6 (multiple cryptocurrencies)






pay-per-post bitcoin api

No visitors registration is needed. Easy to use!

<?	
	require_once( "cryptobox.class.php" );

	/**** CONFIGURATION VARIABLES ****/ 
	
	$userID 		= "";				// place your registered userID or md5(userID) here (user1, user7, uo43DC, etc).
										// if userID is empty, it will autogenerate userID and save in cookies
	$userFormat		= "COOKIE";			// save userID in cookies (or you can use IPADDRESS, SESSION)
	$orderID 		= "post1";			// if you manual setup userID, you need to  
										// update orderID for users who already paid before: post1, post2, post3  
	$amountUSD		= 0.5;				// price per one post - 0.5 USD
	$period			= "NOEXPIRY";		// one time payment for each new user post, not expiry
	$def_language	= "en";				// default Payment Box Language
	$def_payment	= "dogecoin";		// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 
						'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit');
	
	
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
			
	/********************************/


	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
		
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language, 42, "margin: 5px 0 0 20px");
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// order id
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// post price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use post price in USD
			"period"      => $period, 		// payment valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name(); 
	
	
	// Form Data
	// --------------------------
	$ftitle	 = (isset($_POST["ftitle"])) ? $_POST["ftitle"] : "";
	$ftext 	 = (isset($_POST["ftext"])) ? $_POST["ftext"] : "";
	
	$error = "";
	$successful = false;
	
	if (isset($_POST) && isset($_POST["ftitle"]))
	{
		if (!$ftitle)    		$error .= "<li>Please enter Title</li>";
		if (!$ftext)   			$error .= "<li>Please enter Text</li>";
		if (!$box->is_paid()) 	$error .= "<li>".$coinName."s have not yet been received</li>";
		if ($error)				$error  = "<br><ul style='color:#eb4847'>$error</ul>";
		
		if ($box->is_paid() && !$error)
		{
			// Successful Cryptocoin Payment received

			// Your code here - 
			// save text in db / publish user post on your website ...
			// ...
			// ...
					
			// Set Payment Status to Processed
			$successful = true;
			$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
			// If you manual setup userID, you need to change orderID also
			$box->cryptobox_reset();
		}
	}
	

	
	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...


	
?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Post Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<meta name='robots' content='all'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#666;margin:0'>
<div align='center'>
<h1>Example - Paid Posts</h1>
You can sell right to publish new posts on your website
<br><br><br>
<img alt='Invoice' border='0' src='https://gourl.io/images/example6.png'>
<a name='i'></a>

<?php if ($successful): ?>

	<div align='center'>
		<img alt='New Post' border='0' src='https://gourl.io/images/example7.png'>
		<div style='margin:40px;font-size:24px;color:#339e2e;font-weight:bold'>
			Your text has been successfully posted on our website!</div>
		<a href='pay-per-post-multi.php'>Publish new posts &#187;</a>
	</div>	
	
<? else: ?>

	<form name='form1' style='font-size:14px;color:#444' action="pay-per-post-multi.php#i" method="post">
		<table cellspacing='20'>
			<tr><td colspan='2'><img alt='New Post' border='0' src='https://gourl.io/images/example7.png'><?= $error ?></td></tr>
			<tr><td width='100'>Title: </td><td width='300'><input style='padding:6px;font-size:18px;' size='40' 
				type="text" name="ftitle" value="<?= $ftitle ?>"></td></tr>
			<tr><td>Text: </td><td><textarea style='padding:6px;font-size:18px;' rows="4" cols="40" 
				name="ftext"><?= $ftext ?></textarea></td></tr>
			<?php if (!$box->is_paid()): ?>
				<tr><td colspan='2'>* You need to pay <?= $coinName ?>s (~<?= $amountUSD ?> US$) for posting 
						your text on our website</td></tr>
			<? endif; ?>
		</table>
	</form>

	<div style='width:600px;background-color:#f9f9f9;padding-top:10px'>
			<div style='font-size:12px;<? if ($box->is_paid()) echo "margin:5px 0 5px 390px;"; else 
				echo "margin:5px 0 5px 390px; position:absolute;" ?>'>Language: &#160; <?= $languages_list ?></div>
			<? if (!$box->is_paid()) echo "<div align='left'>".$coins_list."</div>";  ?>
			<?= $box->display_cryptobox() ?>
	</div>
	
	<br><br><br>
	<button onclick='document.form1.submit()' style='padding:6px 20px;font-size:18px;'>Post Your Article/Comment</button>
	
<? endif; ?> 	

</div><br><br><br><br><br><br>
</body>
</html>







5. Pay-Per-Registration Bitcoin

Example of php code (Bitcoin Pay-Per-Registration Payment Gateway) for your website.
Make money on user registration on your website. Stop Spam!

Live Example7 (bitcoin only)       Live Example8 (multiple cryptocurrencies)





pay-per-post bitcoin api

Protection Against Spam. Easy to use -

<?	
	require_once( "cryptobox.class.php" );

	/**** CONFIGURATION VARIABLES ****/ 
	
	$userID 		= "";				// new user, it will autogenerate userID and save in cookies
	$userFormat		= "COOKIE";			// save userID in cookies (or you can use IPADDRESS, SESSION)
	$orderID 		= "signuppage";		// Registration Page   
	$amountUSD		= 1;				// price per registration - 1 USD
	$period			= "NOEXPIRY";		// one time payment for each new user, not expiry
	$def_language	= "en";				// default Payment Box Language
	$def_payment	= "bitcoin";		// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 
						'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit');
	
	
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
				
	/********************************/

	
	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
	
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language, 42, "margin: 5px 0 0 20px");
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// order id
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use price in USD
			"period"      => $period, 		// payment valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name(); 
	
	
	// Form Data
	// --------------------------
	$fname	 	= (isset($_POST["fname"])) ? $_POST["fname"] : "";
	$femail  	= (isset($_POST["femail"])) ? $_POST["femail"] : "";
	$fpassword  = (isset($_POST["fpassword"])) ? $_POST["fpassword"] : "";
	
	$error = "";
	$successful = false;
	
	if (isset($_POST) && isset($_POST["fname"]))
	{
		if (!$fname)    		$error .= "<li>Please enter Your Name</li>";
		if (!$femail)   		$error .= "<li>Please enter Your Email</li>";
		if (!$fpassword)   		$error .= "<li>Please enter Your Password</li>";
		if (!$box->is_paid()) 	$error .= "<li>".$coinName."s have not yet been received</li>";
		if ($error)				$error  = "<br><ul style='color:#eb4847'>$error</ul>";
		
		if ($box->is_paid() && !$error)
		{
			// Successful Cryptocoin Payment received

			// Your code here - 
			// save user data in db / register new user ...
			// ...
			// ...
					
			// Set Payment Status to Processed
			$successful = true;
			$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
			$box->cryptobox_reset();
		}
	}
	

	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...


	
?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Registration Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#666;margin:0'>
<div align='center'>
<br><h1>Example - Website Registration Form. Protection against spam!</h1>
<br><img alt='Cryptocoin Registration Form' border='0' src='https://gourl.io/images/example8.png'>
<a name='i'></a>

<?php if ($successful): ?>

	<div align='center' style='margin:40px;font-size:24px;color:#339e2e;font-weight:bold'>
		You have been successfully registered on our website!</div>
	
<? else: ?>

	<form name='form1' style='font-size:14px;color:#444' action="pay-per-registration-multi.php#i" method="post">
		<table cellspacing='20'>
			<tr><td colspan='2'><b>NEW USER</b><?= $error ?><input type='text' style='display: none'>
				<input type='password' style='display: none'></td></tr>
			<tr><td width='100'>Name: </td><td width='300'><input style='padding:6px;font-size:18px;' size='30' 
				type="text" name="fname" value="<?= $fname ?>"></td></tr>
			<tr><td>Email: </td><td><input style='padding:6px;font-size:18px;' size='40' type="text" 
				name="femail" value="<?= $femail ?>"></td></tr>
			<tr><td>Password: </td><td><input style='padding:6px;font-size:18px;' size='35' type="password" 
				name="fpassword" value="<?= $fpassword ?>"><br><br></td></tr>
		</table>
	</form>

	<div style='width:600px;padding-top:10px'>
			<div style='font-size:12px;<? if ($box->is_paid()) echo "margin:5px 0 5px 390px;"; 
				else echo "margin:5px 0 5px 390px; position:absolute;" ?>'>Language: &#160; <?= $languages_list ?></div>
			<? if (!$box->is_paid()) echo "<div align='left'>".$coins_list."</div>";  ?>
			<?= $box->display_cryptobox(true, 530, 230, "border-radius:15px;border:1px solid #eee;padding:3px 6px;margin:10px") ?>
	</div>
	
	<?php if (!$box->is_paid()): ?>
		<br>* You need to pay <?= $coinName ?>s (~<?= $amountUSD ?> US$) for register on our website<br>
	<? endif; ?>	
	
	<br><br>
	<button onclick='document.form1.submit()' style='padding:6px 20px;font-size:18px;'>Register</button>
	
<? endif; ?> 	

</div><br><br><br><br><br><br>
</body>
</html>







6. Pay-Per-View/Page Bitcoin

Example of php code (Bitcoin Pay-Per-Page Payment Gateway) for your website. Your registered users or unregistered visitors will need to send you a set amount of cryptocoins for access to your website's specific pages & videos during a specific time. You can take separate payments for separate pages of your website. All will be in automatic mode - allowing you to receive payments, to open webpage access to your members, showing after the time a new payment form, payment notifications to your email, etc.

For example, you have a website and you offer paid access to few pages of your website for the price of 0.6 USD for 24 HOURS (1 DAY) access for website visitors (non-registered users). You can install simple code below on top of pages with that paid access. Your visitors will see automatic cryptocoin payment box and when they make their payment, they will get access to your pages/videos and after 24 hours they will see a new payment box.

Live Example9 (bitcoin only)       Live Example10 (multiple cryptocurrencies)











pay per view page bitcoin

No your visitor registration is needed on your website. Anonymous. Use Pay-Per-Page Access on your website !

<?	
	require_once( "cryptobox.class.php" );

	/**** CONFIGURATION VARIABLES ****/ 
	
	$userID 		= "";				// leave empty for unregistered visitors on your website  
										// if userID is empty, it will autogenerate userID and save in cookies
										// or place your registered userID or md5(userID) here (user1, user7, ko43DC, etc).
	$userFormat		= "COOKIE";			// save userID in cookies (or you can use IPADDRESS, SESSION)
	$orderID 		= "page1";			// Separate payments for separate your web page(s) - page1, page2, section1, etc. 
	$amountUSD		= 0.6;				// price per page(s) - 0.6 USD
	$period			= "24 HOUR";		// user will get access to page(s) for 24 hours; after need to pay again
	$def_language	= "en";				// default Payment Box Language
	$def_payment	= "bitcoin";		// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 
						'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit');
	
	
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
			
	/********************************/

	
	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
	
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language, 70, "margin: 5px 0 0 20px");
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// order id
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use price in USD
			"period"      => $period, 		// payment valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name();

	
	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...

	
?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Page Access Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#666;margin:0'>
<div align='center'>
<br><h2>Example - Visitors Access to Your Premium Webpage (Pay-Per-Page)</h2>
Price: ~<?= $amountUSD ?> US$ for <?= $period ?> access.  <br><br>

<?php if ($box->is_paid()): ?>

	<!-- Successful Cryptocoin Payment received -->
	<!-- You can use the same payment gateway code for few your pages (page1, page2, section1) -->	 
	<!-- Your Premium Page(s) Code  -->
	 
	<h2 style='color:#339e2e;'>Cryptocoin Payment received<br>Successful Access to Premium Page (during <?= $period ?>)</h2>
	<img alt='Cryptocoin Pay Per Page Access' border='0' src='https://gourl.io/images/example9_2.jpg'>
	
<? else: ?>

	 <!-- Awaiting Payment -->
	<img alt='Awaiting Payment - Cryptocoin Pay Per Page Access' border='0' src='https://gourl.io/images/example9.jpg'>
	<br><br><br><br>
	
	<? if (!$box->is_paid()) echo $coins_list;  ?>
	<div style='font-size:12px;margin:30px 0 5px 370px'>Language: &#160; <?= $languages_list ?></div>
	<?= $box->display_cryptobox(true, 530, 230, "padding:3px 6px;margin:10px") ?>
	
<? endif; ?> 	

</div><br><br><br><br><br><br>
</body>
</html>







7. Pay-Per-Membership Bitcoin

For example, you have a website and you offer paid membership to premium content of your website for the price of 79 USD for 1 MONTH access. You can install simple code below on top of pages with that premium access. Your visitors will see automatic cryptocoin payment box and when they make their payment, they will get access to your pages and after 1 month they will see a new payment box. Our payment box is fully customized. And you can easily configure it - changing access time period (3 hours, 1 day, 2 days, 1 week...), price (in USD or in Bitcoins), currency, payment notifications to your email, offering onetime payment, etc.

Then you can use Poloniex.com autosell feature and auto trade your bitcoins to USD/BTC.

All will be in automatic mode - allowing you to receive payments, upgrade membership to your members, showing after the time a new payment form, convert to USD, etc.


Live Example11 (bitcoin only)       Live Example12 (multiple cryptocurrencies)












pay per membership bitcoin api

Example of php code (Bitcoin Pay-Per-Membership Payment Gateway) for your website. It is easy !

<?
	require_once( "cryptobox.class.php" );
	
	/**** CONFIGURATION VARIABLES ****/ 
	
	$userID 		= "-place_your_users_id-";	// place your registered userID or md5(userID) here (user1, user7, ko43DC, etc).
												// your user should have already registered on your website before   
	$userFormat		= "COOKIE";					// this variable ignored when you use $userID 
	$orderID 		= "premium_membership";		// premium membership order 
	$amountUSD		= 79;						// price per membership - 79 USD
	$period			= "1 MONTH";				// one month membership; after need to pay again
	$def_language	= "en";						// default Payment Box Language
	$def_payment	= "bitcoin";				// default Coin in Payment Box

	// List of coins that you accept for payments
	// For example, for accept payments in bitcoins, dogecoins use - $available_payments = array('bitcoin', 'dogecoin'); 
	$available_payments = array('bitcoin', 'bitcoincash', 'bitcoinsv', 'litecoin', 'dash', 'dogecoin', 'speedcoin', 'reddcoin', 'potcoin', 
						'feathercoin', 'vertcoin', 'peercoin', 'monetaryunit');
	
	
	// Goto  https://gourl.io/info/memberarea/My_Account.html
	// You need to create record for each your coin and get private/public keys
	// Place Public/Private keys for all your available coins from $available_payments
	
	$all_keys = array(	
		"bitcoin"  => array("public_key" => "-your public key for Bitcoin box-",  "private_key" => "-private key for Bitcoin box-"),
		"dogecoin" => array("public_key" => "-your public key for Dogecoin box-", "private_key" => "-private key for Dogecoin box-")
		// etc.
	); 
			
	/********************************/


	// Re-test - that all keys for $available_payments added in $all_keys 
	if (!in_array($def_payment, $available_payments)) $available_payments[] = $def_payment;  
	foreach($available_payments as $v)
	{
		if (!isset($all_keys[$v]["public_key"]) || !isset($all_keys[$v]["private_key"])) 
			die("Please add your public/private keys for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["public_key"], "PUB"))  die("Invalid public key for '$v' in \$all_keys variable");
		elseif (!strpos($all_keys[$v]["private_key"], "PRV")) die("Invalid private key for '$v' in \$all_keys variable");
		elseif (strpos(CRYPTOBOX_PRIVATE_KEYS, $all_keys[$v]["private_key"]) === false) 
			die("Please add your private key for '$v' in variable \$cryptobox_private_keys, file cryptobox.config.php.");
	}
	
	// Optional - Language selection list for payment box (html code)
	$languages_list = display_language_box($def_language);
	
	// Optional - Coin selection list (html code)
	$coins_list = display_currency_box($available_payments, $def_payment, $def_language, 70, "margin: 5px 0 0 20px");
	$coinName = CRYPTOBOX_SELCOIN; // current selected coin by user
	
	// Current Coin public/private keys
	$public_key  = $all_keys[$coinName]["public_key"];
	$private_key = $all_keys[$coinName]["private_key"];
	
	
	/** PAYMENT BOX **/
	$options = array(
			"public_key"  => $public_key, 	// your public key from gourl.io
			"private_key" => $private_key, 	// your private key from gourl.io
			"webdev_key"  => "", 			// optional, gourl affiliate key
			"orderID"     => $orderID, 		// order id
			"userID"      => $userID, 		// unique identifier for every user
			"userFormat"  => $userFormat, 	// save userID in COOKIE, IPADDRESS or SESSION
			"amount"   	  => 0,				// price in coins OR in USD below
			"amountUSD"   => $amountUSD,	// we use price in USD
			"period"      => $period, 		// payment valid period
			"language"	  => $def_language  // text on EN - english, FR - french, etc
	);

	// Initialise Payment Class
	$box = new Cryptobox ($options);
	
	// coin name
	$coinName = $box->coin_name(); 
	
	
	// Successful Cryptocoin Payment received
	if ($box->is_paid())
	{
		// one time action
		if (!$box->is_processed())
		{
			// One time action after payment has been made
					
			$message = "Thank you (order #".$orderID.", payment #".$box->payment_id()."). We upgraded your membership to Premium";
	
			// Set Payment Status to Processed
			$box->set_status_processed();
		}
		else $message = "You have a Premium Membership";
	}
	
	
	// ...
	// Also you can use IPN function cryptobox_new_payment($paymentID = 0, $payment_details = array(), $box_status = "") 
	// for send confirmation email, update database, update user membership, etc.
	// You need to modify file - cryptobox.newpayment.php, read more - https://gourl.io/api-php.html#ipn
	// ...

 	
?>

<!DOCTYPE html>
<html><head>
<title>Pay-Per-Membership Cryptocoin (payments in multiple cryptocurrencies) Payment Example</title>
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<script src='cryptobox.min.js' type='text/javascript'></script>
</head>
<body style='font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#666;margin:0'>
<div align='center'>
<br><h2>Example - Upgrade to a Premium Member Account</h2>
<br>

<?php if ($box->is_paid()): ?>

	<!-- User already paid premium membership -->
	<!-- You can use this function - $box->is_paid() on all other your premium webpages, 
			it will return true during all user paid period (1 month) --> 
	<!-- Your Premium Pages Code Here -->

	<br><br><br>
	<?= $message ?>
	<br><br><br>
	
<? else: ?>

	 <!-- Awaiting Payment -->
	<img alt='Awaiting Payment - Cryptocoin Pay Per Membership' border='0' src='https://gourl.io/images/example10.png'>
	<br><br><br>	
	<h3>Upgrade Your Membership Now ( $<?= $amountUSD ?> per <?= $period ?> ) - </h3>
	
<? endif; ?> 	

	<br><br>
	<? if (!$box->is_paid()) echo $coins_list;  ?>
	<div style='font-size:12px;margin:50px 0 5px 370px'>Language: &#160; <?= $languages_list ?></div>
	<?= $box->display_cryptobox(true, 530, 230, "padding:3px 6px;margin:10px;border:10px solid #f7f5f2;") ?>

	
</div><br><br><br><br><br><br>
</body>
</html>







8. Direct Payments between your website users

You can create bitcoin/altcoin online auction, classified ads, paid forum, etc on your website.

GoUrl Bitcoin/Altcoin Gateway allows you to provide direct payments between your website users (userA pay to userB, userB pay to userD, etc ), your website will display a payment form and will receive a confirmation notice every time on whether a payment is successful or not. Each of your users will see their payment statistics on gourl.io also. All will be in automatic mode.

You can do this in the same way as this website shopbidsell.com (see screenshot)

How it works -

  1. Install php Gourl Payment Box on your website
  2. Each of your users create a free account on gourl.io
  3. Then create new bitcoin/altcoin payment box(es) on gourl.io
  4. The user will get gourl payment box keys and can save them on your website.
  5. Your website will then display a crypto payment box using those keys, the payment will go directly between your users (the buyer and seller), and at the same time your website will receive confirmation if the payment is successful or not and, if so, will process it.
  6. All of your users will see their own payment statistics as a member on gourl.io too.

Instruction Screenshot from shopbidsell.com      





auction bitcoin api


Also you can use affiliate programs on your website -

  1. 0.50% payment commission from each payment to you as the website owner. Read here
    or
  2. You can use an alternative affiliate program - 'Referral a friend' which gives payment commissions to your affiliate website user who has referred another user/seller/buyer to your website. This will make your website much more attractive and help to advertise your website on the internet. Read here









Online Monetiser


Please use online monetiser if you don't have your own website. Make money online !

Examples of Monetiser Links -








CONTACT US


We offer Free Support in the integration of our GoUrl Crypto Payment Gateway in your scripts/plugins/website (accepting Bitcoin/Dogecoin/etc payments from users online).

Please feel free to contact us if you have any questions

Contact Us







March 2024
Back to Top