#gunwant_dev
1 messages · Page 1 of 1 (latest)
Hello
You can find the expand the pending_setup_intent field when creating the subscription and client_secret will be present:
I have expanded pending_setup_intent but its return null.
Can you share the subscription ID (sub_xxx)?
OKay
Here is subscription id: sub_1Lgre0SC8iVyWevSPQMTfeGk
Hello
I'm waiting for your reply.
I'm checking why pending_setup_intent is null
Hi @fast field I'm taking over this thread
Give me some time to catch up the history of conversations
Okay
Can you briefly tell me what you want to achieve here? you want to setup a subscription schedule and collect the payment method from your customer later?
Also I notice your account is based in India, there are additional steps you need to follow you are using SetupIntent API directly (https://stripe.com/docs/india-recurring-payments#impact-other-products)
So the easiest way to get started with subscription is to use Stripe Checkout, and Stripe will automatically take care of the e-mandate requirement for you.
Hello
I have used the stripe payment element.
So I want client_secret to mount the stripe payment element.
In my case, I have created a subscription schedule with a trail, How can I get client_secret this this case?
You can create a normal subscription with trial first without using subscription schedule(so that pending_setup_intent is returned), then create subscription schedule to cancel the subscription after 5 iterations.
Alternatively you can also create a SetupIntent upfront to collect the payment method first before creating a subscription or subscription schedule.
Again, I'll highly recommend you to go through this doc https://stripe.com/docs/india-recurring-payments#impact-other-products before deciding with integration path you want to proceed.
My personal recommendation is Stripe Checkout.
I have checked the normal subscription with the trial it's working.
But same case for subscription schedule its not working.
Thanks for the recommendation is Stripe Checkout.
But I want a solution for the subscription schedule with trial.
The only solution that I can of right now is to create a subscription with trial first, and use its pending_setup_intent to collect a payment method before creating the subscription schedule.
But as I said same case for subscription schedule its not working
if you use the above solution, you don't need to collect a payment method for subscription schedule anymore because you've already collected it with the pending_setup_intent in the 1st subscription.
Yes, You are right but in my case cancel the subscription after X payments so I have used the subscription schedule iteration(X payment) with trial
Is there any solution to get client_secrete ?
I have expand 'pending_setup_intent' but its return null value.
Are you expending the pending_setup_intent from a normal subscription (i.e., not from subscription schedule)?
const scheduleData = {
****
expand: [
'subscription',
'subscription.latest_invoice',
'subscription.pending_setup_intent',
'subscription.latest_invoice.payment_intent'
]
};
await stripe.subscriptionSchedules.create(scheduleData, { stripeAccount: job.account_id });
Here is my code for subscription schedule.
Hmm, I thought I told you to use subscription first (e.g., not subscription schedule)?