【问题标题】:How to get customer email with Stripe webhook / endpoint如何使用 Stripe webhook / 端点获取客户电子邮件
【发布时间】:2019-08-14 00:43:44
【问题描述】:

尝试使用 Stripe 端点/webhook 获取客户电子邮件。电子邮件地址未显示。

这是我目前得到的:

 <?php

 require_once('stripe/init.php');

 \Stripe\Stripe::setApiKey("sk_test_xxxxxxxxxxxxxxxxxxxxxxxxx");

 $input = @file_get_contents("php://input");

 $event_json = json_decode($input);

 $customer = $event_json->data->object->email;

 $email_stripe = $customer->email;

 if ($event_json->type == 'charge.failed') {

 }

 if ($event_json->type == 'charge.succeeded') {

 }

 ?>

【问题讨论】:

    标签: php json stripe-payments endpoint


    【解决方案1】:

    该对象中没有email,但有可用于此目的的receipt_email。您必须在充电时设置才能将其取回。

    否则会有返回客户 ID 的 customer。您可以使用它来额外调用get all the customer's details

    【讨论】:

      猜你喜欢
      • 2014-12-01
      • 2021-12-28
      • 1970-01-01
      • 2021-04-09
      • 2019-09-05
      • 1970-01-01
      • 2022-11-25
      • 2010-10-23
      • 1970-01-01
      相关资源
      最近更新 更多