PaymentService
in package
Payment processing service with test mode support.
Abstracts payment processing across multiple methods. Online payments use test mode simulation until real Stripe integration in Phase 7.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Initialize the payment service.
- processPayment() : array<string|int, mixed>
- Process a payment for an order.
- processCardOnSitePayment() : array<string|int, mixed>
- Process card on site payment (recorded as pending).
- processCashPayment() : array<string|int, mixed>
- Process cash on pickup payment (recorded as pending).
- processOnlinePayment() : array<string|int, mixed>
- Process online payment (test mode simulation).
- processPeerToPeerPayment() : array<string|int, mixed>
- Process a peer-to-peer payment (Venmo, CashApp, PayPal).
Properties
$paymentModel
private
Payment
$paymentModel
Payment model
Methods
__construct()
Initialize the payment service.
public
__construct() : mixed
processPayment()
Process a payment for an order.
public
processPayment(array<string|int, mixed> $order, string $method[, array<string|int, mixed> $paymentData = [] ]) : array<string|int, mixed>
Parameters
- $order : array<string|int, mixed>
-
Order record
- $method : string
-
Payment method (online, cash_on_pickup, card_on_site, venmo, cashapp, paypal)
- $paymentData : array<string|int, mixed> = []
-
Additional payment data (card token, etc.)
Return values
array<string|int, mixed> —Result with keys: success, payment_id, transaction_id, error
processCardOnSitePayment()
Process card on site payment (recorded as pending).
private
processCardOnSitePayment(array<string|int, mixed> $baseData) : array<string|int, mixed>
Parameters
- $baseData : array<string|int, mixed>
-
Base payment data
Return values
array<string|int, mixed>processCashPayment()
Process cash on pickup payment (recorded as pending).
private
processCashPayment(array<string|int, mixed> $baseData) : array<string|int, mixed>
Parameters
- $baseData : array<string|int, mixed>
-
Base payment data
Return values
array<string|int, mixed>processOnlinePayment()
Process online payment (test mode simulation).
private
processOnlinePayment(array<string|int, mixed> $baseData, array<string|int, mixed> $paymentData) : array<string|int, mixed>
Parameters
- $baseData : array<string|int, mixed>
-
Base payment data
- $paymentData : array<string|int, mixed>
-
Additional data (card token, etc.)
Return values
array<string|int, mixed>processPeerToPeerPayment()
Process a peer-to-peer payment (Venmo, CashApp, PayPal).
private
processPeerToPeerPayment(array<string|int, mixed> $baseData, string $processorName) : array<string|int, mixed>
Recorded as pending; staff confirms receipt in the order dashboard.
Parameters
- $baseData : array<string|int, mixed>
-
Base payment data
- $processorName : string
-
Processor name (venmo, cashapp, paypal)