カテゴリー:
Stripe
閲覧数:330 配信日:2019-03-17 09:03
質問履歴24
After attaching the source to the customer object, how do I check from the customer object?
・2019/3/16
$customer1 = \Stripe\Customer::create([
"description" => "test",
'email' => 'a@example.com',
]);
$customerObj = \Stripe\Customer::retrieve($customer1->id);
$sourceObj = $customer->sources->create(["source" => 'src_xxxx']);
The source object has been created. I can understand this.
I can not understand where in the Customer object the source object was created.
How can I check the source object created above from the Customer object?
var_export($customer->sources->source);
・After attaching the source to the customer object, how do I check from the customer object?
A
更新されたソースをソースのリストに表示するには?
・Customerオブジェクトをもう一度取得する必要がある
・これにはhttps://stripe.com/docs/api#retrieve_customerを使用してくれ
\Stripe\Stripe::setApiKey("sk_test_xxxx");
$customer = \Stripe\Customer::retrieve('cus_EhrAhwK7W4OB41');
foreach($customer->sources->data as $key => $val){
echo $val->id."<br>";
}