Fixed term scenario problem

132 views
Skip to first unread message

Junaid Soomro

unread,
Sep 20, 2021, 9:25:07 AM9/20/21
to Kill Bill users mailing-list
Hi everyone,
I was testing fixed term functionality in killbill where i stumbled upon this issue. The problem is i am trying to achieve fixed monthly payment for unlimited duration. Until or unless the user cancels the subscription the fixed amount should keep on deducting from the account each month. Here is the catalog.

finalPhase type="FIXEDTERM">
<duration>
<unit>UNLIMITED</unit>
<number>-1</number>
</duration>
<fixed>
<!-- <billingPeriod>MONTHLY</billingPeriod> -->
<fixedPrice>
<price>
<currency>SAR</currency>
<value>576.978</value>
</price>
<price>
<currency>USD</currency>
<value>0.131730136986301</value>
</price>
</fixedPrice>
</fixed>
</finalPhase>
<plansAllowedInBundle>-1</plansAllowedInBundle>

The problem is this catalog gets uploaded without any errors but as as soon as i try to subscribe the respective plan it gives me below described exception.

{
"className": "java.lang.IllegalStateException",
"code": null,
"message": "Unexpected duration unit UNLIMITED",
"causeClassName": null,
"causeMessage": null,
"stackTrace": []
}

Any workarounds or fixes will be highly appreciated folks. Love!

Junaid Soomro

unread,
Sep 20, 2021, 9:33:08 AM9/20/21
to Kill Bill users mailing-list
I believe fixed price just provides one off payment functionality for specified time. Is there a way where we can bill user with a fixed amount each month until cancelled?

Mary McCauley-Stiff

unread,
Sep 20, 2021, 12:33:19 PM9/20/21
to Kill Bill users mailing-list
Hi Junaid,

I'm one of the tech writers working on Kill Bill docs. 

I think what you should be using instead of FIXED TERM is EVERGREEN. That seems to fulfill: "Until or unless the user cancels the subscription the fixed amount should keep on deducting from the account each month."

Regards,
Mary

Junaid Soomro

unread,
Sep 20, 2021, 3:50:26 PM9/20/21
to Kill Bill users mailing-list
Thank you for the prompt response Mary. What evergreen does is, it prorates the amount which is undesirable. 
Scenario:

Plan cycle Amount 100
If a user subscribes on 4th Sep. On Bill cycle day like 31 Sep 100 amount should appear in the invoice. No proration this should keep on going until the user cancels the subscription.

Junaid Soomro

unread,
Sep 20, 2021, 4:02:01 PM9/20/21
to Kill Bill users mailing-list
I am sorry i did try EVERGREEN it does not prorate the amount it just simply generates the first invoice and then I tried dry runs to check for future fixed amount invoices. The system did not produce any. 

Mary MS

unread,
Sep 20, 2021, 10:16:20 PM9/20/21
to Kill Bill users mailing-list
Hi Junaid,

So use EVERGREEN as the phase type, but switch fixedPrice to recurringPrice. That will let you bill a certain amount each month until the subscription is cancelled.

Regarding the invoicing, this is a matter of billing alignment. Check out https://docs.killbill.io/latest/userguide_subscription.html#_billing_alignment_rules and look at the bullet item for "SUBSCRIPTION." Another option is to set the BCD (billing cycle day) explicitly when creating the subscription (https://killbill.github.io/slate/#subscription-create-a-subscription: billingDate).

I hope this helps!
Mary

Junaid Soomro

unread,
Sep 21, 2021, 2:04:45 AM9/21/21
to Kill Bill users mailing-list
Hi Mary,
Yes i have tried that as well. That generates prorated credit. I want it to deduct the whole amount. Please try looking at the scenario below: 
Plan MI6 Amount 100
If a user subscribes on 4th Sep. On Bill cycle day like 31 Sep 100 amount should appear in the invoice. No proration this should keep on going until the user cancels the subscription.
Thank you Mary for you prompt responses.

Mary McCauley-Stiff

unread,
Sep 21, 2021, 12:09:28 PM9/21/21
to Kill Bill users mailing-list
Hi Junaid,

Thanks for your patience. 

Have you looked at setting entitlementDate and billingDate separately? (https://killbill.github.io/slate/#subscription-create-a-subscription) In your example, the user could access the product/system starting on Sept 4th, but wouldn't be billed until the date specified by billingDate. 

If this doesn't help, I will pull in another team member to help. As I mentioned, I'm familiar with the catalog concepts only by writing about them; I haven't configured any catalogs in real life! :-0 

Regards,
Mary

Junaid Soomro

unread,
Sep 21, 2021, 3:46:23 PM9/21/21
to Mary McCauley-Stiff, Kill Bill users mailing-list
Hi,
Mary, YOU ARE A GENIUS. I absolutely forgot about that and yes i came up with a workaround by setting the billingDate. Now the user gets charged for the whole month and I can delay the cancellation date to the end of the month to charge full amount. 
Thank you soooo much.

--
You received this message because you are subscribed to a topic in the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/killbilling-users/AHDrb2O54yU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/1ac33d8c-ca7c-4a39-874e-ed0a19fd708dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages