Solved

How to handle expired subscription with billing error that can be renewed?

  • 2 October 2021
  • 1 reply
  • 142 views

Badge +1

Hello there!

 

I’ve stumbled upon a quite odd behavior while managing permissions of a subscriber. I give promotional entitlements based on some special users and I handle it by checking whether the subscription is expired or not.

In the case I’ve observed, after receiving a webhook containing information of a BILLING_ISSUE event, my routine waited for it to expire to check if the subscription was still active, and it wasn’t, so I revoked the promotional entitlement.

However, the user latter came to complain, and when I checked their profile on RevenueCat’s dashboard, their subscription was active, but without any events on new subscription or renewals. I immediately returned their promotional entitlement, but I was lost with no information to why they were still active.

I’ve used the expiration_at_ms to wait after it to check through the API if the subscription was active.

 

Here is the webhook I received:

{
"api_version": "1.0",
"event": {
"aliases": [
"..."
],
"app_id": "...",
"app_user_id": "...",
"currency": "BRL",
"entitlement_id": null,
"entitlement_ids": [
"..."
],
"environment": "PRODUCTION",
"event_timestamp_ms": 1629289127246,
"expiration_at_ms": 1629375526420,
"grace_period_expiration_at_ms": 1629893059552,
"id": "...",
"is_family_share": false,
"original_app_user_id": "...",
"original_transaction_id": "...",
"period_type": "NORMAL",
"presented_offering_id": null,
"price": 0,
"price_in_purchased_currency": 0,
"product_id": "...",
"purchased_at_ms": 1629288259552,
"store": "PLAY_STORE",
"subscriber_attributes": {...},
"takehome_percentage": 0.85,
"transaction_id": "...",
"type": "BILLING_ISSUE"
}
}

 

icon

Best answer by ryan 5 October 2021, 17:22

View original

1 reply

Userlevel 5
Badge +9

Hey @Bernardo!

I think this is related to a case where Google extends the expiration date while in a grace period, and there isn’t a corresponding RevenueCat event to push the expiration date out. A workaround to handle this could be to use the grace_period_expiration_at_ms, if present, instead of the expiration_date to set entitlement access. Does that look like it would’ve helped here?

Reply