Skip to main content
Solved

Package billingPeriod "value" incorrect: seems to be iso8601-1 instead of iso8601-2

  • 7 June 2024
  • 2 replies
  • 29 views

I seem to be getting an incorrect value for my free trial billingPeriod on Android.

I thought it would be good to ask here whether I’m understanding this correctly and/or whether to open an issue on GitrHub.

  • I’ve set the trial period to 90 days in the Play Console, but in the returned package I’m getting 86 days.
  • Looking at the iso8601 value, 84 days corresponds to 12 weeks so it looks like it’s ignoring the 6D.
  • I’ve just learned that iso8601-1 doesn’t allow any other values if W(eeks) is specified but iso8601-2 does. 

It seems like, although P12W6D is correct (84 days + 6 days = 90 days) the ‘value’ field is showing an iso8601-1 interpretation (84 days only) rather than iso8601-2.

Could this be a bug?

 

 

This post has been closed for comments

2 replies

Userlevel 3
Badge +3

`P12W6D` is coming directly from Google, and I just created a quick test to reproduce it and can see how our ISO8601 Period parsing code is wrong and it’s parsing it as 12 weeks, as it doesn’t expect a mix of weeks and days.

I just created this GitHub issue https://github.com/RevenueCat/purchases-android/issues/1753 to keep track of it

Badge

Fab, thank you!

I’ve put temporary workaround code in for now so I’ll take that out once this comes through.