Author

Topic: Best Practice for accepting Bitcoin as Payment. (Read 1089 times)

legendary
Activity: 1442
Merit: 1179
Best way IMO is build your own mini payment gateway with blockchain.info API

Create a homepage/frontpage with your product, here's an example:

Code:

Wooden Spoons




Wooden Spoons


Welcome to my custom made wooden spoons store. I carve the best wooden spoons on the planet.
The best wooden spoons need the best payment system, which is why I use bitcoin to process my
payments online. If you are new to bitcoin you can go to bitcoin.org
to learn more and how to get started.




Latest Wooden Spoons For Sale




        
        
        


        
        
        

Enchanted Spoon



Buy Now!
        
Wizard Spoon



Buy Now!
        
Monkey Spoon



Buy Now!
        
Enchanted Spoon



Buy Now!
        
Wizard Spoon



Buy Now!
        
Monkey Spoon



Buy Now!
        




2015 © Wooden Spoons



Then in order to process the payment create a separate PHP page for each item. This page can contain a form for the user to put in their shipping details. Then we generate a unique address for them to send their payment. After this an email is sent to your own personal email so you know who purchased what and which address they are sending your payment to:

Here's an example for item1.php file
Code:
$url "https://btc-e.com/api/2/btc_usd/ticker";
$json json_decode(file_get_contents($url), true);
$price $json["ticker"]["last"];
$usdPrice 20// SET THE PRICE OF THE ITEM HERE
$calc $usdPrice $price;
$itemPrice round($calc4);
$yourEmail "[email protected]"// ENTER YOUR EMAIL SO YOU CAN BE NOTIFIED WHEN SOMEONE BUYS SOMETHING
$emailTitle "New Purchase";
$productName "Enchanted Spoon"// ENTER IN PRODUCT NAME
 
if(isset($_POST['submit'])){
        
$email $_POST['email'];
        
$name $_POST['name'];
        
$street $_POST['street'];
        
$city $_POST['city'];
        
$state $_POST['state'];
        
$zip $_POST['zip'];
 
        
//CREATE UNIQUE BITCOIN ADDRESS FOR PAYMENT
        
$id "111aa111-aaa1-1111-a111-1111a111a1a1"//YOUR UNIQUE BLOCKCHAIN.INFO ID
        
$pw "correcthorsebatterystaple"//YOUR BLOCKCHAIN.INFO PASSWORD
        
$new_address "https://blockchain.info/merchant/$id/new_address?password=$pw";
 
        
$json_new_addr json_decode(file_get_contents($new_address), true);
        
$display_address $json_new_addr["address"];
 
        
$body = <<        

New Purchase


        Item Purchased: 
$productName 

        Email: 
$email 

        Name: 
$name 

        Street: 
$street 

        City: 
$city 

        State: 
$state 

        Zip: 
$zip 

        Payment Address: 
$display_address 

        Payment Amount: 
$itemPrice 

EOD;
 
        
$headers "From: [email protected]."\r\n";
        
$headers .= "Content-type: text/html\r\n";
        
$success mail("$yourEmail""$emailTitle""$body""$headers");
        
$message "Thank you for your order!";
        
$message2 "To finalize your order please send " $itemPrice " to " $display_address;
        
$message3 "We have emailed you this information if you have to pay later.";
 
        
$custEmail = <<        

Please send payment to finalize your purchase


        Payment Address: 
$display_address 

        Payment Amount: 
$itemPrice 

        Item Purchased: 
$productName 

        Email: 
$email 

        Name: 
$name 

        Street: 
$street 

        City: 
$city 

        State: 
$state 

        Zip: 
$zip 
        
EOD;
        
$customerCopy mail($email"Wooden Spoons Purchase"$custEmail$headers);
}
 
?>


Wooden Spoons




Wooden Spoons


You selected to buy the Enchanted Spoon.




The Enchanted Spoon was carved by hand and coated with special shaman herbs.
It looks and smells great! You can use it to eat soup or just display it on a shelf.




Price: ฿echo $itemPrice?>


Shipping Information



Email:

Full Name:

Address:

City:

State:

Zip:



echo $message;
echo 
"
"
;
echo 
$message2;
echo 
"
"
;
echo 
$message3;
?>



legendary
Activity: 1044
Merit: 1000
https://r.honeygain.me/XEDDM2B07C
If you want to avoid having to mess around with building your own gateway, try something like Bitpay or even Coinbase. They have gateways all ready to go, and easily integrated into websites VIA their API. I think there is also scripts and other quick ways to implement a secure gateway for payments VIA these sites. Coinpayments and a few other sites also have gateways, ready to go.
member
Activity: 112
Merit: 10
As a professional merchent, coinkite would have a lot of security and easy of use. Great service that is under-advertised.
legendary
Activity: 1862
Merit: 1469
i was thinking about that, but i found some negative reviews about that service, not sure if it will lead to some problems. So i was thinking about to set my own wallet/payment system.

In that case you will need to install the bitcoin daemon. You can then code in PHP and connect to the wallet via Json-RPC.

You should forward most of the funds to an offline wallet for security. Just keep on the server what you'll need for refunds.
member
Activity: 119
Merit: 10
i was thinking about that, but i found some negative reviews about that service, not sure if it will lead to some problems. So i was thinking about to set my own wallet/payment system.
legendary
Activity: 1862
Merit: 1469
Hi,

are any tutorials out there which could show me how to integrate bitcoins to a homepage as a payment method in the way of best practice (in the view of a secure, easy and fast process)

I want the people to provide their bitcoin address (in purpose of refunds), with that information an unique bitcoin-payment-address should be generated and shown to the user. No registration should be needed.

-Now which wallet should I use?
-How can i forward all payments automated to a secure cold storage?
-How can i monitor the payment status. (I would like to inform the user right on 0 confirmations, that the payment is pending (just like Blockchain.info does)

If i just generate Thousands of addressee with an armor offline wallet, store them in my database an then give them out to the user on request, would that be secure?  

thanks


For this scenario I recommend you to use the blockchain.info API.

You can have a single address to forward every payment and that can be a cold storage. So no need to have funds on the server.
member
Activity: 119
Merit: 10
Hi,

are any tutorials out there which could show me how to integrate bitcoins to a homepage as a payment method in the way of best practice (in the view of a secure, easy and fast process)

I want the people to provide their bitcoin address (in purpose of refunds), with that information an unique bitcoin-payment-address should be generated and shown to the user. No registration should be needed.

-Now which wallet should I use?
-How can i forward all payments automated to a secure cold storage?
-How can i monitor the payment status. (I would like to inform the user right on 0 confirmations, that the payment is pending (just like Blockchain.info does)

If i just generate Thousands of addressee with an armor offline wallet, store them in my database an then give them out to the user on request, would that be secure?  

thanks
Jump to: