feat: add system configration switch option for order pay service, support sandbox env for alipay

This commit is contained in:
RockYang
2023-11-09 18:28:56 +08:00
parent 7ca4dfe09b
commit 9dc9a6923e
11 changed files with 89 additions and 25 deletions

View File

@@ -28,7 +28,7 @@ func NewAlipayService(appConfig *types.AppConfig) (*AlipayService, error) {
return nil, fmt.Errorf("error with read App Private key: %v", err)
}
xClient, err := alipay.New(config.AppId, priKey, false)
xClient, err := alipay.New(config.AppId, priKey, !config.SandBox)
if err != nil {
return nil, fmt.Errorf("error with initialize alipay service: %v", err)
}