bitcoin core – Blockchain receive callback API at callback url not working

I would like to accept payments using Blockchain Receive Payments API using Create a different user address to get Bitcoin but the Callback API is not working

&& Also try to monitor received and spent Payments API addresses but not working

My problem is that the callback is never called – can someone check my code and tell me where the problem is?

I’m also trying to log the build but it’s not called and checking the callbacl log api using non-contact.

Please solve my problem 🙂

Create a balance update API using this file create.php

$url = "
    $secret = $address;
    $post_data = array(
        "key"           => $this->API_KEYCODE,
        "addr"          => $address,
        "callback"      => "
        "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 successful API reply in index id, address and callback url

callback.php second file

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

    $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 link

Related Posts