Skip to content

9.19.2

Choose a tag to compare

@github-actions github-actions released this 29 Nov 03:04
· 318 commits to master since this release
a119897

Two changes to restheart-stripe: the plans endpoint works on its first call, and a plan's trial can start without a card.

GET /stripe/plans on an empty cache (#836)

The catalog of plans is cached for an hour. On a cache miss, which is every first call, StripeCatalogCache called isPresent() on the null that Cache.get returns for a key not cached. The request failed with 500 before the catalog was built and stored, so every later call failed the same way:

Cannot invoke "java.util.Optional.isPresent()" because "cached" is null

The plans endpoint now builds the catalog on a miss, stores it, and serves it from the cache afterwards.

trial-without-card (#837)

A plan with a trial asked for a card in Checkout, Stripe's default. With trial-without-card the trial starts without one:

"plans": {
  "pro": {
    "price-id-monthly": "price_xxx",
    "trial-period-days": 30,
    "trial-without-card": true
  }
}

The Checkout Session then sets payment_method_collection: if_required, and a trial that ends with no card cancels the subscription: the entity goes back to the default plan through the customer.subscription.deleted webhook. The default is false, the previous behaviour.

For a custom deployment that builds PlanConfig itself: the record has a sixth component, trialWithoutCard, and keeps its constructor of five, which sets it to false.

The documentation is in Plans and seats.