Bitcoin Forum

Bitcoin => Project Development => Topic started by: modelski on June 07, 2016, 03:08:02 PM



Title: How accept bitcoin payments without bitpay, coinify, etc?
Post by: modelski on June 07, 2016, 03:08:02 PM
Hello, All!

Is it possible to accepting bitcoin payments on site without bitpay? Because they ask to many information, documents and scans, and give a limits on monthly volume. Also I think it is more safety to accept payments straight on own bitcoin wallet without any 3rd party.

Thanks!


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: DannyHamilton on June 07, 2016, 03:30:41 PM
Hello, All!

Is it possible to accepting bitcoin payments on site without bitpay?

Yes.

When your customer is ready to pay, you should:
  • Generate a bitcoin address.
  • Store the private key securely
  • Provide the bitcoin address to your customer
  • Tell your customer how much bitcoins you want them to send you
  • Watch for the transaction to be sent with the correct amount of bitcoins to the correct address
  • Determine if the transaction is likely to confirm (or wait for it to confirm)
  • Provide your product or service to the customer


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: domob on June 07, 2016, 03:33:59 PM
Yes, that's definitely possible.  How to best do it depends a lot on your particular requirements and resources.  I think there are two main ways for you to do that:

1) If you have a server that is strong enough (and, importantly, actually your server and not just some web host), you can run Bitcoin Core on it and use the RPC interface to manage the wallet, check for incoming transactions and so on.  If you do this, be careful that you know what you are doing and are not keeping too many coins in the wallet on the server.

2) You can pregenerate a list of Bitcoin addresses from some wallet (where the private keys could even be totally offline) and then just have a simple script on the website hand out one address after the other from this list to customers.  You could use some API provider (blockchain explorer with programmatically accessible API) to check for incoming transactions.  This method is probably simpler for you, but you have to trust that API provider "somewhat".

In any case, note that this will let you accept Bitcoins directly - without converting them to fiat currency on the fly.


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: modelski on June 07, 2016, 03:42:37 PM
Hello, All!

Is it possible to accepting bitcoin payments on site without bitpay?

Yes.

When your customer is ready to pay, you should:
  • Generate a bitcoin address.
  • Store the private key securely
  • Provide the bitcoin address to your customer
  • Tell your customer how much bitcoins you want them to send you
  • Watch for the transaction to be sent with the correct amount of bitcoins to the correct address
  • Determine if the transaction is likely to confirm (or wait for it to confirm)
  • Provide your product or service to the customer
Yes, that's definitely possible.  How to best do it depends a lot on your particular requirements and resources.  I think there are two main ways for you to do that:

1) If you have a server that is strong enough (and, importantly, actually your server and not just some web host), you can run Bitcoin Core on it and use the RPC interface to manage the wallet, check for incoming transactions and so on.  If you do this, be careful that you know what you are doing and are not keeping too many coins in the wallet on the server.

2) You can pregenerate a list of Bitcoin addresses from some wallet (where the private keys could even be totally offline) and then just have a simple script on the website hand out one address after the other from this list to customers.  You could use some API provider (blockchain explorer with programmatically accessible API) to check for incoming transactions.  This method is probably simpler for you, but you have to trust that API provider "somewhat".

In any case, note that this will let you accept Bitcoins directly - without converting them to fiat currency on the fly.

A lot of thanks, guys!


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: unamis76 on June 07, 2016, 04:19:54 PM
You can have Electrum accept Bitcoin payments on your website. Give a look on their documentation, they've got it all there.


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: btc junkie on June 08, 2016, 05:10:29 AM
you might find this thread useful ---> https://bitcointalk.org/index.php?topic=990348.0


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: ravens on June 08, 2016, 06:50:35 AM
Hello, All!

Is it possible to accepting bitcoin payments on site without bitpay?

Yes.

When your customer is ready to pay, you should:
  • Generate a bitcoin address.
  • Store the private key securely
  • Provide the bitcoin address to your customer
  • Tell your customer how much bitcoins you want them to send you
  • Watch for the transaction to be sent with the correct amount of bitcoins to the correct address
  • Determine if the transaction is likely to confirm (or wait for it to confirm)
  • Provide your product or service to the customer
Yes, providing a bitcoin address is really the only way you can get people to send bitcoins without a payment support such as bitpay.


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: dquancey on June 08, 2016, 04:17:47 PM
Here you go:

http://docs.electrum.org/en/latest/merchant.html

Did this with a small project I did last year, worked a treat.

Very easy to do.


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: TheBarMan on June 09, 2016, 08:49:54 PM
Thanks for the info i will use it for further reference in my site.

; P


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: Sir_lagsalot on June 09, 2016, 09:19:29 PM
You can use the blockchain.info API. It's pretty good and fast. Most bitcoin sites nowadays work on that. If you really want to be self sufficient, try using bitcoind.


Title: Re: How accept bitcoin payments without bitpay, coinify, etc?
Post by: coinableS on June 10, 2016, 01:47:13 AM
If you are dealing with relatively low dollar amounts and able to sweep keys frequently here's a down and dirty way to do it.

1. Generate a new key pair on the fly with (https://blockchain.info/q/newkey)
2. You just generated a new address followed by the 64hex private key.
3. THAT KEY IS TRANSMITTED OPENLY AND NOT SECURE.  No biggie, as long as you are dealing with only a few orders a day and low dollar amounts your risk is minimal. Risk does exist to a MitM but again, if you are some small shop selling your homemade jelly for $20 a jar I'd say you're pretty unlikely to be a target. Now if your selling weed and cocaine, with a bunch of orders per hour, well then this would be the stupidest way to accept payment.  
4. Present the address to your customer, and tell them to send bitcoins to that address.
5. Use something like mail(); to email yourself the customer's contact/shipping info, the item they ordered, and the key pair your generated.
6. Once or a couple times a day when you receive an email that there was a new order, sweep the funds to your secure wallet on your phone/table/PC whatever.
7. If you don't know how to convert the 64 hex private key to wallet import format, head on over to bitaddress.org, click on wallet details and paste it in there.

Below are some very brief code examples for steps 1, 4 and 5

1.
Code:
<?php
$url 
"https://blockchain.info/q/newkey";
$fgc file_get_contents($url);
$keypair explode(" "$fgc);
$bitcoin_address $keypair[0];
$private_key $keypair[1];
//store in session
session_start();
$_SESSION["addy"] = $bitcoin_address;
$_SESSION["pk"] = $private_key;
?>


4.
Code:
<html>
Hello Mr Customer,<br>
Please send $20 or <?php 
//get exchange rate
$exc json_decode(file_get_contents("https://blockchain.info/stats?format=json"), true);
$btcusd $exc["market_price_usd"];
$usdamount 20;
$convert $usdamount $btcusd;
$convert number_format($convert4);
echo 
$convert."BTC to "$bitcoin_address;
?>

<br>
<form method="post">
etc.. some form input
</form>
</html>

5.
Code:
<?php
//when user submits the form email yourself the details
if(isset($_POST['form_button'])){
$yourEmail "youremail@address.com";
$host $_SERVER['SERVER_NAME'];
$emailTitle "New Order";
$bodyEmail = <<<EOD
   //include order details from your form
    Payment Address: 
$_SESSION["addy"] <br>
    Private Key to Sweep: 
$_SESSION["pk"] <br>
EOD;
 
        
$headers "From: noreply@".$host."\r\n";
        
$headers .= "Content-type: text/html\r\n";
        
$success mail("$yourEmail""$emailTitle""$bodyEmail""$headers");
}
?>