Documentation

Payment Gateway Pattern

PaymentGatewayInterface, registration flow, and active gateway config keys

Last updated: Feb 09, 2026

Payment Gateway Pattern

Payment gateways implement Cartxis\Core\Contracts\PaymentGatewayInterface:

interface PaymentGatewayInterface
{
    public function getCode(): string;
    public function getName(): string;
    public function supports(string $paymentMethod): bool;
    public function processPayment(Order $order, array $data = []);
    public function handleCallback(array $data): array;
    public function verifyPayment(Order $order): bool;
    public function refund(Order $order, ?float $amount = null, ?string $reason = null): array;
    public function getConfigFields(): array;
    public function isConfigured(): bool;
}

Registration Flow

  1. Gateway package implements PaymentGatewayInterface in its Service class.
  2. Gateway's ServiceProvider::boot() registers itself with PaymentGatewayManager:
$gatewayManager = app('vortex.payment.gateway');
$gatewayManager->register(new StripeGateway());
  1. Gateway seeds a record into the payment_methods table.
  2. Gateway checks extension.json active status before booting.

Active Payment Gateways

GatewayConfig Keys
StripeSTRIPE_KEY, STRIPE_SECRET, STRIPE_WEBHOOK_SECRET
RazorPayRAZORPAY_KEY, RAZORPAY_SECRET
PayPalPAYPAL_CLIENT_ID, PAYPAL_SECRET
PayUMoneyPAYU_MERCHANT_KEY, PAYU_SALT
PhonePePHONEPE_MERCHANT_ID, PHONEPE_SALT_KEY