Payment methods represent the ways customers can pay for their orders. Shopper provides a flexible system to manage multiple payment providers, each with its own logo, description, and customer-facing instructions.Documentation Index
Fetch the complete documentation index at: https://docs.laravelshopper.dev/llms.txt
Use this file to discover all available pages before exploring further.
Model
The model used isShopper\Core\Models\PaymentMethod. It implements Shopper\Core\Models\Contracts\PaymentMethod and uses the HasSlug and HasZones traits. The model is not configurable via config/shopper/models.php.
Database Schema
PaymentMethod Table
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | no | auto | Primary key |
title | string | no | - | Payment method name |
slug | string | yes | auto | URL-friendly identifier (unique) |
logo | string | yes | null | Path to the logo file |
link_url | string | yes | null | Payment provider website or documentation URL |
description | text | yes | null | Description displayed to customers when choosing a payment method |
instructions | text | yes | null | Instructions displayed to customers after placing an order |
is_enabled | boolean | no | false | Payment method visibility |
driver | string | yes | null | Payment driver code (stripe, manual, etc.), added by shopper/payment |
created_at | timestamp | yes | null | Creation timestamp |
updated_at | timestamp | yes | null | Last update timestamp |
Contract
ThePaymentMethod contract defines the interface that all payment method models must implement:
The
driver column connects a payment method to a registered payment driver (stripe, manual, paypal, etc.). When the PaymentProcessingService processes a payment, it uses this value to resolve the correct driver. See Payments for driver registration and the full payment lifecycle.Relationships
Zones
Payment methods can be scoped to specific geographic zones using theHasZones trait:
Orders
Orders reference payment methods via thepayment_method_id foreign key:
Query Scopes
Logo Handling
Payment method logos use Spatie Media Library. ThelogoUrl() method returns the first media URL from the thumbnail collection, with a fallback to the payment driver’s logo:
Creating Payment Methods
Basic Payment Method
Cash on Delivery
Bank Transfer
Zone-Scoped Payment Method
Retrieving Payment Methods
Working with Orders
When creating an order, associate it with the selected payment method:Storefront Example
Checkout Payment Selection
Payment methods without any zone assignment are considered globally available and will be shown to all customers regardless of their location.
Use Cases
| Payment Method | Description |
|---|---|
| Credit Card | Online card payments via Stripe, PayPal, etc. |
| Bank Transfer | Direct bank wire transfer |
| Cash on Delivery | Payment at delivery time |
| Mobile Money | Mobile wallet payments (M-Pesa, Orange Money, etc.) |
| PayPal | PayPal account or guest checkout |
| Cryptocurrency | Bitcoin, Ethereum, etc. |
| Scenario | Implementation |
|---|---|
| Single payment provider | Create one enabled payment method |
| Region-specific methods | Use zones to restrict availability |
| Offline payments | Use instructions field for post-order guidance |
| Gateway documentation | Use link_url to reference provider docs |
| Display at checkout | Query enabled methods filtered by customer zone |