#Filip-tls
1 messages · Page 1 of 1 (latest)
I'm trying to run through a checkout
all the fund arrive to me
but on the checkout.session.completed event
I trigger sending an email
and it just never works
All of this worked perfectly on localhost, but as soon as I moved it onto my VPS it's not working for webhooks
Do you have an event ID I can take a look at?
evt_3JeJmmCjwjFZFzX60JTiX5ab
Thanks for the help, I really appreciate it
This has been not giving me any peace of mind lol
I'm still looking! Thanks for being patient
Thank You!
So I can see on our end we're getting an error message of "SSL_connect returned=1 errno=0 state=error: wrong version number"
What does that mean? A wrong TLS version?
It means that we can't find an SSL version that works for us - can you disable sslv3 on your server and see what happens?
Have you also talked to your hosting provider about this?
Nope - what would i need to mention to them specifically?
For them to downgrade TLS support to 1.2?
Im guessing You dont support 1.3 right?
I would give them that exact error message "SSL_connect returned=1 errno=0 state=error: wrong version number" and tell than that we require 1.2 for our webhook
Which makes me think how, all the transaction requests come through, I get the payment, so it’s the events that does not get picked up
I wonder if it's something specific to the port - when I try and go to your site with the port you have in your webhook endpoint I get an ERR_UNSAFE_PORT error
I thought it might have been the port too!
Hmmm… what port would you suggest I use?
Omg… if this is it… what are the chances!
Ohhh I didn't actually know that!
Do you have a specific reason for specifying a port? Have you just tried the webhook endpoint w/o the port?
My express runs on that port! But I just randomly picked 6000
When I change the ports, can I just retrigger the web hook from the stripe dashboard?
Or do I have to simulate the whole transaction again?
You'd have to simulate the transaction again since you'll have to create a new webhook endpoint (the url will be different)
Okay I see! Is there a way I can test this while it’s live without putting my card through?
I'd definitely recommend adding this webhook to your test environment to make sure it works end to end, but if you do want to try it in live mode you could try confirming with events like customer.created which don't create any payment
Okay cool! I’ll go ahead and try the changes and keep you posted ! As per handling events, what is recommended to handle events
Are you looking for a specific recommendation for a certain situation? Or just general guidance on how to handle webhook events? I assume you already wrote your code to handle events if you're already live?
just general, yeah I have some events "handled" but some I leave blank when I dont need to trigger an action based on them. Is that ok?
What do you mean by you leave them blank? Do you have certain events enabled for your webhook endpoint that you're not responding with a 2XX for?
I have just changed the PORT, and still same thing but for a different event
now its for the checkout.session.completed
evt_1JeQ7MCjwjFZFzX6ynPgZ9Wn
I don't think I reply with any status code for the events
app.post('/api/payment_success', (req, res) => {
let event;
try {
event = stripe.webhooks.constructEvent(req.rawBody, req.headers['stripe-signature'], endpointSecret);
} catch (err) {
res.status(400).send("Webhook Error: ${err.message}"`);
}
switch (event.type) {
case 'payment_intent.succeeded':
break;
case 'checkout.session.completed':
const session = event.data.object;
if (session.payment_status === 'paid') {
handlePaymentIntentSucceeded(session);
} else {
console.log("Opps, the session has not been complete.");
}
default:
console.log("Unhandled event type ${event.type}");
}
res.json({returned: true});
});
This is what I have
There's still something wrong with your SSL for that port as well - if I go to https://shop.developerfilip.com:5000/ I see a ERR_SSL_PROTOCOL_ERROR. I really would suggest having your hosting provider take a look! They should know exactly how to fix it
I have my webhook only set for :
checkout.session.completed
payment_intent.succeeded
Okay will speak to them!
And I believe res.json({returned: true}); sends a 200 response code by default so you're good to go there!
Okay cool - one more question: Do I need to add ssl certificates for my shop.developerfilip.com:5000 domain separately?
Would that be considered a different domain?
I got this on SSL checker
Ah, if it's saying that no SSL certificates can be found at that port then yes, you need to add them - I'm not the best with these hosting questions, but I assume that this is something you can configure with them