#RGRTHAT

1 messages · Page 1 of 1 (latest)

old adderBOT
round heron
#

Right after someone have successfully payed for something, i send a request to my backend

urban silo
#

Can you elaborate? Do you want to know which event to listen for? Or are you looking for a field on the Payment Intent?

round heron
#

on payment success the request is sent. However someone can ofcourse call this request anytime, so i need to have a check serverside

#

in the request serverside I edit a table in database and set a column named "payed" to true

#

I suppose i can send the paymentIntent with the request? and then evaluate the paymentIntent serverside?

#

but does the paymentintent update straight after the paymentIntent succeeds?

#

I basically just have to check if the paymentIntent was success, so I can update a column in my database

#

as I have understood before, the stripe updating of paymentintents is slow. So u cant use it?

#

@urban silo I want to retrieve a paymentIntent based on client_secret. When i get the response, what field do I have to look for, to evaluate if a paymentIntent is successfully payed for

#

if the payment went through

urban silo
#

Apologies for the wait. I'm juggling a few threads as the server is very busy. Taking a look at your questions now

#

Is there a reason you aren't using webhooks for this? You can listen for payment_intent.succeeded and code your webhook handler to do this for you whenever a Payment Intent is paid

round heron
#

@urban silo yes client-side i check for payment_intent.succeeded, and then i send a request to my backend

#

and then on the request backend, i edit a column in my database

#

the problem is that some random dude can just hit my request route in postman for example

#

and edit the column in database, and mark column as "payed"

#

I dont want that, so i need to be able to check if the paymentIntent was actually payed serverside, not clientside.

#

before i edit the column.

#

@urban silo does that make sense?

urban silo
#

the problem is that some random dude can just hit my request route in postman for example
and edit the column in database, and mark column as "payed"
How is that possible? Do you not sanitize your inputs? If you're using webhooks already then this should be going to your server already (not the client). You could then set up a signature check to make sure this doesn't ever happen as well: https://stripe.com/docs/webhooks/signatures

Verify the events that Stripe sends to your webhook endpoints.

round heron
#

@urban silo never used webhooks but i suppose i need to do it like so

#

I can edit the column in database when the webhook hits and the status is payment succeed

urban silo
#

That's the best way to do it. It is far more dependable and less prone to breaking down. Also, more secure, for the reasons specified above

round heron
#
❯ stripe listen --forward-to localhost:8000/webhooks

⢿ Getting ready... 

```this is loading forever and timeout
#

@urban silo

#
❯ stripe login
Post "https://dashboard.stripe.com/stripecli/auth": dial tcp: i/o timeout
```even login timeout
grand mauve
#

Have you had the CLI working for this perviously? Or for anything else?

#

Oh, interesting

round heron
#

i have never really used cli before

#

this is first time

grand mauve
#

Is it possible you're behind some strict network filtering?

#

You may need to have some entries allow-listed to connect to Stripe

round heron
#

I use firewall software

grand mauve
#

Are you able to make API requests from curl or postman?

grand mauve
round heron
#

lol

#

im updating the cli with brew

#

i will try to login again after that

grand mauve
#

👍

round heron
#

yup it was my firewall