Bitaps.com Error Code 10

0 votes

I am trying to execute the following code:

<?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
?>
The error I get: {"error_code": 10, "message": "payment_list element incorrect keys", "details": ""}
How can i solve this error?
Sep 7, 2018 in Blockchain by digger
• 27,620 points
25 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Mistake in word qouta. Need quota

$rules = [
    array('address'=>'btc1', 'quota'=> 95),
    array('address'=>'btc2', 'quota'=> 5),
    array('address'=>'btc2', 'quota'=> 0)
  ];
answered Sep 7, 2018 by slayer
• 29,040 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

what is use of msg.sender in solidity code?

msg.sender(address) function indicated the sender of the ...READ MORE

answered Apr 24, 2018 in Blockchain by Shashank
• 10,330 points
220 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,620 points
1,531 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
63 views
0 votes
1 answer
0 votes
1 answer

Blockcypher API code error

This code will work: <?php try ...READ MORE

answered Aug 23, 2018 in Blockchain by slayer
• 29,040 points
57 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.