Files
wordpress-theme-aksrt/src/Payment/GatewayInterface.php
T
kate522 8c5b1555c9 refactor: flatten src/AKSRT → src (drop theme-identifier dir)
Move all domain folders from src/AKSRT/{Domain} to src/{Domain}; remap
Composer PSR-4 "AKSRT\\": "src/"; update audit script + README + ADR
paths; remove dead tools/build-psr4-map.php (scanned deleted inc/classes).
2026-08-02 22:06:06 +08:00

63 lines
1.6 KiB
PHP

<?php
/**
* @package AKSRT
*/
namespace AKSRT\Payment;
defined('ABSPATH') || exit;
/**
* 支付网关统一接口
*/
interface GatewayInterface {
/**
* 创建支付单
*
* @param array $order 订单数据
* @return array{success: bool, payment_url?: string, payment_data?: array, message?: string}
*/
public function create_payment(array $order): array;
/**
* 验证回调
*
* @param \WP_REST_Request $request 回调请求
* @return array{success: bool, order_number?: string, amount?: float, transaction_id?: string, message?: string}
*/
public function verify_callback(\WP_REST_Request $request): array;
/**
* 查询支付状态
*
* @param string $order_number 订单号
* @return array{success: bool, status?: string, transaction_id?: string, message?: string}
*/
public function query_status(string $order_number): array;
/**
* 退款
*
* @param string $order_number 订单号
* @param float $amount 退款金额
* @param string $request_id 幂等退款请求号
* @return array{success: bool, status?: string, refund_id?: string, request_id?: string, message?: string}
*/
public function refund(string $order_number, float $amount, string $request_id = ''): array;
/**
* 获取网关显示名称
*/
public function get_name(): string;
/**
* 获取网关标识
*/
public function get_id(): string;
/**
* 网关是否已配置
*/
public function is_configured(): bool;
}