#frn.btc

1 messages ยท Page 1 of 1 (latest)

dense kestrelBOT
trim gorge
#

Hi there, yes the confirmation page is something that you need to create

crimson thistle
#

Right, but when following the custom payment flow docs, it makes it seem like that's all I need to do.

#

When should I create a session, and how should I tie that in with the payment intent? Doesn't seem like the documentation ties the two concepts together.

trim gorge
#

Can you send me the URL to doc that you are following?

crimson thistle
#

If a checkout session is required, then why does this payment flow not mention to create a checkout session?

#

Thanks btw ๐Ÿ™‚

trim gorge
#

Are you sure you are using CheckoutSession? because the doc that you sent is Custom payment flow which doesn't involve checkout session.

crimson thistle
#

Okay, so that is my question, how does checkout session play in with payment intent. Stripe documentation makes it seem like I'll be fit to charge customers without a checkout session, according to this code.

trim gorge
crimson thistle
#

Right, so if I'm successfully charging customers with payment flow, what benefit is there, or what reason is there, to include checkout session?

trim gorge
#

your question keeps changing, can you tell me what's the main ask?

#

i.e., is there a problem that you want to solve, or you are just curious on Checkout Sessions API in general?

crimson thistle
#

I don't understand how checkout session and payment flow relate

trim gorge
#

Checkout session is simply a payment flow that Stripe offers with prebuilt checkout page.

crimson thistle
#

Okay, so for custom code, do I even need checkout session? It seems I can get it done with just the payment flow code.

#

Alright, I guess this is getting redundant, I have an additional question that may be easier to answer, if that's ok.

#

When is the right time to create a Stripe customer? If I create a customer every time they're going to make a purchase, but abandon the process, and that happens for ... 1000 customers, then I'll essentially have 1000 customers that are effectively useless data points. Is that ok? Will I be charged for creating X amount of customers?

trim gorge
#

No, Stripe doesn't charge you based on the number of customers you have in your account.

crimson thistle
#

Ok, is this the expected way to create customers? Just create them every time they're going to do a payment?

#

if not existing already of course

trim gorge
#

I'd recommend you to reuse the customer object so that you can associate future payments with them, it's good for your auditing and easier for you to manage the customer records.

crimson thistle
#

I see, I understand now, it's either you use the custom payment flow, or use a checkout session. I was under the impression that a payment intent is a part of the checkout process.

#

So you can't create a custom confirmation page using a custom payment flow, unless you set up a customer first.

keen rivet
#

๐Ÿ‘‹ Taking over this thread, catching up now

crimson thistle
#

Okay, I will use my own user data and and append my own user's userId to the return_url

#

to create my own fully custom success page

keen rivet
#

Yes, that will work. Customer will be redirected to your return_url in Checkout Session after completing the payment

crimson thistle
#

sounds good my friend! thank you

keen rivet
#

No problem! We are happy to help ๐Ÿ˜„

crimson thistle
#

how do i pass the details of my customer's purchase to my confirmation page?

keen rivet
#

What details/data are you referring to?

crimson thistle
#

So I implemented custom payment flow following the documentation. Then I use the return_url in the confirmPayment function to get my user to the confirmation page.

#

When I get to that page, I'm just using the current signed in user's details to display their name, but is there a way to get some information on the payment they just made?

#

So I can do something like:

Thank you for your payment {user.name}!

Please review confirmation details:

value: {cost}
item: {item.name}
confirmation#: {stripeConfirmationId}

keen rivet
#

I see that you're using your custom flow. When the customer proceeds to payment, you should save the cart details including items purchased, amount and user name in your own database, then represent it with a cart ID. This cart ID can then set into the return_url which you can retrieve from your database later.

crimson thistle
#

Amazing, makes sense. Just wanted to make sure what was the suggested way to do this thanks!