<p>I would suggest using a Web API to get notified when a transaction happens on the address(es) you're interested in, it's by far the simpler. Something like this may help:</p>

<p><a href="http://dev.blockcypher.com/#websocket_webhook" rel="nofollow">http://dev.blockcypher.com/#websocket_webhook</a></p>

CC BY-SA 3.0
2014-05-23T18:33:42.553Z
2014-05-23T18:33:42.553Z
Matthieu
<p>for small amounts 6 confirmations are overkill, you could just listen for the payment to be relayed by some bitcoin nodes which happens in seconds. </p>

<p>For your question, clone bitcoinj and look at the examples (more specifically the 'Kit' example). Use that as a basis and then read the chapter on 'Watching Wallets' in the docs:
<a href="https://bitcoinj.github.io/working-with-the-wallet" rel="nofollow">https://bitcoinj.github.io/working-with-the-wallet</a></p>

<p>You can specify a listener which is called when there's activity on your address/wallet.</p>

CC BY-SA 3.0
2014-10-07T12:48:29.533Z
2014-10-07T12:48:29.533Z
MikeR
<p>I don't know about bitcoinj but I suppose it has some kind of Api that you could poll for the wallet state. What really seems strange to me is the fact of redirecting. taking into account that you should have to wait for 6 blocks for a transaction to be confirmed with some security you'll have the user waiting for about an hour to redirect :)</p>

<p>Bitcoin payment verification is not instantaneous as you seem to imply from your post.</p>

CC BY-SA 3.0
2014-05-21T20:18:06.497Z
I am sorry it looks like I dont know how long it takes to send the BTC, I want to make it with different cryptocurrencies later on I just need to understand how it works that's why I have written BTC - its the most common. And yeah I am looking for that API.
Ondrej 'zatokar' Tokár
CC BY-SA 3.0
2014-05-21T20:30:25.980Z
don't be sorry!:)
perencia
CC BY-SA 3.0
2014-05-21T20:05:09.250Z
2014-05-21T20:05:09.250Z
perencia
<p>I am developing JSP web. User will be redirected to another page only if he sends the certain amount of BTC, is there any listener which could check if money arrived to my wallet from the certain wallet address? 
And after leaving the page is there possibility to automatically send the money back to the user?</p>

<p>Maybe some good tutorial on bitcoinj or something? Any suggestions?</p>

<bitcoinj>
How to check if user sent me the BTC?
Ondrej 'zatokar' Tokár
# How to check if user sent me the BTC?

(Asked by: username_0 on 2014-05-21)

I am developing JSP web. User will be redirected to another page only if he sends the certain amount of BTC, is there any listener which could check if money arrived to my wallet from the certain wallet address?
And after leaving the page is there possibility to automatically send the money back to the user?

Maybe some good tutorial on bitcoinj or something? Any suggestions?

**Tags:** bitcoinj


---

## 3 answers

### Answer by username_1 on 2014-05-23. Score: 1

I would suggest using a Web API to get notified when a transaction happens on the address(es) you're interested in, it's by far the simpler. Something like this may help:

<http://dev.blockcypher.com/#websocket_webhook>


---

### Answer by username_2 on 2014-10-07. Score: 1

for small amounts 6 confirmations are overkill, you could just listen for the payment to be relayed by some bitcoin nodes which happens in seconds.

For your question, clone bitcoinj and look at the examples (more specifically the 'Kit' example). Use that as a basis and then read the chapter on 'Watching Wallets' in the docs:
<https://bitcoinj.github.io/working-with-the-wallet>

You can specify a listener which is called when there's activity on your address/wallet.


---

### Answer by username_3 on 2014-05-21. Score: 0

I don't know about bitcoinj but I suppose it has some kind of Api that you could poll for the wallet state. What really seems strange to me is the fact of redirecting. taking into account that you should have to wait for 6 blocks for a transaction to be confirmed with some security you'll have the user waiting for about an hour to redirect :)

Bitcoin payment verification is not instantaneous as you seem to imply from your post.

> **Comments:**
> **username_0**: I am sorry it looks like I dont know how long it takes to send the BTC, I want to make it with different cryptocurrencies later on I just need to understand how it works that's why I have written BTC - its the most common. And yeah I am looking for that API.  
> **username_3**: don't be sorry!:)  

---

