#prince996 - subscription trial

1 messages ยท Page 1 of 1 (latest)

lyric sphinx
#

๐Ÿ‘‹ Thanks for reaching out

feral grove
#

sure let me check, thanks

feral grove
#

hey i have checked the link, so basically you are suggesting to schedule a subscription with current phase with current subscription and second phase with the new subscription. right?

lyric sphinx
feral grove
#

like this. right? i have used this in my other scenario

#

could you please confirm once?

lyric sphinx
feral grove
#

okay i will check and also i have one query, can i remove or cancel scheduled subscriptions?

flint stratusBOT
#

This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

bleak marsh
#

yeah sure, sorry, but it was a while since the thread was active

#

let me know if you need any more help

feral grove
# feral grove like this. right? i have used this in my other scenario

I am changing the code structure from this to new way below:

List<Object> phases = new ArrayList<>();
Map<String, Object> item1 = new HashMap<>();
item1.put("price", price.getId());
item1.put("quantity", 1);
Map<String, Object> item2 = new HashMap<>();
item1.put("price", subscriptionPlan.getStripePriceId());
item1.put("quantity", 1);
Map<String, Object> phase1 = new HashMap<>();
phase1.put("trial_end", startingDateSeconds);
phase1.put("items", item1);
phases.add(phase1);
Map<String, Object> phase2 = new HashMap<>();
phase1.put("items", item2);
phases.add(phase2);
Map<String, Object> params = new HashMap<>();
params.put("customer", subscription.getCustomer());
params.put("end_behavior", "release");
params.put("phases", phases);

    SubscriptionSchedule.create(params);

but there is no start_date for the phase to start like we have the startDate for individual phases to start. could you please help me to understand the structure of this?

bleak marsh
#

you mean the start date of the schedule?

feral grove
bleak marsh
#

I really suggest not using Maps but instead using the different builders we provide in our SDK. It would be easier to build your objects

feral grove
#

actually because of code duplicacy i am trying to swicth from builder to maps. but i am confused with the process

#

so what would you suggest should i use builders always?

#

?

frail geode
#

Hi there ๐Ÿ‘‹ I'm jumping in as my teammate needed to step away. Please bear with me a moment while I catch up on the context here.

#

I'm not sure if we have a recommendation one way or the other here.

feral grove
#

let me give a example suppose in some case i just have to give trial date params for trialing period subscription or in other startDate or endDate param for active subscriptions, so just for these params i have to write the whole builder code for these. that's why i am asking for suggestion which is best for this?

frail geode
#

Either approach works, so I would recommend using whichever better fits what you want.

#

Sorry, I feel like I might not be understanding your question.

frail geode
#

I'm archiving this thread, but if there are additional questions or anything else that we can assist with, then please let us know in #dev-help. ๐Ÿ‘‹

hexed delta
#

cc @feral grove

feral grove
#

thanks

#

so as i discussed yesterday on my query. so now i need to discuss more on this.
I have a requirement, suppose user has a yearly subscription with yearly trial period and user cancel the subscription in their trial period. so basically it will cancel the subscription but user is valid for the trail period right. so suppose then he again renew their subscription with the same package or may be with another package. so this will start after the period of current trial period. right?
so first i need to know how can i achieve this?

hexed delta
#

I am catching up on yesterday chat but it doesn't seem very clear to me. My first thought on your newest question is, I don't think after you cancel a Subscription "user is valid for the trial". Do you see such a behavior in a specific Subscription?

feral grove
#

i didn't understand how pausing payment collection will work on my scenario. could you please tell me your thoughts on this?

#

my requirement is simple, if user cancels the current subscription then i will cancel it, but user is still valid for current period(maybe user is in trial period or active period) if available.
so after canceling he again thought of renewing the subscription and then he again choose the new subscription plan or same current plan. then it will be in active phase when the current period is over.
And may be he will do these actions(cancel or renew) again and again or number of times but my basic functionality is just that whatever he chooses it will be active when the current period is over.
Note: renew criteria is just that if he do cancel and renew number of times then i will detach the last renewed plan and then attach the new plan he selected. but the current existing plan period will work normally if there is days left.

hexed delta
#

What you describe doesn't sound like something we offer today. In our API concept once you "cancel" a Subscription, everything about it stops immediately. Workarounds I can think of are:

  1. Instead of cancelling, utilize pause/unpause to keep the Subscription on page without charging customer. Whenever they renewed you can unpause the Sub and update the new Plan accordingly
  2. Use the parameter https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end It won't cancel the Sub immediately but scheduled to cancel at the period end. When they renewed you can simply Update the Sub again and unset this parameter
  3. Subscription Schedule could be helpful. It's a bit of complicated API but it allow you to schedule change/cancel like 2. does
hexed delta
#

Hi, I am archiving this thread again. If you are back and have questions, feel free to ask to reopen