#prince996 - subscription
1 messages · Page 1 of 1 (latest)
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.
but when i want to renew this subscription, i am setting the setCancelAt(null) to cancel the cancellation.
Can you share the request ID (req_xxx) that is doing this? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
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);
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
sub_1Lc0oKKmlDsDVSTgDWAsDb5e
Thanks! Give me a few minutes to look into this.
sure
I found a few request, but they where made from the dashboard. For example: https://dashboard.stripe.com/test/logs/req_KsY6zKNBnTnjIf
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
?
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("") ?
as per my last discussion this setCancelAt((Long) null) suggested to me if i want to cancel the cancellation of existing subs
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