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