#ravelens-subs-changes
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- ravelens-setupinetnt-defaultpm, 43 minutes ago, 9 messages
Hello ๐
There are a couple ways you can handle this.
The easy way would be to
1/ Charge customer a one-time price for the first 6 months
2/ Then create a monthly subscription with a 6 months trial
The other option is to use a subscription schedule
https://stripe.com/docs/billing/subscriptions/subscription-schedules
It allows you to define phases for different conditions
The price is same
Only time for bill
Because i want to give them free 6 month on first subscription
Then will be charge normal monthly
Okay, in that case the first recommendation is what you'd want
So what do you mean is
I needed to create 2 type of subsription ?
Yes, i am using API
$subscription = Subscription::create([
'customer' => $authUser->stripe_id,
'items' => [
['price' => $plan->plan_id],
],
'description' => $plan->name.' - Free ' . $plan->price > 0 && $total_salon <= 1000 ? '6 months' : '1 month',
'billing_cycle_anchor' => Carbon::now()->addDays($free_days)->timestamp(),
'billing_cycle_anchor_confid' => [
'day_of_month' => 1,
]
]);
Okay, great.
Assuming you have the payment method of the customer stored already, you can create an off-session charge using the PaymentIntents API
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
Once that charge is successful, you can create a subscription using the API call you shared above but add trial_period_days or trial_end date
But if i add the trial_period_days value, the status will be trial right ?
Can i make it active ?
But it have 6 months of subscription time ?
And the next one will be 1 month of subscription time
The status would be trialing yes and no it won't move to active until the trial is over
But it have 6 months of subscription time ?
And the next one will be 1 month of subscription time
not sure what you mean by that
I want the status is Active instead of trialing, is it possible ?
Because my superior asked me to make it Active instead of trialing
Because the 6months given is not a trial but like bonus
Hmm in that case you'd need to use a subscription schedule.
You can create two recurring prices,
1st price object - where you set interval to month and interval_count to 6
2nd price object - where you set interval to month and interval_count to 1
When you create the subscription schedule, you'll create phase 1 with 1st price object and set iteration to 1
Then in second phase to you switch the price to 2nd price object
https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#upgrading-subscriptions
does that clarify @misty ibex ?
I think this is clear enough
Let me try first yes
Thank you so much for the support ๐
NP! ๐ Good luck
But a moment please
sure
So this means, i do not need to create subscription for the customers ?
Just create subscriptionschedule directly ?
The subscription schedule will create a subscription, yes ๐
You don't need to create one separately
I see
So if we makes 2 phase of items
It will always take the last iteration as default subcription and recurring charges right ?
correct, once it moves to the second phase then you can release the subscription from the schedule too. Which will keep it going on the second price.
https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#releasing-subscription
Okay, clear
Thanks hanzo
NP! ๐ Happy to help