This commit is contained in:
@@ -83,27 +83,11 @@ func (l *AttachTransactionByIdLogic) AttachById(req *types.AttachAppleTransactio
|
||||
apiCfg.PrivateKey = strings.ReplaceAll(apiCfg.PrivateKey, "-----END\nPRIVATE\nKEY-----", "-----END PRIVATE KEY-----")
|
||||
}
|
||||
|
||||
// Fallback to hardcoded key (For debugging/dev)
|
||||
if apiCfg.PrivateKey == "" {
|
||||
apiCfg.PrivateKey = `-----BEGIN PRIVATE KEY-----
|
||||
MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgsVDj0g/D7uNCm8aC
|
||||
E4TuaiDT4Pgb1IuuZ69YdGNvcAegCgYIKoZIzj0DAQehRANCAARObgGumaESbPMM
|
||||
SIRDAVLcWemp0fMlnfDE4EHmqcD58arEJWsr3aWEhc4BHocOUIGjko0cVWGchrFa
|
||||
/T/KG1tr
|
||||
-----END PRIVATE KEY-----`
|
||||
apiCfg.KeyID = "2C4X3HVPM8"
|
||||
}
|
||||
|
||||
if apiCfg.KeyID == "" || apiCfg.IssuerID == "" || apiCfg.PrivateKey == "" {
|
||||
l.Errorw("attach by id credential missing")
|
||||
l.Errorw("attach by id credential missing", logger.Field("keyID", apiCfg.KeyID), logger.Field("issuerID", apiCfg.IssuerID), logger.Field("hasPrivateKey", apiCfg.PrivateKey != ""))
|
||||
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
|
||||
if apiCfg.BundleID == "" {
|
||||
var customData struct {
|
||||
|
||||
Reference in New Issue
Block a user