#jcalentine
1 messages · Page 1 of 1 (latest)
Hi there, can you tell me more about the problems that you are trying to resolve?
ok so I am currently trying to implement a webhook after a successful payment.
I am getting successful payments with no issues but the webhook is giving me 403 errors
OK, do you have the webhook event ID?
on the checkout.session.completed
yes one sec
we_1O0E7uJ4gBUKtXvTynXD3xs6
the payments are all succeeding but the webhooks are not.
Ok, this is your latest chekout.session.completed event https://dashboard.stripe.com/test/events/evt_1O0adqJ4gBUKtXvTjXdMqEiz
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
and i need the webhook to update my database after a successful checkout session
and this event is still pending because your webhook endpoint responded 400, and the response from your server says Invalid Stripe Signature
yes
I'd suggest you to double check the webhook secret that you use in your webhook integration.
that was because I tried something else
look at the one prior
one sec
let me do it again i just re-deployed my test server
here you go: we_1O0E7uJ4gBUKtXvTynXD3xs6
Was there a new event? I don't see any
No I don't see any, the latest event occured at
2023-10-13 02:14:29 UTC
can you check now?
evt_1O0axoJ4gBUKtXvTnnHa84Mx
here is the one prior: "id": evt_1O0atVJ4gBUKtXvT4pbzZDke
Your server returned 403 this time
<h1>Forbidden <span>(403)</span></h1>
<p>CSRF verification failed. Request aborted.</p>```
yes
but my webhook is set with a csrf_exempt decorator because it is not required correct?
Why do you want to set a CSRF verification in your webhook server?
I do not. I want to wait until i get a checkout.session.completed. Then i want to flag a user from standard to premium user in the database
i have this in my view: @csrf_exempt
def stripe_webhook(request):
OK, then I'd suggest you to fix this CSRF problem and try again.
i am confused. So i need to provide a csrf token for the webhook?
No, I don't think you need to do that. I mean you should remove the CSRF verification for webhook events sent from Stripe.
what about this event "id": "evt_1O0bbBJ4gBUKtXvT5FBL6Kfa",