#saitamaoo7_webhooks
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
π This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1430805282237321236
π Have more to share? Add more details, code, screenshots, videos, etc. below.
hey teddy
Hey! do give me some time to take a look at this
Do you have an example event where they are not being delivered/received? The prefix should look like (evt_xxx)
the documentation mentions events that will be thrown when the checkout session is cancelled or expired, or if the checkout session is completed
When a session expires:
checkout.session.expired - Sent after 24 hours (by default) if the customer doesn't complete the checkout
When a session is completed:
checkout.session.completed - Sent when a customer successfully completes the checkout process
For asynchronous payment methods (like ACH):
checkout.session.async_payment_succeeded - Sent when a delayed payment method finally succeeds
checkout.session.async_payment_failed - Sent when a delayed payment method fails
Note: There is no specific webhook event for when a customer manually cancels a Checkout Session. Cancellations are typically captured as:
The customer closing the browser tab (no specific event)
The session eventually expiring (triggering checkout.session.expired)
For payment methods with redirects, you might see payment-specific failures
none of these are being triggered on my webhook
payment completed events are being triggered
but those are from the payment Intent events I think
"id": "evt_3SLHTlIQpVe63aeV1Y3yN6Gp",
"type": "charge.succeeded"
this was from a session I completed half an hour ago
Taking a look at this now!
Ah just to check, is https://demo-my.orthofx.com/smylio1/patient/v1/notifyEvent the webhook endpoint you are referring to?
Its receiving 405 errors as seen on your dashboard here. 405 errors typically happen when the endpoint (in this case /v1/notifyEvent) isnt configured correctly
Could you send me a code snippetsof your webhook endpoint implementation? I believe it could have been configured as a GET endpoint rather than a POST endpoint
yes, but it is a POST endpoint itself
I will share the snippet
I see, yes maybe having a code snippet would help
@PostMapping(path = "/notifyEvent") public ResponseEntity<EmptyJsonResponse> handleStripeSubscriptionWebHook(HttpServletRequest httpServletRequest,HttpServletResponse response, @RequestBody final String request, @RequestHeader(value="Stripe-Signature", required = false)String sigHeader ) throws StripeException { orderService.handleStripeSubscriptionWebHook(request,sigHeader, response); return new ResponseEntity<>(new EmptyJsonResponse(), HttpStatus.OK); }
I think my webhook was not configured to include checkout events as well
If those are included this should work i guess
I will try this out and let you know
I also had a doubt with affirm flow testing, should that be asked here or in a seperate thread or directly on the support portal?
Apologies, what do you mean by Affirm flow testing?
I am creating a checkout session so that a user can pay, but the payment method is limited only to Affirm
The checkout session works as expected, and when the payment is completed the flow throws a success event via webhook
But the only issue I am having is that, I need to simulate a failure and an error flow as well, so that our QA can test those scenarios as well
i tried multiple methods that the AI chatbot suggested but they do not throw a payment failed event unfortunately
π taking over for my colleague. Let me catch up.
sure no problems
sorry I haven't been able to look into your issue yet.
I asked my colleague to step in and help you out
sure, no problems
hey there! you should be able to simulate an Affirm failure by closing the test modal (for redirects like this, there's usually a 'Fail authentication' button or something similar)
do you have the ID of any example test payments where you've tried to simulate a failure?
ah sorry, I see what you mean now
so I created a test stripe account to test this initially,
on that account whenever I would create a checkout session with only Affirm enabled, it would redirect me to a page like this
just tried a test and I can see that we redirect you to Affirm's sandbox mode rather than the normal Stripe-maintained, page
but now on my company's official stripe account (sandbox -- not live mode) it redirects to this;
yeah
not sure how to test payment failures when we do this
there are checkout events for this maybe, that i came across when configuring the webhook just now
Affirm isn't considered an 'async' payment method (i.e. like bank transfers), so the success/fail events in that screenshot aren't relevant here. The event type that would be relevant for a payment failure is payment_intent.payment_failed.
Still looking into how to simulate a failure in the sandbox though
okay
so just to confirm, to handle payment success would be payment_intent.payment_success and for failure payment_intent.payment_failed right?
we should not look at checkout events for handling payment completion right? only the paymentIntent events?
if you're using Checkout Sessions, then checkout.session.completed will fire on successful payment (for 'immediate' payment methods): https://docs.stripe.com/checkout/fulfillment?payment-ui=stripe-hosted#immediate-versus-delayed-payment-methods
payment_intent.succeeded will also fire on payment success: https://docs.stripe.com/api/events/types#event_types-payment_intent.succeeded
payment_intent.payment_failed will fire when a payment fails: https://docs.stripe.com/api/events/types#event_types-payment_intent.payment_failed
okay yes makes sense
also is there any scenario where I should check the health of Stripe or Affirm, before creating the checkout session, if one or both are down for some reason?
you can use Stripe's status page to check whether Stripe is down: https://status.stripe.com/
but you shouldn't generally need to check this before creating a Checkout Session
okay
did you get a chance to look into simulating failure/error in the affirm sandbox?
yes but I'm afraid this is something we'll need to confirm asynchronously with our product team
I'll send a link to create a case with our team directly, and then once we have confirmation, we'll follow up with you via email if that's ok
Hello @light osprey, we tried to send you a direct message, but couldn't
- π We would like to send you a message that has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
- Please enable direct messages from members of this Discord server (please see the instructions here) and let us know so we can try again!
oh okay
yes please
can you try sending the link again?
I had the DM setting off on discord
Hello @light osprey, we have sent you a direct message, please check it at https://discord.com/channels/@me/1430847855429550181
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
alright thank you @celest kelp @bright iron @polar wasp for your help, means a lot!
have a good day!