feat(pay): 统一收银台四种模式(站内二维码/当前页跳转/表单提交/JSAPI)

- PaymentOrchestrator 统一返回 mode + code_url/payment_url/form_html/jsapi_params
- 支付宝:当面付二维码 / 电脑网站支付 / H5;微信:Native / H5 / JSAPI(WechatOpenid 静默授权)
- 易支付:PC mapi 二维码,移动端自动提交表单
- 删除旧键 alipay_payment_type / wechat_payment_type / epay_device 与 redirect/qr_content 字段
- 新增 pay-cashier.js,移除 window.open,订单状态接口改为 /pay/order/{n}
- 拆分 credits.js(affiliate / withdraw-history)至 1000 行以内

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-29 14:01:28 +08:00
1 parent b340b77d5a
commit 1df2822f01
28 files changed
+1255 -836

No files matched your search

@@ -54,13 +54,15 @@ export const gatewaySchema = {
pay_sdk_order: {},
alipay_appid: '',
alipay_privatekey: '',
alipay_payment_type: 'page',
alipay_pc_mode: 'facepay',
alipay_h5: false,
alipay_app_public_cert_path: '',
alipay_public_cert_path: '',
alipay_root_cert_path: '',
wechat_merchantid: '',
wechat_appid: '',
wechat_payment_type: 'native',
wechat_h5: false,
wechat_jsapi: false,
wechat_api_v3_key: '',
wechat_private_key_path: '',
wechat_cert_path: '',
@@ -78,7 +80,7 @@ export const gatewaySchema = {
epay_apiurl: '',
epay_pid: '',
epay_key: '',
epay_device: 'auto',
epay_qrcode: true,
},
groups: [
{
@@ -206,20 +208,22 @@ export const gatewaySchema = {
label: '',
type: 'content',
ui_only: true,
content: '<ul><li>支付宝公钥为必填项目(公钥错误可以成功付款,但会回调失败)</li><li>回调地址固定为 /wp-json/aksrt/v1/payment/alipay/{notify|return}</li><li>同时填写了企业支付以及当面付参数,则优先使用当面付</li></ul>',
content: '<ul><li>支付宝公钥为必填项目(公钥错误可以成功付款,但会回调失败)</li><li>回调地址固定为 /wp-json/aksrt/v1/payment/alipay/{notify|return}</li><li>电脑端按「电脑端收款」选择站内二维码或跳转;手机端开启 H5 时跳转,否则显示二维码</li></ul>',
},
{ key: 'alipay_appid', label: '当面付:APPID', type: 'input', default: '' },
{ key: 'alipay_privatekey', label: '当面付:应用私钥', type: 'textarea', sanitize_type: 'code', default: '', rows: 4, secret: true },
{
key: 'alipay_payment_type',
label: '支付方式',
key: 'alipay_pc_mode',
label: '电脑端收款',
type: 'select',
default: 'page',
default: 'facepay',
options: [
{ label: '电脑网站支付(web)', value: 'page' },
{ label: '手机网站支付(wap)', value: 'wap' },
{ label: '当面付(站内二维码)', value: 'facepay' },
{ label: '电脑网站支付(跳转支付宝)', value: 'web' },
],
help: '当面付在站内弹出二维码;电脑网站支付在当前页跳转到支付宝收银台',
},
{ key: 'alipay_h5', label: '移动端 H5 跳转', type: 'switch', default: false, help: '需签约手机网站支付。开启后手机浏览器跳转支付宝 App/收银台付款;关闭则手机端也显示二维码(附唤起链接)' },
{ 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 绝对路径。' },
@@ -239,20 +243,12 @@ export const gatewaySchema = {
label: '',
type: 'content',
ui_only: true,
content: '<ul><li>微信企业支付:官方接口,商家可申请,有年费,申请较为复杂</li><li>回调地址固定为 /wp-json/aksrt/v1/payment/wechatpay/{notify|return},请配置 Native 支付回调链接</li></ul>',
content: '<ul><li>微信企业支付:官方接口,商家可申请,有年费,申请较为复杂</li><li>回调地址固定为 /wp-json/aksrt/v1/payment/wechatpay/{notify|return},请配置 Native 支付回调链接</li><li>电脑端显示站内二维码;手机端按下方开关选择 H5 跳转或微信内 JSAPI,未开启时同样显示二维码</li></ul>',
},
{ key: 'wechat_merchantid', label: '商户号 PartnerID', 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_h5', label: '移动端 H5 跳转', type: 'switch', default: false, help: '需开通 H5 支付。开启后手机浏览器(非微信内)跳转微信付款;关闭则显示站内二维码' },
{ key: 'wechat_jsapi', label: '微信内 JSAPI 支付', type: 'switch', default: false, help: '需开通 JSAPI 支付并在商户平台配置支付授权目录。微信内打开时直接调起支付;用户 openid 通过「用户→微信公众号」的 AppID/AppSecret 静默授权获取,公众号 AppID 必须与上方 AppID 一致' },
{ key: 'wechat_api_v3_key', label: '支付APIv3密钥', type: 'input', inputType: 'password', secret: true, 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 绝对路径。' },
@@ -329,17 +325,7 @@ export const gatewaySchema = {
{ key: 'epay_apiurl', label: 'API接口网址', type: 'input', default: '', help: '请填写接口地址,例如:https://pay.xxxxxxx.cn/' },
{ key: 'epay_pid', label: '商户号', type: 'input', default: '' },
{ key: 'epay_key', label: '商户秘钥', type: 'input', inputType: 'password', secret: true, default: '', help: 'MD5 通信密钥。' },
{
key: 'epay_device',
label: '下单终端',
type: 'select',
default: 'auto',
options: [
{ label: '自动(按 UA)', value: 'auto' },
{ label: '电脑端 submit', value: 'pc' },
{ label: '移动端 mapi', value: 'mobile' },
],
},
{ key: 'epay_qrcode', label: '电脑端站内二维码', type: 'switch', default: true, help: '开启后电脑端通过 mapi 接口获取二维码在站内展示(接口未返回二维码时跳转支付页);关闭则跳转易支付收银台。移动端始终跳转' },
],
},
],