MPP.Client.Providers.Stripe (mpp v0.15.0)

Copy Markdown View Source

Built-in Stripe charge provider using Shared Payment Tokens (SPTs).

The provider parses the challenge, creates an SPT through Stripe's API, and returns the credential consumed by MPP.Client.Req or another transport.

Configuration is explicit:

  • :secret_key — required Stripe secret or restricted key
  • :payment_method — required Stripe payment-method ID
  • :external_id — optional fallback credential external ID
  • :spt_url — optional SPT endpoint override
  • :req_options — optional options passed to Req.request/2

Summary

Functions

Creates a Stripe SPT for a charge challenge and returns its credential.

Returns true for Stripe charge challenges.

Functions

pay(challenge, config)

@spec pay(MPP.Challenge.t(), map()) :: {:ok, MPP.Credential.t()} | {:error, term()}

Creates a Stripe SPT for a charge challenge and returns its credential.

supports?(arg1, arg2, config)

@spec supports?(String.t(), String.t(), map()) :: boolean()

Returns true for Stripe charge challenges.