Title: Receive Bitcoin via Coinpayments Post by: tendemo on October 10, 2017, 02:47:53 PM 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. Title: Re: Receive Bitcoin via Coinpayments Post by: retprogramisto on October 10, 2017, 08:42:31 PM CoinPayments documentation: https://www.coinpayments.net/apidoc
Sample code: https://www.coinpayments.net/apidoc-code IPN: https://www.coinpayments.net/merchant-tools-ipn WooCommerce plugin (as example): https://github.com/wp-plugins/coinpayments-payment-gateway-for-woocommerce/blob/master/class-wc-gateway-coinpayments.php Title: Re: Receive Bitcoin via Coinpayments Post by: tendemo on October 10, 2017, 08:47:10 PM 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
Title: Re: Receive Bitcoin via Coinpayments Post by: servsec on October 10, 2017, 10:10:27 PM 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.comTitle: Re: Receive Bitcoin via Coinpayments Post by: tendemo on October 10, 2017, 10:15:37 PM 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
Title: Re: Receive Bitcoin via Coinpayments Post by: retprogramisto on October 11, 2017, 04:34:30 AM 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( 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) { Relevant variables: Code: $_POST['status'] $_POST['received_amount'] $_POST['received_confirms'] See possible payment status here: https://www.coinpayments.net/merchant-tools-ipn Title: Re: Receive Bitcoin via Coinpayments Post by: tendemo on October 11, 2017, 08:30:25 AM Thanks so muck makes more sense now and would definitely be able now to glide through. :)
|