-1

I am using bitaps.com to receive bitcoin payments on my site, and I create the address perfectly by calling this.

/api/create/payment/{payout_address}/{callback}[?confirmations=0-10]

and when I do that I receive this:

{
  "address": "14aT7ELki1pVWtryd5brMGqsFySWgjy8je",
  "payment_code": "PMTvvdRdFBPvY1KrDeRxSuwr4nDcMVBenbX2rB2zRYHBHbGRYK5Lu",
  "invoice": "invNfFnca2Vg49dDg77exiQmqrVKCMBWsBBrB95HNZGbAwqQpNY2b"
}

and now when I receive a payment I will get callback to the url I specified. How would I receive the callback, and how how would I return that I got it? In the docs it says this:

When a payment is received, Bitaps REST API will notify your's specified callback URL. In order to acknowledge successful processing of the callback, your server should respond with invoice number inside response body. In case server response incorrect, call back will be resent again for every new block within 3 days. Callbacks with not expected response may be blocked from the service.

How does it notify? Do I use $_get['address'];? Or is it something else? Then after how do I return the invoice number to them?

Nikhil
  • 3,711
  • 8
  • 32
  • 43
Matthew Bergwall
  • 310
  • 1
  • 10

1 Answers1

0

From the documentation - Processing the callback:

When a payment is received, Bitaps REST API will notify your's specified callback URL. In order to acknowledge successful processing of the callback, your server should respond with invoice number inside response body. In case server response incorrect, call back will be resent again for every new block within 3 days. Callbacks with not expected response may be blocked from the service.

Right below that it says:

POST your_callback_url

{
  "invoice": "{invoice}",
  "tx_hash": "{transaction hash}",
  "code": "{payement code}",
  "confirmations": {confirmations},
  "amount": {amount} # satoshi
}

That means they will notify you by calling the URL you specified using the POST method and transmitting invoice, tx_hash, code, confirmations and amount.

To let them know you have received the data and that it is correct, you then need to return (in this case output) the value of invoice.

Bobface
  • 2,782
  • 4
  • 24
  • 61