diff --git a/alipay/token/client_test.go b/alipay/token/client_test.go index 7d429c0..1265ac0 100644 --- a/alipay/token/client_test.go +++ b/alipay/token/client_test.go @@ -13,13 +13,14 @@ func TestToken_Client(t *testing.T) { MchCertPath: "/Users/lsxd/code/php/yxxt/market/config/alipaycash/appCertPublicKey_2021004100663111.crt", RootCertPath: "/Users/lsxd/code/php/yxxt/market/config/alipaycash/alipayRootCert.crt", } - resp, err := d.Client(context.Background(), "349feb5fb58e455da1b00a7748ceMD68") + resp, err := d.Client(context.Background(), "ecfb8b3f91e44ca6b94b8830fcd5BF88") if err != nil { t.Error(err) } else { if resp.IsSuccess() { t.Logf("Response: %+v", resp.Response) } else { + t.Errorf("resp: %+v", resp) t.Errorf("ErrorResponse: %+v", resp.ErrorResponse) t.Errorf("ErrorResponse Msg: %+v", resp.ErrorResponse.Msg) t.Errorf("ErrorResponse SubCode: %+v", resp.ErrorResponse.SubCode) diff --git a/alipay/token/model.go b/alipay/token/model.go index ace5012..deccdb6 100644 --- a/alipay/token/model.go +++ b/alipay/token/model.go @@ -33,8 +33,8 @@ type AlipayTokenSuccessResponse struct { } type AlipayTokenResponse struct { - ErrorResponse *alipay.ErrorResponse `json:"error_response"` - Response *AlipayTokenSuccessResponse `json:"alipay_system_oauth_token_response"` + ErrorResponse *alipay.ErrorResponse `json:"error_response,omitempty"` + Response *AlipayTokenSuccessResponse `json:"alipay_system_oauth_token_response,omitempty"` Sign string `json:"sign"` }