Author

Topic: Receive Bitcoin via Coinpayments (Read 319 times)

newbie
Activity: 85
Merit: 0
October 11, 2017, 04:30:25 AM
#7
Thanks so muck makes more sense now and would definitely be able now to glide through. Smiley
member
Activity: 149
Merit: 34
💡 Websites, scripts for BTC web4crypto.xyz
October 11, 2017, 12:34:30 AM
#6
Edit: If you receive the error "No HMAC signature sent" generate a IPN secret here: https://www.coinpayments.net/index.php?cmd=acct_settings and add it to your callback code.

Edit 2: If you don't want to use IPN, you can use this API code: https://www.coinpayments.net/downloads/api-example.phps

Code:
$req = array(
'txid' => 'transaction_id', // e.g. 25fc307cc7a28d0cc18369f1775ea8e5be8495b33a74ae18a1a9c430b9d8a49c
'full' => '1'
);
print_r(coinpayments_api_call('get_tx_info',$req));
More info here: https://www.coinpayments.net/apidoc-get-tx-info



To check payment status you can use IPN (instant payment notification)

To track payments you can set the button "custom" field to the order ID.

Create a callback PHP page on your server with this code:
https://www.coinpayments.net/downloads/cpipn.phps

Change "ipn_url" field to the url of your callback script:
https://www.coinpayments.net/merchant-tools-buttons

This code deals with payment status:
Code:
   if ($status >= 100 || $status == 2) {
        // payment is complete or queued for nightly payout, success
        // e.g. now update orders database with "payment complete"
    } else if ($status < 0) {
        //payment error, this is usually final but payments will sometimes be reopened if there was no exchange rate conversion or with seller consent
    } else {
        //payment is pending, you can optionally add a note to the order page
        // e.g. now update orders database with "payment pending"
    }

Relevant variables:
Code:
$_POST['status'] $_POST['received_amount'] $_POST['received_confirms']

See possible payment status here:
https://www.coinpayments.net/merchant-tools-ipn
newbie
Activity: 85
Merit: 0
October 10, 2017, 06:15:37 PM
#5
Thanks , generating the links isnt an issue following up the status of a payment is what Im actually after. With such a link or using a payment button how would I proceed to get the status of a payment. I'd prefer using Advanced Buttons as they have have payment IDs. Thanks
newbie
Activity: 76
Merit: 0
October 10, 2017, 06:10:27 PM
#4
Thanks Ive had a look at those and ended up using the Advanced payment button. What I need to know is how to make the proper API call format , to get a transactions status using its Transaction ID. My Attempts have ended up with {"error":"No HMAC signature sent","result":[]} Thanks
You can generate checkout links with your Merchant ID at coinpaylink.com
newbie
Activity: 85
Merit: 0
October 10, 2017, 04:47:10 PM
#3
Thanks Ive had a look at those and ended up using the Advanced payment button. What I need to know is how to make the proper API call format , to get a transactions status using its Transaction ID. My Attempts have ended up with {"error":"No HMAC signature sent","result":[]} Thanks
newbie
Activity: 85
Merit: 0
October 10, 2017, 10:47:53 AM
#1
Hi I setup an Advanced form via coinpayments to receive Bitcoin payments. The form works pretty well but I would like to also follow up the status of my payments from my site. Can someone kindly give me an example of an API or using IPN consdering the transaction will have a unique invoice. Thanks
N.B I have my API keys and secret setup with permissions too.
Jump to: