【问题标题】:Bitaps.com Error Code 10Bitaps.com 错误代码 10
【发布时间】:2017-10-12 00:52:55
【问题描述】:

这是他们在我添加的字段的查询示例中给我的确切代码。无论如何我都无法让它工作。还有其他示例有效,但不是我需要的 1。

我得到的错误:{"error_code": 10, "message": "payment_list element wrong keys", "details": ""}

但是当我使用他们的现场执行程序时它会起作用。

<?php
  function post_api($url, $postfields) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $result = curl_exec($ch);
    return $result;
  }

  $confirmations = 3;
  $callback = urlencode("https://website.ml/ipnbtc?id=2&email=email@gmail.com");
  $fee = "low";
  $rules = [
    array('address'=>'btc1', 'qouta'=> 95),
    array('address'=>'btc2', 'qouta'=> 5),
    array('address'=>'btc2', 'qouta'=> 0)
  ];

  $postfields = json_encode(array('type'=>"payment_distribution", 'payment_distribution'=> $rules ));
  $data = post_api("https://bitaps.com/api/create/payment/smartcontract/". $callback . "?confirmations=" . $confirmations . "&fee_level=" . $fee, $postfields);
  echo $data;
  $respond = json_decode($data,true);
  $address = $respond["address"]; // Bitcoin address to receive payments
  $payment_code = $respond["payment_code"]; //Payment Code
  $invoice = $respond["invoice"]; // Invoice to view payments and transactions
?>

【问题讨论】:

    标签: php bitcoin


    【解决方案1】:

    qouta 字有误。需要配额

    $rules = [
        array('address'=>'btc1', 'quota'=> 95),
        array('address'=>'btc2', 'quota'=> 5),
        array('address'=>'btc2', 'quota'=> 0)
      ];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-24
      • 2018-08-25
      • 1970-01-01
      • 2012-05-02
      • 1970-01-01
      • 2019-09-29
      • 2018-06-02
      相关资源
      最近更新 更多