この記事について
| 環境 | PHP + stripe |
|---|---|
| 目的 | webhookで受け取った customer_id からメールアドレスを取得する |
| 結果 | \Stripe\Customer::retrieve() で顧客情報を取得できた |
webhookで受信したデータから特定の情報を取り出す覚書
PHPでの書き方
//customer_id を使ってメールアドレスを取得
$customer = \Stripe\Customer::retrieve($customer_id);
$customer_email = $customer->email;
関連:webhook の設定手順
