refactor(autoload): migrate theme classes to Composer PSR-4
Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
This commit is contained in:
1 parent
8f349b40fb
commit
aaf458af1c
404 files changed
+13602
-7705
No files matched your search
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
namespace AKSRT\Payment;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* AKSRT Payment Gateway — 支付网关适配器层
|
||||
*
|
||||
* 定义支付网关统一接口和基础实现。
|
||||
* 具体网关(支付宝、微信支付等)通过子类实现。
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
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 退款金额
|
||||
* @return array{success: bool, refund_id?: string, message?: string}
|
||||
*/
|
||||
public function refund(string $order_number, float $amount): array;
|
||||
|
||||
/**
|
||||
* 获取网关显示名称
|
||||
*/
|
||||
public function get_name(): string;
|
||||
|
||||
/**
|
||||
* 获取网关标识
|
||||
*/
|
||||
public function get_id(): string;
|
||||
|
||||
/**
|
||||
* 网关是否已配置
|
||||
*/
|
||||
public function is_configured(): bool;
|
||||
}
|
||||
Reference in new issue
Block a user