feat(iap/apple): 添加BundleID支持以增强苹果交易验证
在ServerAPIConfig中添加BundleID字段,用于苹果服务器API验证 当BundleID未配置时,尝试从站点自定义数据中获取 删除过时的测试文件
This commit is contained in:
@@ -19,6 +19,7 @@ type ServerAPIConfig struct {
|
||||
IssuerID string
|
||||
PrivateKey string
|
||||
Sandbox bool
|
||||
BundleID string
|
||||
}
|
||||
|
||||
func buildAPIToken(cfg ServerAPIConfig) (string, error) {
|
||||
@@ -34,6 +35,9 @@ func buildAPIToken(cfg ServerAPIConfig) (string, error) {
|
||||
"exp": now + 1800,
|
||||
"aud": "appstoreconnect-v1",
|
||||
}
|
||||
if cfg.BundleID != "" {
|
||||
payload["bid"] = cfg.BundleID
|
||||
}
|
||||
hb, _ := json.Marshal(header)
|
||||
pb, _ := json.Marshal(payload)
|
||||
enc := func(b []byte) string {
|
||||
|
||||
Reference in New Issue
Block a user