Zero-Core-Edit Payment Plugin Architecture
Site Store Pro supports stand-alone, auto-discovered payment plugins inside the payment-processors/ folder. You can integrate third-party gateways (such as Square, Authorize.Net, or Braintree) without modifying core controllers, routes, or config files.
Folder Structure
payment-processors/
my-gateway/
processor.json
MyGatewayProcessor.php
checkout.blade.php
1. Create processor.json
IDs 0–3 are strictly reserved for built-in gateways (Test, Stripe, Paddle, PayPal). Use IDs 100 and above for custom plugins:
{
"processor_id": 100,
"name": "My Gateway",
"class": "PaymentProcessors\\MyGateway\\MyGatewayProcessor",
"file": "MyGatewayProcessor.php",
"default_production": 0
}
2. Implement PaymentPluginInterface
Your driver class implements App\Services\Payments\Contracts\PaymentPluginInterface (which extends PaymentProcessorInterface) with methods for charge(), refund(), getTypeSlug(), prepareCheckout(), buildChargePayload(), getCheckoutViewPath(), getCheckoutViewData(), matchesPayment(), and handleWebhook().
3. Register Checkout JS Hooks
Your checkout.blade.php partial renders automatically inside the Order Review Payment Method card and registers lifecycle hooks on window.PaymentProcessorPlugins[slug] (init, reboot, handlePlaceOrder, and handlePrepared).
Automatic Registration, Refunds & Webhooks
- Auto-Discovery on Boot:
PluginServiceProvidercallsPaymentProcessorManager::syncDiscoveredProcessors(), automatically inserting your gateway intoorder_processorsso it appears immediately in/admin/ecommerce/checkout/processors. - Automatic Admin Refunds:
PaymentRefundServiceroutes refunds to whichever plugin matches viamatchesPayment($payment). - Automatic CSRF-Exempt Webhooks: Point your gateway to
POST https://yourdomain.com/webhooks/payment/{slug}to dispatch directly into your plugin'shandleWebhook()method.