0

I want to accept payments with the Blockchain Receive Payments API Using create different user different address on get bitcoin but not work Callback api

https://blockchain.info/api/api_receive

&& also try Monitor addresses for received and spent payments api but not work

My problem is, the callback is never called— can anyone check my code and tell me where I the problem is?

i also try to log create but not called and check callbacl log api using not call.

please solved my problem :)

create balance update api using this file create.php

$url = "https://api.blockchain.info/v2/receive/balance_update";
    $secret = $address;
    $post_data = array(
        "key"           => $this->API_KEYCODE,
        "addr"          => $address,
        "callback"      => "https://my-server.com/callback.php?customer_id=".$user_id."&secret=".$secret,
        "onNotification"=> "KEEP",
        "op"            => "RECEIVE",
        "confs"         => $conf
    );

    Log::info('START SERVICE CALL :' . json_encode($url). " : ".json_encode($post_data));
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, count($post_data));
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER , array(
        "cache-control: no-cache",
        "content-type: text/plain",
    ));
    $ccc = curl_exec($ch);
    curl_close ($ch);

    Log::info('END SERVICE CALL :' . $ccc);
    $json = json_decode($ccc, true);
    return $json;

this api successful return response in index id , address and callback url

second file callback.php

Log::info('TEST : START (BLOCKCHAIN Callback)========================================');
    Log::info('GET : '.jsone_encode($request));
    Log::info('GET : '.jsone_encode($_GET));
    $res = 'Nothing';

    $out_address = $_GET['secret'];
    $in_address = $_GET['address'];
    $user_id = $_GET['customer_id'];

    $transaction_hash = $_GET['transaction_hash'];
    $confirmations = $_GET['confirmations'];
    $value_in_satoshi = $_GET['value'];
    $value_in_btc = $value_in_satoshi / 100000000;

    $status = true;

    if($status == true) {

                $res = "*ok*";
        } else {
            //Waiting for confirmations


            $res = "Waiting for confirmations";
        }
    }
    Log::info('RES : '.$res);
    Log::info('TEST : END (BLOCKCHAIN Callback)========================================');
5
  • Where is your code?
    – Carlo
    Feb 1, 2018 at 12:01
  • i call balance update api and success response return but not callback my url call any log and callback_log api thought check not callback Feb 1, 2018 at 12:12
  • I presume you have checked your callback address is responding on outside requests? Can you make a manual callback test if you try just key https://my-server.com/callback.php?customer_id=foo&secret=bar?
    – Willtech
    Feb 1, 2018 at 12:41
  • yes i also try manual is work and create log and i try to callback log api in check also blank array response Feb 2, 2018 at 3:58
  • Callback is not really working. But you can use blockchain web socket alternatively. Nov 16, 2018 at 23:41

1 Answer 1

1

It's not about your code; it's from Blockchain.info.

I've made a transaction right now and never received the callback.

Blockchain.info always has these types of issues from time to time.

Please aware an issue with gap limit also. They may say that you've created 20 unused addresses and you're not.

3
  • Yes We check Callback API But, Every time we get blank(null) response in the callback log. Feb 2, 2018 at 4:05
  • you have any idea for the other bitcoin send and receive api provider? Feb 2, 2018 at 4:06
  • block.io would be an alternative, but it sucks as hell since you should pay for each generated address. Soon we will launch wallet my team, and I was working on for a long time. You can receive LTC, BTC, BCH. No gap limit and many other features, not any other wallet have.
    – Adam
    Feb 2, 2018 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.