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:
1 parent
12c31ad82b
commit
c93b303453
16 files changed
+298
-228
No files matched your search
@@ -20,6 +20,10 @@ class AKSRT_PayPal_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('paypal')) {
|
||||
return false;
|
||||
}
|
||||
$config = $this->get_config();
|
||||
return !empty($config['client_id']) && !empty($config['client_secret']);
|
||||
}
|
||||
@@ -128,21 +132,16 @@ class AKSRT_PayPal_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['paypal_client_id'])) {
|
||||
return [
|
||||
'client_id' => $all['paypal_client_id'] ?? '',
|
||||
'client_secret' => $all['paypal_client_secret'] ?? '',
|
||||
'currency' => $all['paypal_currency'] ?? 'USD',
|
||||
'mode' => !empty($all['paypal_sandbox']) ? 'sandbox' : 'live',
|
||||
];
|
||||
}
|
||||
if (!class_exists('AKSRT_Settings')) {
|
||||
return [];
|
||||
}
|
||||
// 回退到独立 option
|
||||
$settings = get_option('aksrt_payment_paypal', []);
|
||||
return is_array($settings) ? $settings : [];
|
||||
$all = AKSRT_Settings::get_all();
|
||||
return [
|
||||
'client_id' => (string) ($all['paypal_client_id'] ?? ''),
|
||||
'client_secret' => (string) ($all['paypal_client_secret'] ?? ''),
|
||||
'currency' => (string) ($all['paypal_currency'] ?? 'USD'),
|
||||
'mode' => !empty($all['paypal_sandbox']) ? 'sandbox' : 'live',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user