feat(payment): finish Zibll key contract and wire checkout gateways

Drop dual-read payment runtime fallbacks, align PHP schema to Vue keys,
read gateway credentials only from aksrt_settings with enable toggles,
expose configured adapters at checkout, fix credits pay signatures, and
apply order expiry settings. Wire orphan order/card-pass/withdrawal
schema pages; delete unused Payment* wrappers.
This commit is contained in:
kate522 committed 2026-07-11 17:42:35 +08:00
1 parent 12c31ad82b
commit c93b303453
16 files changed
+298 -228

No files matched your search

@@ -20,6 +20,10 @@ class AKSRT_Stripe_Gateway implements AKSRT_Payment_Gateway_Interface {
}
public function is_configured(): bool {
if (class_exists('AKSRT_Settings_Payment_Runtime')
&& !AKSRT_Settings_Payment_Runtime::is_gateway_enabled('stripe')) {
return false;
}
$config = $this->get_config();
return !empty($config['secret_key']) && !empty($config['publishable_key']);
}
@@ -233,22 +237,17 @@ class AKSRT_Stripe_Gateway implements AKSRT_Payment_Gateway_Interface {
}
private function get_config(): array {
// 优先从统一设置读取(schema 保存的 key)
if (class_exists('AKSRT_Settings')) {
$all = AKSRT_Settings::get_all();
if (!empty($all['stripe_secret_key'])) {
return [
'secret_key' => $all['stripe_secret_key'] ?? '',
'publishable_key' => $all['stripe_publishable_key'] ?? '',
'webhook_secret' => $all['stripe_webhook_secret'] ?? '',
'currency' => $all['stripe_currency'] ?? 'usd',
'mode' => !empty($all['stripe_test_mode']) ? 'test' : 'live',
];
}
if (!class_exists('AKSRT_Settings')) {
return [];
}
// 回退到独立 option
$settings = get_option('aksrt_payment_stripe', []);
return is_array($settings) ? $settings : [];
$all = AKSRT_Settings::get_all();
return [
'secret_key' => (string) ($all['stripe_secret_key'] ?? ''),
'publishable_key' => (string) ($all['stripe_publishable_key'] ?? ''),
'webhook_secret' => (string) ($all['stripe_webhook_secret'] ?? ''),
'currency' => (string) ($all['stripe_currency'] ?? 'usd'),
'mode' => !empty($all['stripe_test_mode']) ? 'test' : 'live',
];
}
private function create_client(array $config): void {