如何处理webhook中的争议事件?

问题描述 投票:0回答:1

我是一个业余的php开发者。我在我的php网站上接受stripe付款,作为一次性付款。我已经根据stripe网站的文档正确地集成了它。(https:/stripe.comdocspaymentscheckouton-time#creat-checkout-session。). 我从stripe webhook得到checkout.session.created事件,我把它作为一个完成的付款存储在我的数据库中。如果我做错了,请告诉我)。这是事件数据的例子,stripe触发checkout.session.completed事件。

{
  "id": "evt_123",
  "object": "event",
  "api_version": "2019-03-14",
  "created": 1561420781,
  "data": {
    "object": {
      "id": "cs_test_123",
      "object": "checkout.session",
      "billing_address_collection": null,
      "cancel_url": "https://example.com/cancel",
      "client_reference_id": null,
      "customer": "cus_123",
      "customer_email": null,
      "display_items": [],
      "mode": "setup",
      "setup_intent": "seti_1123",
      "submit_type": null,
      "subscription": null,
      "success_url": "https://example.com/success"
    }
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "checkout.session.completed"
}

但我需要处理争议的webhook事件。如果一个付费用户打开了争议,我需要知道它。stripe如何通过webhook通知我?如果stripe通知我,我如何找到父付款?对不起,我的英语不好,我是一个业余的php开发者。

javascript php stripe-payments webhooks
1个回答
0
投票

webbhook是你提供给stripe的一个网址,stripe会在这个网址上发送数据,就像你从表格中发送数据到你的网站一样。

你应该按照stripe的文档进行操作。https:/stripe.comdocspaymentshandling-payment-events。https:/stripe.comdocswebhooks。


0
投票

您最好编辑您的原始帖子,包括您昨天添加的 "答案"--并删除该答案--因为Stackoverflow不同于论坛

Dispute对象包含一个 支付意向ID 而你可以 列表'检索'该支付意向ID的结账会话。所以,这就是你如何得到它。

© www.soinside.com 2019 - 2024. All rights reserved.