fix(iap/apple): 添加缺失的IssuerID默认值并更新测试配置
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m40s
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m40s
当IssuerID缺失或为默认值时,使用硬编码值作为回退方案 更新测试文件中的IssuerID和BundleID为实际值
This commit is contained in:
parent
680951611f
commit
5bc453b09f
@ -1,18 +1,18 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"time"
|
|
||||||
"net/http"
|
|
||||||
"io"
|
|
||||||
"encoding/json"
|
|
||||||
"encoding/base64"
|
|
||||||
"crypto/x509"
|
|
||||||
"encoding/pem"
|
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"crypto/x509"
|
||||||
|
"encoding/base64"
|
||||||
|
"encoding/json"
|
||||||
|
"encoding/pem"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 配置区域 - 请在此处填入您的真实信息进行测试
|
// 配置区域 - 请在此处填入您的真实信息进行测试
|
||||||
@ -21,10 +21,10 @@ const (
|
|||||||
KeyID = "2C4X3HVPM8"
|
KeyID = "2C4X3HVPM8"
|
||||||
|
|
||||||
// 必填:您的 Issuer ID (从 App Store Connect 获取,通常是一个 UUID)
|
// 必填:您的 Issuer ID (从 App Store Connect 获取,通常是一个 UUID)
|
||||||
IssuerID = "69a6de70-03db-47e3-e053-5b8c7c11a4d1" // 请替换为您真实的 Issuer ID
|
IssuerID = "34f54810-5118-4b7f-8069-c8c1e012b7a9" // 请替换为您真实的 Issuer ID
|
||||||
|
|
||||||
// 必填:您的 Bundle ID (App 的包名)
|
// 必填:您的 Bundle ID (App 的包名)
|
||||||
BundleID = "com.hifastvpn.ios" // 请替换为您真实的 Bundle ID
|
BundleID = "com.taw.hifastvpn" // 请替换为您真实的 Bundle ID
|
||||||
|
|
||||||
// 必填:用于测试的 Transaction ID (任意一个真实的交易 ID)
|
// 必填:用于测试的 Transaction ID (任意一个真实的交易 ID)
|
||||||
TestTransactionID = "2000001083318819"
|
TestTransactionID = "2000001083318819"
|
||||||
|
|||||||
@ -99,6 +99,11 @@ SIRDAVLcWemp0fMlnfDE4EHmqcD58arEJWsr3aWEhc4BHocOUIGjko0cVWGchrFa
|
|||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.ERROR), "apple server api credential missing")
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.ERROR), "apple server api credential missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hardcode IssuerID as fallback (since it was missing in config)
|
||||||
|
if apiCfg.IssuerID == "" || apiCfg.IssuerID == "some_issuer_id" {
|
||||||
|
apiCfg.IssuerID = "34f54810-5118-4b7f-8069-c8c1e012b7a9"
|
||||||
|
}
|
||||||
|
|
||||||
// Try to get BundleID from Site CustomData if not set
|
// Try to get BundleID from Site CustomData if not set
|
||||||
if apiCfg.BundleID == "" {
|
if apiCfg.BundleID == "" {
|
||||||
var customData struct {
|
var customData struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user