增加华为支付模块

This commit is contained in:
ayflying
2025-08-05 18:19:42 +08:00
parent d54de73e11
commit 039acea0af
5 changed files with 351 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
package huawei
import (
"net/http"
"time"
)
const (
AuthTokenUrl = "https://oauth-api.cloud.huawei.com/rest.php?nsp_fmt=JSON&nsp_svc=huawei.oauth2.user.getTokenInfo"
OrderUrl = "https://orders-drcn.iap.hicloud.com/applications/purchases/tokens/verify"
LocationShanghai = "Asia/Shanghai"
RSA = "RSA"
RSA2 = "RSA2"
OrderResponseOk = "0"
PurchaseStateOk = 0
)
func getOrderUrl(accountFlag int) string {
if accountFlag == 1 {
// site for telecom carrier
return "https://orders-at-dre.iap.dbankcloud.com"
} else {
// TODO: replace the (ip:port) to the real one
return "http://exampleserver/_mockserver_"
}
}
// default http client with 5 seconds timeout
var RequestHttpClient = http.Client{Timeout: time.Second * 5}