Bitcoin Forum
May 13, 2024, 10:42:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Callback on receive payment  (Read 1585 times)
Seal (OP)
Donator
Hero Member
*
Offline Offline

Activity: 848
Merit: 1078


View Profile WWW
May 31, 2013, 02:19:40 PM
 #1

I'm in the process of setting up a receive payment server that can make calls when a payment is received.

Essentially I'd like to emulate the behaviour of instant payment notifications as seen on btc-e with live updating confirmations.

Blockchain.info provides something similar (which I'm using at the moment) but their service is unreliable: https://blockchain.info/api/api_receive

DefiDive - Filter the noise
A clean crypto asset management terminal
1715640179
Hero Member
*
Offline Offline

Posts: 1715640179

View Profile Personal Message (Offline)

Ignore
1715640179
Reply with quote  #2

1715640179
Report to moderator
1715640179
Hero Member
*
Offline Offline

Posts: 1715640179

View Profile Personal Message (Offline)

Ignore
1715640179
Reply with quote  #2

1715640179
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715640179
Hero Member
*
Offline Offline

Posts: 1715640179

View Profile Personal Message (Offline)

Ignore
1715640179
Reply with quote  #2

1715640179
Report to moderator
1715640179
Hero Member
*
Offline Offline

Posts: 1715640179

View Profile Personal Message (Offline)

Ignore
1715640179
Reply with quote  #2

1715640179
Report to moderator
1715640179
Hero Member
*
Offline Offline

Posts: 1715640179

View Profile Personal Message (Offline)

Ignore
1715640179
Reply with quote  #2

1715640179
Report to moderator
Seal (OP)
Donator
Hero Member
*
Offline Offline

Activity: 848
Merit: 1078


View Profile WWW
June 01, 2013, 01:16:42 AM
 #2

Anybody?

Coinbase also offers the same functionality: https://coinbase.com/docs/merchant_tools/callbacks

DefiDive - Filter the noise
A clean crypto asset management terminal
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
June 01, 2013, 01:42:31 AM
 #3

it's in 0.8.2
Quote
Command-line options
--------------------

* -walletnotify will call a command on receiving transactions that affect the wallet.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
Seal (OP)
Donator
Hero Member
*
Offline Offline

Activity: 848
Merit: 1078


View Profile WWW
June 01, 2013, 08:58:50 AM
 #4

it's in 0.8.2
Quote
Command-line options
--------------------

* -walletnotify will call a command on receiving transactions that affect the wallet.

Thanks, I did a lot of reading up and it looks like its what I'm after. I'm surprised that there are no pre-written classes to handle this as its something that almost every bitcoin retailer would find useful. The closest I've found is:

https://github.com/hostvpn/whmcs-coinbase-bitcoin/blob/master/modules/gateways/callbacks/coinbase.php

If anyone else out there has written a few functions / classes to handle this then I'd love to see it.

DefiDive - Filter the noise
A clean crypto asset management terminal
piuk
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1005



View Profile WWW
June 01, 2013, 10:10:37 AM
 #5

In what way are you finding notifications from blockchain unreliable? The speed of forwarding payments or the notifications each new block?

Seal (OP)
Donator
Hero Member
*
Offline Offline

Activity: 848
Merit: 1078


View Profile WWW
June 01, 2013, 12:32:51 PM
 #6

In what way are you finding notifications from blockchain unreliable? The speed of forwarding payments or the notifications each new block?

Hey piuk,

Yeah, that was a major issue a few weeks back but even since your fix it still seems to happen sporadically.

Two other issues as well. It appears that the callback url isn't called consistently... Also the logs tell me that my site is returning 'Invalid Server Response'. I'm certain that my response is developed corectly (to not echo anything until 6 confs, then return *ok*)

I will PM you two callback URL's you can check the logs to see what I'm talking about.

Is the server load balanced or traffic throttled in any way? Maybe there are too many outbound/inbound connections? Just thinking out aloud...

DefiDive - Filter the noise
A clean crypto asset management terminal
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
June 01, 2013, 08:50:38 PM
 #7

Thanks, I did a lot of reading up and it looks like its what I'm after. I'm surprised that there are no pre-written classes to handle this as its something that almost every bitcoin retailer would find useful. The closest I've found is:

https://github.com/hostvpn/whmcs-coinbase-bitcoin/blob/master/modules/gateways/callbacks/coinbase.php

If anyone else out there has written a few functions / classes to handle this then I'd love to see it.
Considering it's a new feature, there aren't going to be prewriten classes for it.

The description says "Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)". So I would imagine you set the command to a .php/.pl/.py/.sh script that fetches the full transaction info and updates your database.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
ExchangeCurrency
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
October 24, 2014, 03:25:14 AM
 #8

Hi,
i had alot of problems with this Bitcoin API too, specialy the callback URL
after 2 nights of Headaches,i finaly found the problem :p
this is a DEMO, who is interesting to integrate this LOVELY API on his website he can "Check before Buy" here is the link : http://ex-currency.com/btc/index.php
Payment Sent/Recieved/Confirmed IMMEDIATLY
the price of curiosity is 1 USD
obale
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile WWW
October 24, 2014, 10:02:18 PM
 #9

I am working currently on something similar.

My setup consists of one background daemon that monitors the bitcoin network and reacts to incoming transactions. If a transaction matches a given pattern, it is published to a Redis PubSub channel. On the other end a NodeJS application gets the message and forwards it to all connected clients (via socket.io). By using Redis publish/subscribe, it is possible to extend that approach with any notification mechanism, e.g. e-mail, mobile push notifications, SMS, you name it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!