This commit is contained in:
邹宗楠
2025-08-14 10:13:30 +08:00
parent e2a9064949
commit a79d9ddec2
3 changed files with 10 additions and 4 deletions

View File

@@ -335,12 +335,18 @@ func (a *API) GetMerchantReportStatus(orgCode, agentNo, externalCustomerNo strin
return nil, err
}
if imgSupplementResp.Code != "200" {
if imgSupplementResp.Code != Success {
return nil, fmt.Errorf(imgSupplementResp.Message)
}
base64DecryData, _ := base64.StdEncoding.DecodeString(imgSupplementResp.Data)
resultData, err := DecryptByPublicKey(base64DecryData, PublicKeyBegin)
if err != nil {
return nil, err
}
openUnionpayMerchantVo := &OpenUnionpayMerchantVo{}
if err = json.Unmarshal([]byte(imgSupplementResp.Data), openUnionpayMerchantVo); err != nil {
if err = json.Unmarshal(resultData, openUnionpayMerchantVo); err != nil {
return nil, err
}

View File

@@ -612,7 +612,7 @@ type ImgSupplementReq struct {
// OpenUnionpayMerchantVo 银联报备,商户报备查询
type OpenUnionpayMerchantVo struct {
AgentNo int `json:"agentNo"` // 机构号
AgentNo string `json:"agentNo"` // 机构号
OrgCode string `json:"orgCode"` // 代理商编号
ExternalCustomerNo string `json:"externalCustomerNo"` // 商户编号
CustomerName string `json:"customerName"` // 商户名称

View File

@@ -227,7 +227,7 @@ func TestCheckImgIsSupplement(t *testing.T) {
// TestGetMerchantReportStatus 商户报备查询
func TestGetMerchantReportStatus(t *testing.T) {
api.GetMerchantReportStatus("983931", "24354409", "822651059990E0M")
api.GetMerchantReportStatus("983931", "24354409", "822651059990E2S")
}
// TestGetMerchantTerminal 设备终端报备查询