Skip to content

AshBilling 0.5.1

Choose a tag to compare

@sfelixalejandro sfelixalejandro released this 07 Nov 01:11
· 27 commits to main since this release
f8137be

Security

  • Resolved Hex advisory on retired ash_sql 0.8.4 (Ecto query cache issue) by upgrading ash_sql to 0.8.7 (and nimble_options to 1.2.0). Verified with mix hex.audit (0 advisories).

Added

  • AshBilling.Checks.HasPrice: added support for specifying multiple allowed price IDs as a list (e.g. price: ["price_monthly", "price_annual"]). Authorizes when the active subscription's price_id matches any element in the list. Enforces fail-closed semantics on empty lists, blank strings, or invalid non-binary elements.

Fixed

  • Public error contracts in AshBilling:
    • AshBilling.create_portal_session/2: Returns {:error, :missing_return_url} when :return_url is missing, blank, or non-binary, avoiding KeyError.
    • AshBilling.get_subscription/2, cancel_subscription/2, resume_subscription/2: Return {:error, :invalid_subscription_id} when given nil, "", or unsupported structures, preventing FunctionClauseError and unneeded Stripe API requests.