#pkdiscgolf_checkout-embedded

1 messages ¡ Page 1 of 1 (latest)

gilded finchBOT
#

👋 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/1271129613187289109

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

pallid tulip
#

So, i just spent at least 20 minutes trying to figure out how to post in this forum. Its not event clear to me how i stumbled upon this form. I tried messaging moderators for help, but i am blocked from messaging everyone. Finally, when i tried to post in the various threads, it said "you do not have permission"

random relic
#

Finally, when i tried to post in the various threads, it said "you do not have permission"
That's by design. we make everyone fill out the above form you filled out to ask a question

#

It ensures quality, developer oriented questions

#

Do you want a stripe hosted payment page?

#

Or do you want to build your own checkout page?

#

If you want stripe-hosted, then Stripe-checkout does make the most sense here I think

#

Payment Links could also work for you

pallid tulip
#

Ok, so i think its poor design.

How does someone ask a question. Is there a guide for that? I just need it for next time because I do not know what I did to get to the form

random relic
#

It's just the form in the #help channel

#

It walks you through asking a question there

pallid tulip
#

when i go to help channel, it says you do not have permission

random relic
#

Can you screenshot?

#

You can't see the messages and buttons?

pallid tulip
random relic
#

Yeah you can't type a message in there that's expected

#

But read the message

#

You fill out a form by clicking a topic

pallid tulip
#

How does someone ask a question if they don't understand your system?

random relic
#

That channel walks you through asking a question

pallid tulip
#

I guess I am getting off topic. IMO your system is too difficult to figure out and I expect you lose a lot of questions due to confusion.

pallid tulip
#

I would simply like to provide the total charge to the stripe api, then when payment is complete I would need to add that successful payment to my database. Do you know what solution I am looking for?

random relic
#

Oh then if you want your own checkout page Stripe Elements makes more sense

pallid tulip
#

When the payment is successful and the user is redirected to the success page, Is any object or anything included in that page? or does it simply just redirect to that url

gilded finchBOT
random relic
#

Shoot I linked the reactnative guide not reactjs guide my bad

timber shell
#

pkdiscgolf_checkout-embedded

random relic
#

Is any object or anything included in that page?
Yeah you get payment_intent and payment_intent_client_secret as query params

#

Mentioned in that above reactjs guide

pallid tulip
#

"if (error) {
// This point will only be reached if there is an immediate error when
// confirming the payment. Show error to your customer (for example, payment
// details incomplete)
setErrorMessage(error.message);
} else {
// Your customer will be redirected to your return_url. For some payment
// methods like iDEAL, your customer will be redirected to an intermediate
// site first to authorize the payment, then redirected to the return_url.
}
};"

In the checkoutform.js, line 36 would fire off only if the payment succeeded correct? I am trying to figure out where I would put the database transaction that records successful payment and that users id and other details I collected before payment

#

It appears that the payment intent object will not contain the information i desire to process at the success page

timber shell
#

@pallid tulip after a successful payment, we redirect to your return_url, so we leave the page entirely. After the redirect is when you would record the success

pallid tulip
#

So, the recomended action is to record the successful payment with a database transaction on the success page. However it seems that once I get to the success page, I will no longer have any of the data i collected from my user while they registered.

timber shell
#

you woud have stored this before you confirm the payment usually

pallid tulip
#

interesting, so basically take the users info and put in database, process payment, then on the success page modify a column such as "is_paid = true" to confirm that as paid? Feels like i'm stuck in the same connondrum, how do i access that database id for the customer info row from the success page? I only have a payment intent object as I understand

timber shell
#

yes to the first part. And really on the second, you should know who they are. When I naviagate on Amazon's website, every page knows who I am using a session/cookie. It's the same for every website really
When I get redirected after a payment, your server-side code should already know who I am, what I was doing before, etc. with a cookie/session

pallid tulip
#

well, i guess I do have the users info as they are authenticated. But this is a registration platform for different events and each event has a few different registration pools. So I am not visualizing how I "carry" the event_id and pool_id in a session or cookie.

#

when you say "session" is that different then a "checkout session"?

timber shell
#

when you say "session" is that different then a "checkout session"?
yes, nothing to do with Checkout. I am using the word "session" as a common term for web developers, it's related to using a cookie to track who is on your website and what they do

So I am not visualizing how I "carry" the event_id and pool_id in a session or cookie.
this is something you usually store in the PaymentIntent's metadata for example. Or in your database you have the "order xxxx for event yyyy associated with the PaymentIntent pi_123

pallid tulip
#

Would it be possible for a user to modify or create their own cookie, then navigate to the successpage, and "fake" a succesful payment

timber shell
#

the cookie is your own, it has nothing to do with Stripe. Can an attacker make a fake cookie that pretends they are another logged in user?

#

like this is not a real question, it's more to shift your focus to be about web development (your own app/code). That should be impossible for an attacker to do

pallid tulip
#

Ok, thanks for the help