Creates Charge objects from PaymentIntents.
Handles the PI -> Charge -> BalanceTransaction chain that Stripe performs when a PaymentIntent succeeds. This is used by checkout session completion and the billing engine to produce the same object graph that real Stripe does.
Summary
Functions
Creates a Charge (and its BalanceTransaction) for a succeeded PaymentIntent.
Functions
Creates a Charge (and its BalanceTransaction) for a succeeded PaymentIntent.
- Builds a charge map from the PI fields
- Inserts into the Charges store
- Creates a BalanceTransaction via BalanceTransactionHelper
- Updates the charge with the balance_transaction ID
- Updates the PI with
latest_charge - Fires telemetry
- Returns
{:ok, charge}