简体   繁体   English

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

[英]How to handle dispute event in webhook?

I'm a amateur php developer.我是一名业余 php 开发人员。 I accepts stripe payments in my php website as one-time payments.我在我的 php 网站上接受分条付款作为一次性付款。 I've integrated it correctly according to stripe website docs.我已经根据条带网站文档正确集成了它。 ( https://stripe.com/docs/payments/checkout/one-time#create-checkout-session ). https://stripe.com/docs/payments/checkout/one-time#create-checkout-session )。 I'm getting checkout.session.created event from stripe webhook and I store it in my database as a completed payment.我从 stripe webhook 获得 checkout.session.created 事件,并将其作为已完成的付款存储在我的数据库中。 ( Advise me if I'm doing wrong ). (如果我做错了,请告诉我)。 This is the sample event data that stripe triggers as checkout.session.completed event.这是作为 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" }

But I need to handle webhook events for disputes.但我需要处理 webhook 事件以解决争议。 If a paid user opens dispute, I need to know it.如果付费用户提出争议,我需要知道。 How stripe notifies me it via webhook? Stripe 如何通过 webhook 通知我? If stripe notifies me, How do I find parent payment?.如果条带通知我,我如何找到父母付款? Sorry for my bad English.对不起,我的英语不好。

webbhook is a url provided by you to stripe, on which stripe will be sending data, just like how you send data from a form to your site. webbhook 是您提供给条带的 url,条带将在哪个条带上发送数据,就像您将数据从表单发送到您的站点一样。

You should follow stripe docs for it, https://stripe.com/docs/payments/handling-payment-events and https://stripe.com/docs/webhooks你应该关注它的条纹文档, https://stripe.com/docs/payments/handling-payment-eventshttps://stripe.com/docs/webhooks

You should ideally edit your original post to include the 'answer' you added yesterday - and remove that answer - as Stackoverflow isn't the same as a forum理想情况下,您应该编辑您的原始帖子以包含您昨天添加的“答案” - 并删除该答案 - 因为 Stackoverflow 与论坛不同

The Dispute object contains a Payment Intent ID and you can list / 'retrieve' the Checkout Session for that Payment Intent ID , so that's how you get it.争议 object 包含一个付款意图 ID ,您可以列出/“检索”该付款意图 ID 的结帐 Session,这就是您获得它的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM