Braintree Webhooks : How can I notify customer that their subscription has been canceled

标签 braintree

当我收到取消订阅的 webhook 时,我无法通过付款信息检索客户信息,因为它已被删除。具体来说,我正在尝试获取客户的电子邮件。

最佳答案

全面披露:我在 Braintree 工作。

您可以从 webhook 中提取客户 ID。您没有指定客户端库语言,但在 Ruby 中可以这样做:

webhook_notification = Braintree::WebhookNotification.parse(
  bt_signature_param, bt_payload_param
)

customer_id = webhook_notification.subject.subscription.transactions.first.customer.id

将客户 ID 从您的 Webhook 传递到 Customer.find 调用中。然后检查结果对象以提取电子邮件地址。

More information on parsing webhooks here .

如果您有任何其他问题,请随时联系Braintree support .

关于Braintree Webhooks : How can I notify customer that their subscription has been canceled,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36039699/

相关文章:

node.js - 如何在以 Electron 方式运行的brainstree中启用paypal支付?

javascript - 回调中的 Braintree 下降和 Angular $scope 不起作用

javascript - Braintree.js drop-in,动态更新客户端 token ?

jquery - 如何通过 AJAX 将表单数据提交到 Braintree 透明重定向?

paypal - Braintree 生产帐户请求被拒绝

android - Ionic 应用程序因 braintree 插件而崩溃 - java.lang.NoSuchMethodError : No static method getFont

c# - Braintree API 在 Sandbox 中的 CreateCard.Create 上抛出 Braintree.Exceptions.AuthorizationException

android - 使用 Braintree Drop-In UI 集成 Google Pay

php - Braintree dropin UI : validate billing address custom fields before form submit

python - 这是使用 API 在 Python 中为 Braintree 创建订阅的正确方法吗