• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Blockchain Receive Callback API in callback url not working

Started by Bitcoin, Mar 24, 2022, 05:29 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Blockchain Receive Callback API in callback url not working

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)========================================');

Source: Blockchain Receive Callback API in callback url not working