feat: 新增支付页面接口,为接入支付宝做准备
- GET /payment: 套餐选择页(无需认证,外部浏览器打开) - GET /payment/page: 支付引导页(需 JWT,创建订单) - GET /payment/pay: 支付宝电脑网站支付占位页(需 JWT) - AppState 新增支付宝配置字段(可选) - afterbody.js: PDF下载增加状态提示和重试按钮
This commit is contained in:
@@ -337,6 +337,11 @@ pub struct AppState {
|
||||
pub wechat_appid: String,
|
||||
pub wechat_secret: String,
|
||||
pub free_user_data_limit: i32,
|
||||
// ===== 支付宝配置 =====
|
||||
pub alipay_app_id: Option<String>,
|
||||
pub alipay_private_key: Option<String>,
|
||||
pub alipay_alipay_public_key: Option<String>,
|
||||
pub alipay_gateway: Option<String>,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@@ -351,6 +356,11 @@ impl AppState {
|
||||
free_user_data_limit: std::env::var("FREE_USER_DATA_LIMIT")
|
||||
.map(|v| v.parse().unwrap_or(20))
|
||||
.unwrap_or(20),
|
||||
// 支付宝配置(可选,未配置时使用模拟支付)
|
||||
alipay_app_id: std::env::var("ALIPAY_APP_ID").ok(),
|
||||
alipay_private_key: std::env::var("ALIPAY_PRIVATE_KEY").ok(),
|
||||
alipay_alipay_public_key: std::env::var("ALIPAY_ALIPAY_PUBLIC_KEY").ok(),
|
||||
alipay_gateway: std::env::var("ALIPAY_GATEWAY").ok(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user