<blockquote>
  <p>I'm looking to create a web app similar to coffee.foldapp.com where they load up a bitcoin address and once you pay it will automatically show the Digital code product. They seem to be using 0-confirmation. I heard it was risky, but why are they doing it then?</p>
</blockquote>

<p>It is risky since you accept the transaction without it being in the blockchain. See the accepted answer to <a href="https://bitcoin.stackexchange.com/questions/32335/whats-the-easiest-way-to-someone-to-double-spend-0-confirmation-transactions">this</a> question for a double spend example: as mentioned in the comments it is still difficult to work. <a href="https://bitcoin.stackexchange.com/questions/24936/how-to-minimize-risk-when-accepting-zero-confirmation-payments">This</a> question is related. Merchants are doing it because they are willing to accept the risk for small value transactions. You will hear several percentages on the risk factor but it is generally low. Some examples <a href="https://blog.blockcypher.com/yes-someone-double-spent-bitcoin-no-zero-confirmation-payments-are-not-dead-944d021b865e" rel="nofollow noreferrer">here</a> and <a href="https://www.reddit.com/r/Bitcoin/comments/3ddkhy/bitcoindev_significant_losses_by_doublespending/" rel="nofollow noreferrer">here</a>.</p>

<blockquote>
  <p>I'd like to do the same approach since my digital items aren't super expensive and have the option for zero confirmation.</p>
</blockquote>

<p><em>Super expensive</em> is relative. </p>

<blockquote>
  <p>What are some ways to do this? Does the client browser have to constantly ping the server to get a payment status update? Or does the server push it to the client's browser?</p>
</blockquote>

<p>The server <a href="https://en.wikipedia.org/wiki/Push_technology" rel="nofollow noreferrer">pushing</a> to the client is the way to go from an engineering perspective.</p>

<blockquote>
  <p>I'm planning to do this in PHP if its even possible. Or can I just do it without PHP and just tap into API's of other sites like blockchain.info?</p>
</blockquote>

<p>Even if you don't use your own node (or other people nodes) directly and want to use the API of a site you will still need to program it in some language. For example, the blockchain.info site has an <a href="https://blockchain.info/api" rel="nofollow noreferrer">API</a> library for PHP.</p>

CC BY-SA 3.0
2016-02-23T10:39:33.557Z
2016-02-23T10:39:33.557Z
2017-04-13T12:47:33.660Z
karask
<p>Zero confirmations is risky and not recommended. Best to wait for one / two confirmation</p>

<p>Client browser doesn't need to constantly ping Server. You can use websocket connection for callback on transaction . For example see <a href="https://www.blockonomics.co/views/api.html#txnotify" rel="nofollow">https://www.blockonomics.co/views/api.html#txnotify</a></p>

CC BY-SA 3.0
2016-02-28T08:21:43.913Z
2016-02-28T08:21:43.913Z
dark knight
<p>I'm looking to create a web app similar to coffee.foldapp.com where they load up a bitcoin address and once you pay it will automatically show the Digital code product. They seem to be using 0-confirmation. I heard it was risky, but why are they doing it then? </p>

<p>I'd like to do the same approach since my digital items aren't super expensive and have the option for zero confirmation. </p>

<p>What are some ways to do this? Does the client browser have to constantly ping the server to get a payment status update? Or does the server push it to the client's browser?</p>

<p>I'm planning to do this in PHP if its even possible. Or can I just do it without PHP and just tap into API's of other sites like blockchain.info?</p>

<blockchain><api><blockchain.info><payment>
Building a web app to collect Bitcoin payments. How should I monitor transactions on payment?
Patoshi パトシ
# Building a web app to collect Bitcoin payments. How should I monitor transactions on payment?

(Asked by: username_0 on 2016-02-22)

I'm looking to create a web app similar to coffee.foldapp.com where they load up a bitcoin address and once you pay it will automatically show the Digital code product. They seem to be using 0-confirmation. I heard it was risky, but why are they doing it then?

I'd like to do the same approach since my digital items aren't super expensive and have the option for zero confirmation.

What are some ways to do this? Does the client browser have to constantly ping the server to get a payment status update? Or does the server push it to the client's browser?

I'm planning to do this in PHP if its even possible. Or can I just do it without PHP and just tap into API's of other sites like blockchain.info?

**Tags:** blockchain, api, blockchain.info, payment


---

## 2 answers

### Answer by username_1 on 2016-02-23. Score: 1

> I'm looking to create a web app similar to coffee.foldapp.com where they load up a bitcoin address and once you pay it will automatically show the Digital code product. They seem to be using 0-confirmation. I heard it was risky, but why are they doing it then?

It is risky since you accept the transaction without it being in the blockchain. See the accepted answer to [this](https://bitcoin.stackexchange.com/questions/32335/whats-the-easiest-way-to-someone-to-double-spend-0-confirmation-transactions) question for a double spend example: as mentioned in the comments it is still difficult to work. [This](https://bitcoin.stackexchange.com/questions/24936/how-to-minimize-risk-when-accepting-zero-confirmation-payments) question is related. Merchants are doing it because they are willing to accept the risk for small value transactions. You will hear several percentages on the risk factor but it is generally low. Some examples [here](https://blog.blockcypher.com/yes-someone-double-spent-bitcoin-no-zero-confirmation-payments-are-not-dead-944d021b865e) and [here](https://www.reddit.com/r/Bitcoin/comments/3ddkhy/bitcoindev_significant_losses_by_doublespending/).

> I'd like to do the same approach since my digital items aren't super expensive and have the option for zero confirmation.

*Super expensive* is relative.

> What are some ways to do this? Does the client browser have to constantly ping the server to get a payment status update? Or does the server push it to the client's browser?

The server [pushing](https://en.wikipedia.org/wiki/Push_technology) to the client is the way to go from an engineering perspective.

> I'm planning to do this in PHP if its even possible. Or can I just do it without PHP and just tap into API's of other sites like blockchain.info?

Even if you don't use your own node (or other people nodes) directly and want to use the API of a site you will still need to program it in some language. For example, the blockchain.info site has an [API](https://blockchain.info/api) library for PHP.


---

### Answer by username_2 on 2016-02-28. Score: 0

Zero confirmations is risky and not recommended. Best to wait for one / two confirmation

Client browser doesn't need to constantly ping Server. You can use websocket connection for callback on transaction . For example see <https://www.blockonomics.co/views/api.html#txnotify>


---

