#prince996 - subscription

1 messages · Page 1 of 1 (latest)

pastel swallow
#

Hi there!

#

Can you summarize your question in this new thread?

uneven root
#

sure

#

actually i am using this below code to cancel a subscription as per my requirement at specific date

SubscriptionUpdateParams subscriptionUpdateParams = SubscriptionUpdateParams.builder()
.setCancelAt(nextYearSubsLastDate.getEpochSecond())
.setProrationBehavior(SubscriptionUpdateParams.ProrationBehavior.NONE)
.build();
subscription.update(subscriptionUpdateParams);

#

after running above code i am getting this bar of cancel status

#

but when i want to renew this subscription, i am setting the setCancelAt(null) to cancel the cancellation. this doesn't remove the above status bar of cancellation.

pastel swallow
uneven root
#

I can't be able to find the exact req_id, can i send you a sub_id?

#

and i am using this below code to disable the cancellation and renew subscription

SubscriptionUpdateParams subscriptionUpdateParams = SubscriptionUpdateParams.builder()
.setCancelAt((Long) null)
.setProrationBehavior(SubscriptionUpdateParams.ProrationBehavior.NONE)
.addItem(
SubscriptionUpdateParams.Item.builder()
.setId(subscription.getItems().getData().get(0).getId())
.setPrice(subscriptionPlan.getStripePriceId())
.build())
.build();
subscriptionObj = subscription.update(subscriptionUpdateParams);

pastel swallow
#

I can't be able to find the exact req_id, can i send you a sub_id?
Yes I should be able to find the request ID using the subscription ID

uneven root
#

sub_1Lc0oKKmlDsDVSTgDWAsDb5e

pastel swallow
#

Thanks! Give me a few minutes to look into this.

uneven root
#

sure

pastel swallow
uneven root
#

yes i only made the request of removing the cancellation status bar from dashboard

#

because i am testing my scenario and this cancelAt null case is not working so that's why i made a request from dashboard

#

my only concern right now is why setCancelAt((Long) null) not working

#

?

eager coral
#

what does 'not working' mean?

#

do you get a specific error message?

#

I mean you can't set it to null

#

does it let you do setCancelAt("") ?

uneven root
#

let me check

#

not possible

#

param requires a Long object

uneven root
eager coral
#

well in the API itself you clear this by setting the value to "" , I'm not sure how it's done in the stripe-java library

#

I don't think setting to null works since that' the same as just not passing it at all so it doesn't do anything

uneven root
#

yes

#

but how can i remove the cancellation then?

eager coral
#

maybe setCancelAt(EmptyParam.EMPTY)

uneven root
#

let me try

#

Yes it works and removes the cancellation bar and also set cancel_at to null