Panel/Panel/modules/billing/classes/PaymentGatewayInterface.php
copilot-swe-agent[bot] 176f532737
feat: relocate billing runtime to module and harden updater panel pathing
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/50299e05-4ee0-4b5b-80e4-bc5f872c106e

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2026-05-18 13:46:11 +00:00

40 lines
1.4 KiB
PHP

<?php
/**
* Payment Gateway Interface
* All payment providers must implement this contract.
*/
interface PaymentGatewayInterface
{
/**
* Create a payment/order on the provider side.
* @param array $params { amount, currency, invoice_id, description, return_url, cancel_url, items? }
* @return array { success: bool, provider_order_id: string, redirect_url?: string, error?: string }
*/
public function createPayment(array $params): array;
/**
* Handle a provider callback/capture (webhook or return).
* @param array $params Provider-specific parameters (e.g. { order_id } for PayPal)
* @return array { success: bool, transaction_id: string, amount: float, status: string, raw_response: array, error?: string }
*/
public function handleCallback(array $params): array;
/**
* Verify that a payment/webhook is authentic.
* @param array $payload Raw request body / headers
* @return bool
*/
public function verifyPayment(array $payload): bool;
/**
* Get the provider's external transaction ID from a capture result.
* @param array $captureResult Result from handleCallback()
* @return string|null
*/
public function getTransactionId(array $captureResult): ?string;
/**
* Return a short machine name for this gateway (e.g. 'paypal', 'stripe', 'manual').
*/
public function getName(): string;
}