Reputation: 11
I'm a amateur php developer. I accepts stripe payments in my php website as one-time payments. I've integrated it correctly according to stripe website docs. (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. ( Advise me if I'm doing wrong ). This is the sample event data that stripe triggers as checkout.session.completed event.
{
"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. If a paid user opens dispute, I need to know it. How stripe notifies me it via webhook ? If stripe notifies me, How do I find parent payment ?. Sorry for my bad English.
Upvotes: 0
Views: 679
Reputation: 8747
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
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.
Upvotes: 0
Reputation: 1
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.
You should follow stripe docs for it, https://stripe.com/docs/payments/handling-payment-events and https://stripe.com/docs/webhooks
Upvotes: 0