#cyclops_elements-choice

1 messages ยท Page 1 of 1 (latest)

midnight canopyBOT
#

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

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

quartz prawnBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

toxic heron
#

@elfin pelican I would always recommend using PaymentElement (the first one) it's wayyyy more powerful and offers more than just card

#

cyclops_elements-choice

elfin pelican
#

Okay, gotcha, know there are some question I wanted to ask you

#

Can I create it without clientsecret?

#

Basically what if I want to give a trial on subscription in that case I don't get a client_secret

toxic heron
#

So yes we support an integration path without a client_secret and it's documented here: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=subscription

Basically what if I want to give a trial on subscription in that case I don't get a client_secret
That's not correct! You misunderstood a small thing (that is hard to grasp at first). If you have a trial period then the first Invoices is for $0 so there's no PaymentIntent. But instead the Subscription would have pending_setup_intent: 'seti_123' which is a SetupIntent and that one has its own client_secret

elfin pelican
#

Okay, thanks for the clarification, I really appericate that

#

I wasn't able to get the setupintent, can you please tell where I can read the setupintent docs?

toxic heron
#

Do you have an example Subscription id I can look at?

elfin pelican
#

Of trial?

toxic heron
#

yes

elfin pelican
#

Here you go! sub_1OwClcJX5V9XswsNwPzvnzFh

#

Quick question is the document incorrect for response, The docs says return jsonify(type='setup', clientSecret=subscription.pending_setup_intent.client_secret)

But when I'm printing the data I'm getting it with subscription.pending_setup_intent, there is not client_secret

Leave this i was missing pending_setup_intent in expand, so this is sorted now

toxic heron
toxic heron
#

yep but you understand the Expand feature and what it does right? (If not I want to explain it first)

elfin pelican
#

Yeah

#

I understood that

#

There are a lot of stuff to understand to play with stripe ๐Ÿ˜…

toxic heron
#

Okay perfect so now look at that request I shared and you should see pending_setup_intent: "seti_1OwClcJX5V9XswsNxyMMpLYO",

#

basically you don't have a PaymentIntent on that Invoice so we create a SetupIntent for you that lets you collect card details (and other payment methods) for future payments.
The problem is that you forgot to expand that pending_setup_intent

#

if you change your code to expand both pending_setup_intent and latest_invoice.payment_intent you can then look at each one to see which is non null and has a client_secret

#

Does that make sense?

elfin pelican
#

Yeah, that's done I'm getting the response too

#

Now there was a error in front end

#

Was using confirmPayment and when I get a seti_*****_secret**** I need to use confirmSetup correct?

toxic heron
#

correct. It's super annoying and I dislike that (and keep pushing internally) but right now you have to know whether it's a PaymentIntent or SetupIntent and call the right one

elfin pelican
#

Yeah, had to add if confition to make it settle for now, but thanks for the help

#

I have few more question

toxic heron
#

sure

elfin pelican
#

All the black box, I want to remove them, so can you please walk me through how I can achieve that?

toxic heron
#

Okay so first I will say you shouldn't. Supporting more than just card is a huge feature that will likely increase your overall revenue/conversion.

elfin pelican
#

This one?

toxic heron
#

yes