2

I am planning to write a site that receive payments in Bitcoin.

The client add products to the cart, then during check out I will create a Bitcoin address to let him pay for it (each cart gets a unique address). I found the code to create multiple address here. I plan to use the NBitcoin library.

How do I verify the Bitcoin address has been paid? I'm planning to use a service like blockchain.info, but I only have the following information

  1. destination Bitcoin address (my generated address)
  2. the amount it should receive

Is there an easy way to use blockchain.info to query that my address was really paid using C#? I read the API but it is confusing.

1

I'm not sure about Nbitcoin node's API, but I could help you on a blockchain explorer API.

I would recommend Blockr.io, they are fast and trustable. Use the following code to check for confirmed transactions: (output is in json)

http://btc.blockr.io/api/v1/address/balance/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk?confirmations=1

Change the confirmations tag to whatever amount you want. I highly advise against 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.