refactor(payment): migrate SDK to yansongda pay

This commit is contained in:
2026-07-26 00:09:38 +08:00
parent 8fbde0785e
commit a8d99b200b
10 changed files with 1555 additions and 405 deletions
@@ -22,15 +22,17 @@ export const gatewaySchema = {
payment_codepay_enabled: false,
payment_stripe_enabled: false,
wechat_merchantid: '',
wechat_jsapi: '',
wechat_appsecret: '',
wechat_appid: '',
wechat_payment_type: 'native',
wechat_api_v3_key: '',
wechat_private_key_path: '',
wechat_cert_path: '',
wechat_key_path: '',
alipay_appid: '',
alipay_privatekey: '',
alipay_publickey: '',
alipay_return_url: '',
alipay_notify_url: '',
alipay_payment_type: 'page',
alipay_app_public_cert_path: '',
alipay_public_cert_path: '',
alipay_root_cert_path: '',
paypal_client_id: '',
paypal_client_secret: '',
paypal_currency: 'USD',
@@ -94,10 +96,14 @@ export const gatewaySchema = {
dependsOn: { key: 'payment_wechat_enabled', value: true },
fields: [
{ key: 'wechat_merchantid', label: '商户号', type: 'input', default: '' },
{ key: 'wechat_jsapi', label: 'JSAPI密钥', type: 'input', default: '' },
{ key: 'wechat_appsecret', label: 'AppSecret', type: 'input', default: '' },
{ key: 'wechat_cert_path', label: '证书路径', type: 'input', default: '', help: '退款等接口需要,绝对路径。' },
{ key: 'wechat_key_path', label: '密钥路径', type: 'input', default: '' },
{ key: 'wechat_appid', label: 'AppID', type: 'input', default: '' },
{ key: 'wechat_payment_type', label: '支付方式', type: 'select', default: 'native', options: [
{ label: '扫码支付(Native)', value: 'native' },
{ label: 'H5支付', value: 'h5' },
] },
{ key: 'wechat_api_v3_key', label: 'APIv3密钥', type: 'input', default: '', help: '微信商户平台设置的 APIv3 密钥(32位)。' },
{ key: 'wechat_private_key_path', label: '商户私钥路径', type: 'input', default: '', help: 'apiclient_key.pem 绝对路径,用于签名。' },
{ key: 'wechat_cert_path', label: '商户API证书路径', type: 'input', default: '', help: 'apiclient_cert.pem 绝对路径。' },
],
},
{
@@ -111,9 +117,14 @@ export const gatewaySchema = {
fields: [
{ key: 'alipay_appid', label: 'AppID', type: 'input', default: '' },
{ key: 'alipay_privatekey', label: '应用私钥', type: 'textarea', rows: 3, default: '' },
{ key: 'alipay_publickey', label: '支付宝公钥', type: 'textarea', rows: 3, default: '' },
{ key: 'alipay_return_url', label: '同步回调地址', type: 'input', default: '' },
{ key: 'alipay_notify_url', label: '异步回调地址', type: 'input', default: '' },
{ key: 'alipay_payment_type', label: '支付方式', type: 'select', default: 'page', options: [
{ label: '电脑网站支付(web)', value: 'page' },
{ label: '手机网站支付(wap)', value: 'wap' },
] },
{ key: 'alipay_app_public_cert_path', label: '应用公钥证书路径', type: 'input', default: '', help: 'appCertPublicKey.crt 绝对路径。' },
{ key: 'alipay_public_cert_path', label: '支付宝公钥证书路径', type: 'input', default: '', help: 'alipayCertPublicKey_RSA2.crt 绝对路径。' },
{ key: 'alipay_root_cert_path', label: '支付宝根证书路径', type: 'input', default: '', help: 'alipayRootCert.crt 绝对路径。' },
{ key: 'alipay_notify_help', label: '回调地址说明', type: 'notice', alertType: 'info', alertContent: '异步通知 / 同步返回已固定为 /wp-json/aksrt/v1/payment/alipay/{notify|return},无需在此填写。' },
],
},
{