Wraps Stripe intent-capable responses into the intent_result tagged
union (D3-06..D3-08).
Every Phase 3 write path that may surface a PaymentIntent (SCA/3DS)
runs its processor result through wrap/1. The result is one of:
{:ok, struct_or_map}— happy path{:ok, :requires_action, pi_map}— customer action required{:error, exception}— anything else
The wrapper inspects either:
- A Stripe subscription with an expanded
latest_invoice.payment_intentwhose status is"requires_action" - A direct PaymentIntent / SetupIntent response whose status is
"requires_action"/"requires_confirmation"/"requires_payment_method"
Fake adapter returns atom-keyed maps; the Stripe adapter returns
string-keyed maps after Map.from_struct/1. The wrapper handles both
key shapes.
Summary
Types
@type t() :: {:ok, ok_value()} | {:ok, :requires_action, map()} | {:error, Exception.t()}