#dineshkumar_error
1 messages ยท Page 1 of 1 (latest)
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.
- dineshkumar_code, 2 hours ago, 14 messages
- dineshkumar_docs, 4 days ago, 58 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255477486456930347
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
The likelihood is your call to create the Subscription reduces the initial invoice amount to 0 (e.g. trial period, discount). In which case there'd no payment due and no Payment Intent. Instead, in those scenarios you'd use the pending_setup_intent on the Subscription: https://docs.stripe.com/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
wnen i use payment behavoir allow_incomplete with 100%off promocode i got null value on Subscription.LatestInvoice.PaymentIntent
i want also save card details(paymentmethod) if trial or discount for future payment
when amount 0
Yep, the Setup Intent will facilitate the saving of payment method details too. You can use if with the Payment Element
please give me example code
I just did
You need to adjust your code to expand both latest_invoice.payment_intent and pending_setup_intent fields when creating the Subsciption. Only one of those will be set โ pending_setup_intent in the case of a zero-amount invoice (i.e. 100% discount) or latest_invoice.payment_intent if there is a payment due
Whichever is set, you can use the client_secret with the Payment Element to collect payment info and pay/save the details
understood now thank you very much.. for more details....