# `Accrue.Stripe`
[🔗](https://github.com/szTheory/accrue/blob/accrue-v0.3.0/lib/accrue/stripe.ex#L1)

Stripe-specific helpers for host applications (D2-15).

This module provides process-dictionary-scoped overrides for Stripe
API settings. The primary use case is traffic-split API version
rollouts:

    Accrue.Stripe.with_api_version("2026-03-25.dahlia", fn ->
      Accrue.Billing.create_customer(user)
    end)

The scoped version is read by `Accrue.Processor.Stripe` via the
three-level precedence chain (D2-14):

    opts[:api_version] > pdict > Accrue.Config.stripe_api_version/0

# `with_api_version`

```elixir
@spec with_api_version(String.t(), (-&gt; result)) :: result when result: var
```

Runs `fun` with the given Stripe API version set in the process
dictionary. Restores the prior value (or clears it) in an `after`
block, even if `fun` raises.

## Examples

    Accrue.Stripe.with_api_version("2025-01-01.test", fn ->
      Accrue.Billing.create_customer(user)
    end)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
