From 83c54628ddd4234fe911573aa99ca939ddff1aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Wed, 23 Oct 2024 15:39:51 +0800 Subject: [PATCH] change sdk --- alipay/token/client_test.go | 3 ++- alipay/token/model.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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"` }