Pre-defined Stripe test tokens that are always available in PaperTiger.
Stripe provides special test tokens like pm_card_visa and tok_visa that work
without creating payment methods from card details. PaperTiger must provide these
same tokens so that library users don't have to change their code when switching
between real Stripe and PaperTiger.
Supported Payment Method Tokens (pmcard*)
By Card Brand
pm_card_visa- Visa (4242424242424242)pm_card_visa_debit- Visa Debitpm_card_mastercard- Mastercard (5555555555554444)pm_card_mastercard_debit- Mastercard Debitpm_card_mastercard_prepaid- Mastercard Prepaidpm_card_amex- American Express (378282246310005)pm_card_discover- Discover (6011111111111117)pm_card_diners- Diners Club (3056930009020004)pm_card_jcb- JCB (3566002020360505)pm_card_unionpay- UnionPay (6200000000000005)
Special Behavior Cards
pm_card_chargeDeclined- Always declinespm_card_chargeDeclinedInsufficientFunds- Declines with insufficient fundspm_card_chargeDeclinedFraudulent- Declines as fraudulent
Supported Token Tokens (tok_*)
tok_visa,tok_mastercard,tok_amex, etc. (same brands as pmcard*)
Usage
These tokens are automatically loaded when PaperTiger starts.
Summary
Functions
Loads all pre-defined test tokens into PaperTiger stores.
Materializes a fresh PaymentMethod from a predefined pm_card_* test token.
Returns a list of all supported pmcard* token IDs.
Returns true when the given ID is one of Stripe's predefined pm_card_*
test payment method tokens.
Returns a list of all supported tok_* token IDs.
Functions
@spec load() :: {:ok, map()}
Loads all pre-defined test tokens into PaperTiger stores.
Called automatically on PaperTiger startup.
Returns {:ok, stats} with counts of loaded tokens.
Materializes a fresh PaymentMethod from a predefined pm_card_* test token.
Stripe treats these fixtures as reusable tokens in attach/setup flows: each use yields an ordinary PaymentMethod instance that can be attached to one customer without consuming the named fixture globally.
@spec payment_method_ids() :: [String.t()]
Returns a list of all supported pmcard* token IDs.
Returns true when the given ID is one of Stripe's predefined pm_card_*
test payment method tokens.
@spec token_ids() :: [String.t()]
Returns a list of all supported tok_* token IDs.