Accrue.Checkout (accrue v1.0.0)

Copy Markdown View Source

Stripe Checkout integration facade.

Thin facade over Accrue.Checkout.Session.create/1, Accrue.Checkout.Session.retrieve/1, and the success-URL reconciliation helper reconcile/1.

Host apps wire reconcile/1 into their success URL controller — Accrue takes a checkout_session_id from the URL, refetches the session from the processor (processor response is canonical), and mirrors the linked customer, subscription, and payment_intent references into local rows via the webhook-path force changesets.

No cookies, no signed session state, no "trust the URL" magic — the refetch is the trust boundary.

Summary

Functions

Refetches a Checkout Session from the processor and mirrors its linked customer/subscription/payment_intent into local rows.

Bang variant of reconcile/1.

Functions

create_session(params)

See Accrue.Checkout.Session.create/1.

create_session!(params)

See Accrue.Checkout.Session.create!/1.

reconcile(session_id)

@spec reconcile(String.t()) :: {:ok, map()} | {:error, term()}

Refetches a Checkout Session from the processor and mirrors its linked customer/subscription/payment_intent into local rows.

Idempotent — calling twice produces the same local state.

reconcile!(id)

@spec reconcile!(String.t()) :: map()

Bang variant of reconcile/1.

retrieve_session(id)

See Accrue.Checkout.Session.retrieve/1.