dqybjj3497 2014-08-05 01:47
浏览 27
已采纳

平衡付款错误中的致命错误

I've recently implemented Balanced Payments. I've updated my composer.json file and yet I get this error when running the PHP:

PHP message: PHP Fatal error:

Uncaught exception 'Balanced\Errors\Error' in /app/vendor/balanced/balanced/src/Balanced/Errors/Error.php:42"

I ran the following on the command line, and it says dependencies were all updated:

composer update

My composer.json looks like this:

{
 "require" : {
 "braintree/braintree_php" : "2.28.0",
 "balanced/balanced" : "1.*"
  }
} 

My PHP is as follows:

<?php

  #BALANCED
 require(__DIR__ . '/vendor/autoload.php');

  Httpful\Bootstrap::init();
  RESTful\Bootstrap::init();
  Balanced\Bootstrap::init();

   Balanced\Settings::$api_key = "ak-test-*************************";

  $amount = $_POST["amount"];
  $href = $_POST["href"];

 $bank_account = Balanced\BankAccount::get($href);
 $bank_account->credits->create(array(
     "amount" => $amount
   ));
  • 写回答

1条回答 默认 最新

  • dqpc1845 2014-08-05 15:29
    关注

    The API returned a response that threw a catchable Error. I suggest you wrap the code in a try/catch and determine what the API error was. A few quick common guesses, as it could be any number of things, $amount or $href is null, or $amount was not the amount expressed as an integer.

    Also, you'll find logs accessible via the Balanced Dashboard to be very helpful as you integrate the Balanced API.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据