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_Alipay_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('alipay')) {
|
||||
return false;
|
||||
}
|
||||
$config = $this->get_config();
|
||||
return !empty($config['app_id']) && !empty($config['private_key']) && !empty($config['alipay_public_key']);
|
||||
}
|
||||
@@ -165,24 +169,19 @@ class AKSRT_Alipay_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['alipay_appid'])) {
|
||||
return [
|
||||
'app_id' => $all['alipay_appid'] ?? '',
|
||||
'private_key' => $all['alipay_privatekey'] ?? '',
|
||||
'alipay_public_key' => $all['alipay_publickey'] ?? '',
|
||||
'return_url' => $all['alipay_return_url'] ?? '',
|
||||
'notify_url' => $all['alipay_notify_url'] ?? '',
|
||||
'payment_type' => $all['alipay_payment_type'] ?? 'page',
|
||||
'sign_type' => $all['alipay_sign_type'] ?? 'RSA2',
|
||||
];
|
||||
}
|
||||
if (!class_exists('AKSRT_Settings')) {
|
||||
return [];
|
||||
}
|
||||
// 回退到独立 option
|
||||
$settings = get_option('aksrt_payment_alipay', []);
|
||||
return is_array($settings) ? $settings : [];
|
||||
$all = AKSRT_Settings::get_all();
|
||||
return [
|
||||
'app_id' => (string) ($all['alipay_appid'] ?? ''),
|
||||
'private_key' => (string) ($all['alipay_privatekey'] ?? ''),
|
||||
'alipay_public_key' => (string) ($all['alipay_publickey'] ?? ''),
|
||||
'return_url' => (string) ($all['alipay_return_url'] ?? ''),
|
||||
'notify_url' => (string) ($all['alipay_notify_url'] ?? ''),
|
||||
'payment_type' => (string) ($all['alipay_payment_type'] ?? 'page'),
|
||||
'sign_type' => (string) ($all['alipay_sign_type'] ?? 'RSA2'),
|
||||
];
|
||||
}
|
||||
|
||||
private function create_sdk(array $config): \Yurun\PaySDK\AlipayApp\SDK {
|
||||
|
||||
Reference in new issue
Block a user