#cyclops_elements-choice
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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.
- cyclops_api, 5 days ago, 54 messages
@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
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
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 havepending_setup_intent: 'seti_123'which is a SetupIntent and that one has its ownclient_secret
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?
Do you have an example Subscription id I can look at?
Of trial?
yes
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
Okay so look at https://dashboard.stripe.com/test/logs/req_sSLgkgdJbnDl1x which is the API Request that created it.
You can see your code is using the Expand feature to get the Invoice in latest_invoice and its PaymentIntent in the payment_intent proeprty right?
Yes
Also, it's null
yep but you understand the Expand feature and what it does right? (If not I want to explain it first)
Yeah
I understood that
There are a lot of stuff to understand to play with stripe ๐
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?
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?
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
Yeah, had to add if confition to make it settle for now, but thanks for the help
I have few more question
sure
All the black box, I want to remove them, so can you please walk me through how I can achieve that?
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.
now with that said, you can configure which options to offer in the Dashboard here https://dashboard.stripe.com/settings/billing/invoice?tab=general at the bottom of that page you can configure the payment methods to accept for Invoices and Subscriptions
yes