Ecto schema for the accrue_payment_methods table.
Stores processor-side payment method references (e.g. Stripe pm_xxx).
Card details are stored as Stripe references (brand, last4, expiry),
never as raw PAN or PII (CLAUDE.md security constraint).
Phase 3 adds:
exp_month/exp_year— top-level expiry used by the expiring-card notice scheduler (alias for thecard_exp_*columns already in place)last_stripe_event_ts/last_stripe_event_id— webhook watermark- virtual
existing?— set by theattach_payment_method/2dedup path (Plan 06) when fingerprint matches an existing row on the customer
Summary
Functions
Builds a changeset for creating or updating a PaymentMethod.
Types
@type t() :: %Accrue.Billing.PaymentMethod{ __meta__: term(), card_brand: term(), card_exp_month: term(), card_exp_year: term(), card_last4: term(), customer: term(), customer_id: term(), data: term(), existing?: term(), exp_month: term(), exp_year: term(), fingerprint: term(), id: term(), inserted_at: term(), is_default: term(), last_stripe_event_id: term(), last_stripe_event_ts: term(), lock_version: term(), metadata: term(), processor: term(), processor_id: term(), type: term(), updated_at: term() }
Functions
@spec changeset( %Accrue.Billing.PaymentMethod{ __meta__: term(), card_brand: term(), card_exp_month: term(), card_exp_year: term(), card_last4: term(), customer: term(), customer_id: term(), data: term(), existing?: term(), exp_month: term(), exp_year: term(), fingerprint: term(), id: term(), inserted_at: term(), is_default: term(), last_stripe_event_id: term(), last_stripe_event_ts: term(), lock_version: term(), metadata: term(), processor: term(), processor_id: term(), type: term(), updated_at: term() } | Ecto.Changeset.t(), map() ) :: Ecto.Changeset.t()
Builds a changeset for creating or updating a PaymentMethod.