我正在嘗試使用帶有PHP的Stripe API檢索我的條紋餘額。條紋API餘額
我打電話以下幾點:
function retrieve_balance()
{
$response = Stripe_Balance::retrieve();
return $response;
}
這將返回是這樣的:
object(Stripe_Balance)#28 (5) {
["_apiKey":protected]=>
string(32) "my_key_here"
["_values":protected]=>
array(4) {
["pending"]=>
array(1) {
[0]=>
object(Stripe_Object)#32 (5) {
["_apiKey":protected]=>
string(32) "my_key_here"
["_values":protected]=>
array(2) {
["amount"]=>
int(0)
["currency"]=>
string(3) "usd"
etc...
我試着做以下,但它只能導致錯誤。我正在嘗試獲取待處理和可用的數量。
<?php
var_dump($balance);
/*Issue Line Below*/
echo $balance->pending->amount;
?>
我得到的錯誤是:Trying to get property of non-object
它看起來像掛起的是對象的數組,你有沒有試過'$ BALANCE->待定[0] - > amount' – Cory 2014-11-01 00:15:23