我正在使用 GoCardless API 创建订阅。我已经创建了它,现在尝试在表格中显示付款。
API 返回一个 stdClass 对象,其中包含数组中即将支付的款项。我怎样才能在表格中显示这些?
$SUBS=$client->subscriptions()->get("$SUB");
Subscription Class
stdClass Object
(
[id] => SB00024BNFEEHX
[created_at] => 2020-03-07T20:20:05.025Z
[amount] => 5998
[currency] => GBP
[status] => active
[name] =>
[start_date] => 2020-03-12
[end_date] =>
[interval] => 1
[interval_unit] => monthly
[day_of_month] =>
[month] =>
[count] =>
[metadata] => stdClass Object
(
[subscription_number] =>
)
[payment_reference] =>
[upcoming_payments] => Array
(
[0] => stdClass Object
(
[charge_date] => 2020-03-12
[amount] => 5998
)
[1] => stdClass Object
(
[charge_date] => 2020-04-14
[amount] => 5998
)
[2] => stdClass Object
(
[charge_date] => 2020-05-12
[amount] => 5998
)
[3] => stdClass Object
(
[charge_date] => 2020-06-12
[amount] => 5998
)
从我尝试过的其他问题
$array = json_decode(json_encode($SUBS),true);
echo"$array";
然而,这只是显示/打印Array