From 68fe77da6cbd02b7131ab3a0fcf4e552529afe49 Mon Sep 17 00:00:00 2001 From: Sinh Date: Mon, 5 Sep 2022 15:07:26 +0700 Subject: [PATCH] fix GC parse data --- partnerapi/globalcare/model_response.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/partnerapi/globalcare/model_response.go b/partnerapi/globalcare/model_response.go index 0e035a5..1da624c 100644 --- a/partnerapi/globalcare/model_response.go +++ b/partnerapi/globalcare/model_response.go @@ -1,6 +1,10 @@ package globalcare -import "encoding/json" +import ( + "encoding/json" + + "github.com/Selly-Modules/3pl/util/base64" +) // CommonResponse ... type CommonResponse struct { @@ -28,7 +32,8 @@ func (r *CommonResponse) DecodeError() (res ResponseError, err error) { // Decode ... func (r *CommonResponse) Decode(resultPointer interface{}) error { - return json.Unmarshal([]byte(r.Data), resultPointer) + b := base64.Decode(r.Data) + return json.Unmarshal(b, resultPointer) } // CreateOrderResponseDecoded ...