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
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.