#fearthisbeer_best-practices

1 messages ยท Page 1 of 1 (latest)

summer creekBOT
#

๐Ÿ‘‹ 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/1417169715452842136

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

drifting pagoda
#

Slightly tied with this but could not fit it into my question we are creating the customer through the API prior to creating the checkout session during the deposit step. Is there a way for us to default the shipping address? The few things I have tried have not worked so far.

raw pendant
#

Hello, I am having a bit of trouble understanding the specific question you are looking in to. Is this mostly about using automatic payment methods with Checkout or are you asking about how to display the Checkout Summary section?

drifting pagoda
#

A bit of both I guess? The customer I'm building this for wants to see the Checkout Summary section in the transactions which do show when we use the Payment Intent to do an automatic payment? But I'm not sure if theres a way to see that or if I should be doing something besides using just the Payment Intent to do an automatic payment?

raw pendant
#

Is this Checkout Summary a salesforce connector thing or are you using our embedded components? This server doesn't know anything about the connector so I think for that part you will want to reach out to SalesForce's support

#

For payment intents, to enable automatic payment methods you can pass enabled true for this parameter (it is the default in the latest API versions, but you may be using an older one where it isn't the default) https://docs.stripe.com/api/payment_intents/create#create_payment_intent-automatic_payment_methods

drifting pagoda
#

No I am just using the Flow components that come in the managed package, I think if need be I can create a manual rest callout without issue though.

But just making sure setting that to true will show the checkout summary section? Sorry if its confusing still am fairly new to Stripe

summer creekBOT
late dawn
#

Hi there. I'll be taking over for pompey, who needed to step away here

drifting pagoda
#

No worries!

late dawn
drifting pagoda
#

Yes I am using the Salesforce once but primarily just its calls to the REST API

late dawn
#

Echoing what pompey said - in this server we don't really know anything about that connector or what it does. For example, I don't know what a "Checkout Summary" is, as that isn't something that exists in "regular" Stripe

#

But Stripe support has a dedicated team that answers questions about officially supported connectors, so you can open a support case if your question is something specific to that connector

drifting pagoda
#

Sorry the Checkout Summary is in the dashboard on a transaction record. I can send a screenshot momentarily just need to blur some info

late dawn
#

Ah that's just the Stripe dashboard

#

So while we aren't experts in the behavior of the Stripe dashboard here, "Checkout" refers to the Stripe Checkout product here and I would not be surprised for that section to be absent on the transaction detail page of a PaymentIntent that was created directly and not via Checkout

drifting pagoda
#

Sorry if I made that confusing. But that Checkout Section only shows up when we create a Checkout Session and not just a Payment Intent. We are doing the Payment Intent as some of the Stripe docs were making it sound like that was needed to be able to automatically charge the customer which we want to do on the second payment.

#

Do you happen to know if there is a way to use a payment method that has been saved on a customer for a Checkout Session? To get this same functionality? Or is it only possible with using the Payment Intents directly?

late dawn
#

But that Checkout Section only shows up when we create a Checkout Session and not just a Payment Intent.

Correct and this is expected.

We are doing the Payment Intent as some of the Stripe docs were making it sound like that was needed to be able to automatically charge the customer which we want to do on the second payment.

That is also correct. You can't create off-session charges on Checkout - that isn't what that product is for

#

Do you happen to know if there is a way to use a payment method that has been saved on a customer for a Checkout Session? To get this same functionality? Or is it only possible with using the Payment Intents directly?

Could you explain what you want to do here a little more fully?

drifting pagoda
#

Yeah basically we are wanting to collect a deposit on a product and then in the future and (likely yearly) re-charge the customer for the final amount. But because they have already agreed we didnt want to send them additional links for payment if it wasnt necessary.

#

The hard part is while the deposit will be the same for every customer the final amount will be different.

late dawn
#

Yep, that's a usual use case.

drifting pagoda
#

Right now we are doing a Checkout Session for the deposit collecting the payment method and then using that in a Payment Intent later for the automatic process? Is there a better way that you would recommend for doing this?

late dawn
#

That's a fine way to do it - you just want to make sure you're configuring the Checkout Session and the PaymentIntent appropriately. For example, if you need to save the Payment Method you get from Checkout to use later you need to either create a Customer via the Customers API beforehand and keep track of it, or else use the customer_creation parameter in Checkout. In either case you should use the parameter payment_intent_data.setup_future_usage to optimize the Payment Method for later use

#

The other option, if your annual recurring payment is consistent, is to model this on Stripe Subscriptions and collect the up-front payment and set up a Subscription for the annual recurring payment

#

and you can do Subscriptions on Checkout

drifting pagoda
#

Gotcha, thankfully we are creating the Customer via the API prior and using the setup_future_usage. Sounds like overall everything is setup well just won't have access to that Checkout Summary section on the dashboard which shouldnt be terrible they just wanted me to look into it.

The one final thing I was hoping you may be able to help with is if it is possible to default the Shipping information on the Checkout Session so the user does not have to enter it. When we create the Customer we are entering both the Address and Shipping Address fields but when we go to the Checkout Session the Shipping Address section appears blank

#

I wasnt sure if there was property I need to set to have it default but still editable or if it just was not possible

late dawn
#

Not sure off the top of my head but let me look

drifting pagoda
#

Basically want to provide them a second chance to change anything if they notice it wrong when entering their information on our form prior to going to the payment page but don't want to have them re-enter everything if not needed

late dawn
#

Do you have an example Customer/Checkout Session I can lookout? I'm not exactly clear on whether we'll display the Customer's shipping address in Checkout if it is previously collected, though I suspect that we do

drifting pagoda
#

I can create one in just a second

#

Are you looking for the Id? Url? Or something else?

late dawn
#

id is good, or request id. Things that look like req_abc or cs_test_

drifting pagoda
#

Ok this looks to be the Customer Session Id: cs_test_a1IAVCWtUGF7Zcct7kNwi8LHdcNRGRZAgXtAb5MPSDzbX5mb7UhqeX0HVj and in case its easier the request Id: req_e8aZSxEJGuo428

late dawn
#

thank you!

#

Yep, we don't prefill details from the Customer object

#

(and if that payment method is a card)

drifting pagoda
#

Gotcha alrighty thank you so much for all of the help! I know it was a bunch of odd questions / requests ๐Ÿ™‚