Bitcoin Forum

Economy => Service Discussion => Topic started by: mcplums on July 01, 2015, 01:54:52 PM



Title: Anyone successfully implemented blockchain.info's receive payments API?
Post by: mcplums on July 01, 2015, 01:54:52 PM
Hello chaps,

I'm trying to build me a website which accepts bitcoins. I'm half way through implementing blockchain.info's receive payments API but I'm having a couple of issues. Is there anyone here who has already been through this process and is ok with me pm'ing them now and again when issues arise (which they have already)?

It is possible that those who are experienced in php would be able to help me even if you are not familiar with the API (which is at https://blockchain.info/api/api_receive). I am an amateur programmer, I only do it for fun so I may ask stupid questions.

Thanks!


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: keeshux on July 01, 2015, 02:13:51 PM
Blockchain.info has the most broken API ever, you're bound to be alone in the dark. Let it just rot.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 01, 2015, 03:00:45 PM
Better use hierarchical deterministic wallet. Advantages are:

 - You don't need to rely entirely on third party.
 - You don't need to expose private keys to create corresponding public keys(addresses).

Softwares for various languages are available here -- https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Implementations.

Feel free to post here if you need any help.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: keeshux on July 01, 2015, 03:06:59 PM
You'd better go with a serious service like BitPay:

https://bitpay.com/api


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 01, 2015, 03:24:02 PM
You'd better go with a serious service like BitPay:

https://bitpay.com/api

You will have to trust a third party, BitPay, completely which is not a good idea IMHO. You should at least have partial access to receiving addresses. A HD wallet is better and more suitable for receiving payments.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: keeshux on July 01, 2015, 03:29:17 PM
Not true. You provide your public address, no private keys are involved for receiving payments through BitPay.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: keeshux on July 01, 2015, 03:30:48 PM
You'd better go with a serious service like BitPay:

https://bitpay.com/api

You should at least have partial access to receiving addresses.

You mean the intermediary addresses only owned by BitPay? I mean, the ones in the invoice forms.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: mcplums on July 01, 2015, 06:46:36 PM
Blockchain.info has the most broken API ever, you're bound to be alone in the dark. Let it just rot.

Buddy I just want to ask, is this really true!? Is this up to date information? The reason I ask is that I have already spent a fair bit of time working with it and apart from a couple of exceptions it seems pretty good- I don't really want to have to start from scratch.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: mcplums on July 01, 2015, 06:48:58 PM
Another reason I want to use the blockchain.info API is that it comes with code which does stuff like automatically detects a payment. I really wouldn't know how to start doing something like that on my own!


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 02, 2015, 04:22:46 PM
You mean the intermediary addresses only owned by BitPay? I mean, the ones in the invoice forms.

AFAIK, yes.

Buddy I just want to ask, is this really true!? Is this up to date information? The reason I ask is that I have already spent a fair bit of time working with it and apart from a couple of exceptions it seems pretty good- I don't really want to have to start from scratch.

Blockchain.info API is not bad but Blockchain.info has a lot of problems which may cause problems when receiving payments and it is not a good idea to depend on a third party because you will have to temporarily (unintentionally) close your service as you can't accept payments.

Another reason I want to use the blockchain.info API is that it comes with code which does stuff like automatically detects a payment. I really wouldn't know how to start doing something like that on my own!

If you don't code, then it's better to go with BitPay or Coinkite(recommended).

P.S. Before you go with Coinkite or BitPay, please check https://www.blocktrail.com/api/docs and see if you can create a simple pay button with it.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: RocketSingh on July 02, 2015, 04:42:20 PM
You'd better go with a serious service like BitPay:

https://bitpay.com/api

Does it allow to accept bitcoin without conversion to FIAT ? I used to know bitpay is used to convert a bitcoin payment instantly to FIAT.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 02, 2015, 05:22:31 PM
You'd better go with a serious service like BitPay:

https://bitpay.com/api

Does it allow to accept bitcoin without conversion to FIAT ? I used to know bitpay is used to convert a bitcoin payment instantly to FIAT.

AFAIK its optional.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: RocketSingh on July 02, 2015, 06:35:57 PM
Better use hierarchical deterministic wallet. Advantages are:

 - You don't need to rely entirely on third party.
 - You don't need to expose private keys to create corresponding public keys(addresses).

Softwares for various languages are available here -- https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Implementations.

Feel free to post here if you need any help.

This seems to be a nice solution. Especially this one for PHP - https://github.com/Bit-Wasp/bitcoin-lib-php. But, does not it require to run this code as well as a Bitcoin daemon on two separate VPS instance ?


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 03, 2015, 04:46:05 PM
This seems to be a nice solution. Especially this one for PHP - https://github.com/Bit-Wasp/bitcoin-lib-php. But, does not it require to run this code as well as a Bitcoin daemon on two separate VPS instance ?

Nope. You can generate extended public keys from using a software, the PHP program you mentioned, for example. You can sign a transaction using corresponding private key in an offline machine using a software, https://github.com/bip32/bip32.github.io, for example.

I recommend you to read http://blog.richardkiss.com/?p=313.


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: RocketSingh on July 03, 2015, 06:42:10 PM
This seems to be a nice solution. Especially this one for PHP - https://github.com/Bit-Wasp/bitcoin-lib-php. But, does not it require to run this code as well as a Bitcoin daemon on two separate VPS instance ?

Nope. You can generate extended public keys from using a software, the PHP program you mentioned, for example. You can sign a transaction using corresponding private key in an offline machine using a software, https://github.com/bip32/bip32.github.io, for example.

I recommend you to read http://blog.richardkiss.com/?p=313.

I dont get it. How does an online website initiate transaction that is to be done offline ?

If we look at it as a replacement of blockchain.info receive API, the purpose it needs to serve is simple...

1. Generate an address for the user.

2. Get informed when there is an amount on that address as well as the amount itself.

3. Swipe the fund from this address to a pre-defined address.

Can the above be achieved online (as we need it for a website ofcourse) without running two VPS instance ? And even if I have a VPS, can Step 2 be done using https://github.com/Bit-Wasp/bitcoin-lib-php ?


Title: Re: Anyone successfully implemented blockchain.info's receive payments API?
Post by: Muhammed Zakir on July 03, 2015, 06:49:28 PM
I dont get it. How does an online website initiate transaction that is to be done offline ?

If we look at it as a replacement of blockchain.info receive API, the purpose it needs to serve is simple...

1. Generate an address for the user.

2. Get informed when there is an amount on that address as well as the amount itself.

3. Swipe the fund from this address to a pre-defined address.

Can the above be achieved online (as we need it for a website ofcourse) without running two VPS instance ? And even if I have a VPS, can Step 2 be done using https://github.com/Bit-Wasp/bitcoin-lib-php ?

 - Generate an extended public key and create address.
 - Give that unique address to customer.
 - Check if that address received any Bitcoins using any block explorers or you can use Bitcoin core.
 - Etcetera...

If you want to spend from that address, creat and sign transaction with XPRV locally using any of the software listed above and broadcast it.

P.S. https://github.com/Bit-Wasp/bitcoin-lib-php won't check transactions or notify you. You will have to add a simple script for checking transactions.