重构资源创建逻辑,整合支付宝,优化套餐生成与交易处理

This commit is contained in:
2025-04-16 18:50:55 +08:00
parent 083fabb308
commit 2146887f95
6 changed files with 416 additions and 180 deletions

9
pkg/env/env.go vendored
View File

@@ -193,25 +193,26 @@ var (
)
func loadAlipay() {
AlipayAppId := os.Getenv("ALIPAY_APP_ID")
AlipayAppId = os.Getenv("ALIPAY_APP_ID")
if AlipayAppId == "" {
panic("环境变量 ALIPAY_APP_ID 的值不能为空")
}
AlipayAppPrivateKey := os.Getenv("ALIPAY_APP_PRIVATE_KEY")
AlipayAppPrivateKey = os.Getenv("ALIPAY_APP_PRIVATE_KEY")
if AlipayAppPrivateKey == "" {
panic("环境变量 ALIPAY_APP_PRIVATE_KEY 的值不能为空")
}
AlipayPublicKey := os.Getenv("ALIPAY_PUBLIC_KEY")
AlipayPublicKey = os.Getenv("ALIPAY_PUBLIC_KEY")
if AlipayPublicKey == "" {
panic("环境变量 ALIPAY_PUBLIC_KEY 的值不能为空")
}
AlipayEncryptKey := os.Getenv("ALIPAY_ENCRYPT_KEY")
AlipayEncryptKey = os.Getenv("ALIPAY_ENCRYPT_KEY")
if AlipayEncryptKey == "" {
panic("环境变量 ALIPAY_ENCRYPT_KEY 的值不能为空")
}
_AlipayProduction := os.Getenv("ALIPAY_PRODUCTION")
if _AlipayProduction != "" {
value, err := strconv.ParseBool(_AlipayProduction)