8
8
9
9
"github.com/go-pay/gopay"
10
10
"github.com/go-pay/gopay/pkg/xhttp"
11
- "github.com/go-pay/xlog"
12
11
"github.com/go-pay/xtime"
13
12
)
14
13
@@ -71,7 +70,7 @@ func (a *Client) PostFileAliPayAPISelfV2(ctx context.Context, bm gopay.BodyMap,
71
70
bm .Set (k , v )
72
71
}
73
72
if a .DebugSwitch == gopay .DebugOn {
74
- xlog .Debugf ("Alipay_Request: %s" , bm .JsonBody ())
73
+ a . logger .Debugf ("Alipay_Request: %s" , bm .JsonBody ())
75
74
}
76
75
if a .IsProd {
77
76
url = baseUrlUtf8
@@ -84,7 +83,7 @@ func (a *Client) PostFileAliPayAPISelfV2(ctx context.Context, bm gopay.BodyMap,
84
83
return nil
85
84
}
86
85
if a .DebugSwitch == gopay .DebugOn {
87
- xlog . Debugf ("Alipay_Response: %s%d %s%s " , xlog . Red , res .StatusCode , xlog . Reset , string (bs ))
86
+ a . logger . Debugf ("Alipay_Response: %d, %s" , res .StatusCode , string (bs ))
88
87
}
89
88
if res .StatusCode != 200 {
90
89
return fmt .Errorf ("HTTP Request Error, StatusCode = %d" , res .StatusCode )
@@ -112,7 +111,7 @@ func (a *Client) doAliPaySelf(ctx context.Context, bm gopay.BodyMap, method stri
112
111
bm .Set ("sign" , sign )
113
112
}
114
113
if a .DebugSwitch == gopay .DebugOn {
115
- xlog .Debugf ("Alipay_Request: %s" , bm .JsonBody ())
114
+ a . logger .Debugf ("Alipay_Request: %s" , bm .JsonBody ())
116
115
}
117
116
if a .IsProd {
118
117
url = baseUrlUtf8
@@ -124,7 +123,7 @@ func (a *Client) doAliPaySelf(ctx context.Context, bm gopay.BodyMap, method stri
124
123
return nil , err
125
124
}
126
125
if a .DebugSwitch == gopay .DebugOn {
127
- xlog . Debugf ("Alipay_Response: %s%d %s%s " , xlog . Red , res .StatusCode , xlog . Reset , string (bs ))
126
+ a . logger . Debugf ("Alipay_Response: %d, %s" , res .StatusCode , string (bs ))
128
127
}
129
128
if res .StatusCode != 200 {
130
129
return nil , fmt .Errorf ("HTTP Request Error, StatusCode = %d" , res .StatusCode )
@@ -179,7 +178,7 @@ func (a *Client) doAliPay(ctx context.Context, bm gopay.BodyMap, method string,
179
178
return nil , err
180
179
}
181
180
if a .DebugSwitch == gopay .DebugOn {
182
- xlog . Debugf ("Alipay_Response: %s%d %s%s " , xlog . Red , res .StatusCode , xlog . Reset , string (bs ))
181
+ a . logger . Debugf ("Alipay_Response: %d, %s" , res .StatusCode , string (bs ))
183
182
}
184
183
if res .StatusCode != 200 {
185
184
return nil , fmt .Errorf ("HTTP Request Error, StatusCode = %d" , res .StatusCode )
@@ -235,7 +234,7 @@ func (a *Client) DoAliPay(ctx context.Context, bm gopay.BodyMap, method string,
235
234
return nil , err
236
235
}
237
236
if a .DebugSwitch == gopay .DebugOn {
238
- xlog . Debugf ("Alipay_Response: %s%d %s%s " , xlog . Red , res .StatusCode , xlog . Reset , string (bs ))
237
+ a . logger . Debugf ("Alipay_Response: %d, %s" , res .StatusCode , string (bs ))
239
238
}
240
239
if res .StatusCode != 200 {
241
240
return nil , fmt .Errorf ("HTTP Request Error, StatusCode = %d" , res .StatusCode )
@@ -338,7 +337,7 @@ func (a *Client) FileUploadRequest(ctx context.Context, bm gopay.BodyMap, method
338
337
}
339
338
pubBody .Set ("sign" , sign )
340
339
if a .DebugSwitch == gopay .DebugOn {
341
- xlog .Debugf ("Alipay_Query_Request: %s" , pubBody .JsonBody ())
340
+ a . logger .Debugf ("Alipay_Query_Request: %s" , pubBody .JsonBody ())
342
341
}
343
342
url := baseUrlUtf8 + "&" + pubBody .EncodeURLParams ()
344
343
@@ -348,7 +347,7 @@ func (a *Client) FileUploadRequest(ctx context.Context, bm gopay.BodyMap, method
348
347
return nil , err
349
348
}
350
349
if a .DebugSwitch == gopay .DebugOn {
351
- xlog . Debugf ("Alipay_Response: %s%d %s%s " , xlog . Red , res .StatusCode , xlog . Reset , string (bs ))
350
+ a . logger . Debugf ("Alipay_Response: %d, %s" , res .StatusCode , string (bs ))
352
351
}
353
352
if res .StatusCode != 200 {
354
353
return nil , fmt .Errorf ("HTTP Request Error, StatusCode = %d" , res .StatusCode )
0 commit comments