Skip to content

Configuration Reference

The full config/payments.php file with all available options.

Default Gateway

php
'default' => env('PAYMENT_GATEWAY', 'stripe'),

The gateway used when Payment::create() is called without specifying a gateway.

Profile

php
'profile' => env('PAYMENT_PROFILE', 'test'),

Default credential profile. Use test for sandbox/development and live for production.

Gateway Definitions

php
'gateways' => [
    'stripe' => [
        'test' => [
            'key' => env('STRIPE_TEST_KEY'),
            'secret' => env('STRIPE_TEST_SECRET'),
            'webhook_secret' => env('STRIPE_TEST_WEBHOOK_SECRET'),
        ],
        'live' => [
            'key' => env('STRIPE_LIVE_KEY'),
            'secret' => env('STRIPE_LIVE_SECRET'),
            'webhook_secret' => env('STRIPE_LIVE_WEBHOOK_SECRET'),
        ],
    ],
],

Each gateway has credential sets keyed by profile (test, live, or custom profiles).

Credential Storage

php
'credential_storage' => env('PAYMENT_CREDENTIAL_STORAGE', 'env'),
ValueDescription
envRead from config/payments.php only
databaseRead from payment_gateway_credentials table
compositeDatabase first, fallback to ENV

Routes

php
'routes' => [
    'enabled' => true,
    'prefix' => 'payments',
    'middleware' => ['web'],
    'webhook_middleware' => [],
],
KeyDefaultDescription
enabledtrueRegister built-in routes
prefixpaymentsURL prefix for all payment routes
middleware['web']Middleware for return/cancel routes
webhook_middleware[]Middleware for webhook route (no CSRF)

Logging

php
'logging' => [
    'level' => env('PAYMENT_LOG_LEVEL', 'basic'),
    'channel' => env('PAYMENT_LOG_CHANNEL', null),
    'db_logging' => true,
    'redacted_keys' => [
        'secret', 'password', 'token', 'key',
        'card_number', 'cvv', 'cvc', 'pin',
        'authorization', 'signature',
    ],
],
KeyDefaultDescription
levelbasicLog verbosity: off, errors_only, basic, verbose, debug
channelnullLaravel log channel (null = default)
db_loggingtrueStore logs in payment_logs table
redacted_keys[...]Keys to mask as [REDACTED]

Persistence

php
'persistence' => [
    'enabled' => true,
    'payments' => true,
    'attempts' => true,
    'webhooks' => true,
    'refunds' => true,
    'logs' => true,
],

Toggle database persistence for each record type independently.

Idempotency

php
'idempotency' => [
    'auto_generate' => true,
    'ttl_hours' => 24,
],
KeyDefaultDescription
auto_generatetrueAuto-generate idempotency keys from payload
ttl_hours24How long idempotency keys remain active

Table Names

php
'tables' => [
    'gateways' => 'payment_gateways',
    'credentials' => 'payment_gateway_credentials',
    'payments' => 'payments',
    'attempts' => 'payment_attempts',
    'webhooks' => 'payment_webhook_events',
    'refunds' => 'payment_refunds',
    'logs' => 'payment_logs',
],

Customize table names if they conflict with your application.

Released under the MIT License.