Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Nov 15, 2019
1 parent 6dce59e commit bdbadb5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions alipay_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ func (a *AliPayClient) AliPayTradePageRefund(body BodyMap) (aliRsp *AliPayTradeP

// alipay.trade.precreate(统一收单线下交易预创建)
// 文档地址:https://docs.open.alipay.com/api_1/alipay.trade.precreate
func (a *AliPayClient) AliPayTradePrecreate(body BodyMap) (aliRsp *AlipayTradePrecreateResponse, err error) {
func (a *AliPayClient) AliPayTradePrecreate(body BodyMap) (aliRsp *AliPayTradePrecreateResponse, err error) {
var bs []byte
if body.Get("out_trade_no") == null {
return nil, errors.New("out_trade_no is not allowed to be null")
}
if bs, err = a.doAliPay(body, "alipay.trade.precreate"); err != nil {
return
}
aliRsp = new(AlipayTradePrecreateResponse)
aliRsp = new(AliPayTradePrecreateResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
Expand Down Expand Up @@ -319,15 +319,15 @@ func (a *AliPayClient) AliPayTradePagePay(body BodyMap) (payUrl string, err erro

// alipay.fund.trans.toaccount.transfer(单笔转账到支付宝账户接口)
// 文档地址:https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer
func (a *AliPayClient) AlipayFundTransToaccountTransfer(body BodyMap) (aliRsp *AlipayFundTransToaccountTransferResponse, err error) {
func (a *AliPayClient) AliPayFundTransToaccountTransfer(body BodyMap) (aliRsp *AliPayFundTransToaccountTransferResponse, err error) {
var bs []byte
if body.Get("out_biz_no") == null {
return nil, errors.New("out_biz_no is not allowed to be null")
}
if bs, err = a.doAliPay(body, "alipay.fund.trans.toaccount.transfer"); err != nil {
return
}
aliRsp = new(AlipayFundTransToaccountTransferResponse)
aliRsp = new(AliPayFundTransToaccountTransferResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
Expand Down Expand Up @@ -373,12 +373,12 @@ func (a *AliPayClient) AliPaySystemOauthToken(body BodyMap) (aliRsp *AliPaySyste
// alipay.user.info.share(支付宝会员授权信息查询接口)
// body:此接口无需body参数
// 文档地址:https://docs.open.alipay.com/api_2/alipay.user.info.share
func (a *AliPayClient) AlipayUserInfoShare() (aliRsp *AlipayUserInfoShareResponse, err error) {
func (a *AliPayClient) AliPayUserInfoShare() (aliRsp *AliPayUserInfoShareResponse, err error) {
var bs []byte
if bs, err = a.doAliPay(nil, "alipay.user.info.share"); err != nil {
return nil, err
}
aliRsp = new(AlipayUserInfoShareResponse)
aliRsp = new(AliPayUserInfoShareResponse)
if err = json.Unmarshal(bs, aliRsp); err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions alipay_rsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ type oauthTokenInfo struct {
}

//===================================================
type AlipayUserInfoShareResponse struct {
type AliPayUserInfoShareResponse struct {
Response *userInfoShare `json:"alipay_user_info_share_response,omitempty"`
SignData string `json:"-"`
Sign string `json:"sign"`
Expand Down Expand Up @@ -380,7 +380,7 @@ type orderSettleResponse struct {
}

//===================================================
type AlipayTradePrecreateResponse struct {
type AliPayTradePrecreateResponse struct {
Response *precreateResponse `json:"alipay_trade_precreate_response,omitempty"`
SignData string `json:"-"`
Sign string `json:"sign"`
Expand Down Expand Up @@ -414,7 +414,7 @@ type pageRefundResponse struct {
}

//===================================================
type AlipayFundTransToaccountTransferResponse struct {
type AliPayFundTransToaccountTransferResponse struct {
Response *transToaccountTransferResponse `json:"alipay_fund_trans_toaccount_transfer_response,omitempty"`
SignData string `json:"-"`
Sign string `json:"sign"`
Expand Down
4 changes: 2 additions & 2 deletions examples/alipay/alipay_AlipayFundTransToaccountTransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/iGoogle-ink/gopay"
)

func AlipayFundTransToaccountTransfer() {
func AliPayF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YAnJ1ADugC4vI2sNdvt7618pnT3HEJxb8J6r4gKzYzbszlGlURQQAuMfKcP7RVtO1ZYkRyhmLxM4aZxNA9I+boVrlFWDAchzg+8VuunBwIslgLHx0/4EoUWLzd1/OGtco6oU1HXhI9J9pRGjqfO1iiIifN/ujwqx7AFNknayG/YkQKBgD6yNgA/ak12rovYzXKdp14Axn+39k2dPp6J6R8MnyLlB3yruwW6NSbNhtzTD1GZ+wCQepQvYvlPPc8zm+t3tl1r+Rtx3ORf5XBZc3iPkGdPOLubTssrrAnA+U9vph61W+OjqwLJ9sHUNK9pSHhHSIS4k6ycM2YAHyIC9NGTgB0PAoGAJjwd1DgMaQldtWnuXjvohPOo8cQudxXYcs6zVRbx6vtjKe2v7e+eK1SSVrR5qFV9AqxDfGwq8THenRa0LC3vNNplqostuehLhkWCKE7Y75vXMR7N6KU1kdoVWgN4BhXSwuRxmHMQfSY7q3HG3rDGz7mzXo1FVMr/uE4iDGm0IXY="
//初始化支付宝客户端
// appId:应用ID
Expand All @@ -27,7 +27,7 @@ func AlipayFundTransToaccountTransfer() {
body.Set("payee_real_name", "沙箱环境")
body.Set("remark", "转账测试")
//创建订单
aliRsp, err := client.AlipayFundTransToaccountTransfer(body)
aliRsp, err := client.AliPayFundTransToaccountTransfer(body)
if err != nil {
fmt.Println("err:", err)
return
Expand Down
2 changes: 1 addition & 1 deletion examples/alipay/alipay_AlipayOpenAuthTokenApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/iGoogle-ink/gopay"
)

func AlipayOpenAuthTokenApp() {
func AliPayOpenAuthTokenApp() {
privateKey := "MIIEogIBAAKCAQEAy+CRzKw4krA2RzCDTqg5KJg92XkOY0RN3pW4sYInPqnGtHV7YDHu5nMuxY6un+dLfo91OFOEg+RI+WTOPoM4xJtsOaJwQ1lpjycoeLq1OyetGW5Q8wO+iLWJASaMQM/t/aXR/JHaguycJyqlHSlxANvKKs/tOHx9AhW3LqumaCwz71CDF/+70sc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9Jey46d6al+Xz/0sM0c+3nbYb9Va2oPahW70hmbTchBrqKAh/svb9yCeWw5i6NuzUNRZ5kz5ufr42XRRVNR2IJ2Av4RGfVA7W/uhAnIZBPngk5CoyfgcCgYEAwQuH9DH46fvKTB+B1kDngpKQw9Jn2ZXVz8dyYnhdH/SZgohwD/jTldx9ck42bFw4+3qHI6DJSxBxqeuaGQqmD5Y3YStP3Gb33EABACpLt1NV4AId8rWfrizJTxy5+PJONHNmDNL0Fyv53qtsG1rv+Unye6Pfeo6pkKmK49u/Az0CgYEAtR3Oz934dNFGohs1GFIC5pT86xPm3dfyPjUjpZ8ftkcgQe2+0kFQMZ2LACvYMFv3DGd5e4bmUzIIN5G/cktZWWkq4uSFrRyNjRVanjXYVJ8s5spM8gaD4/GNRPQNCBnQGyZVuoxQkeriHunqyYWc43JL1Wuvm2pXyI1xH/jFcz8CgYB1IN34mGmC7rcrwOIycWcGno8fgYZpSrRUQZtxi75VKUALJ2V3C261uvaSaEo1LS+Vxh5Ay8nWtb+BbeYt03w2cNphJrpp7D/vbxYsV31hWjr8k8w/+1tLfvkV+0QLfFlfEbWVill3xcLyC+ioIGECTI/H3QI3hl/z2irfXfFjsQKBgA+vBD22XWD1drUccPA0mMJdVMW/yrd3HVbHLVHaNqkdPFUAN8k27icXxdE2gKoHWmDeW0SZ5Wm7Hc+79f222ZS401vzlL78sIXBydYlsxn3zDowt5U9WTDPVxoqx+aStUriDPiV3fnxj9D/Q4IAEYlqI1gjRBF1o15zRFQZAkJv"
//初始化支付宝客户端
Expand Down
4 changes: 2 additions & 2 deletions examples/alipay/alipay_AlipayUserInfoShare.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/iGoogle-ink/gopay"
)

func AlipayUserInfoShare() {
func AliPayUserInfoShare() {
aliPayPublicKey := "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1wn1sU/8Q0rYLlZ6sq3enrPZw2ptp6FecHR2bBFLj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6uklsX3sTG1syo7Jr9PGE1xQgjDEIyO8h/3lDQyLyycYnyUPGNNMX8ZjmGwcM51DQ/QfIrY/CXjnnW+MVpmNclAva3L33KXCWjw20VsROV1EA8LCL94BUCgYEA3wH4ANpzo7NqXf+2WlPPMuyRrF0QPIRGlFBNtaKFy0mvoclkREPmK7+N4NIGtMf5JNODS5HkFRgmU4YNdupA2I8lIYpD+TsIobZxGUKUkYzRZYZ1m1ttL69YYvCVz9Xosw/VoQ+RrW0scS5yUKqFMIUOV2R/Imi//c5TdKx6VP8CgYAnJ1ADugC4vI2sNdvt7618pnT3HEJxb8J6r4gKzYzbszlGlURQQAuMfKcP7RVtO1ZYkRyhmLxM4aZxNA9I+boVrlFWDAchzg+8VuunBwIslgLHx0/4EoUWLzd1/OGtco6oU1HXhI9J9pRGjqfO1iiIifN/ujwqx7AFNknayG/YkQKBgD6yNgA/ak12rovYzXKdp14Axn+39k2dPp6J6R8MnyLlB3yruwW6NSbNhtzTD1GZ+wCQepQvYvlPPc8zm+t3tl1r+Rtx3ORf5XBZc3iPkGdPOLubTssrrAnA+U9vph61W+OjqwLJ9sHUNK9pSHhHSIS4k6ycM2YAHyIC9NGTgB0PAoGAJjwd1DgMaQldtWnuXjvohPOo8cQudxXYcs6zVRbx6vtjKe2v7e+eK1SSVrR5qFV9AqxDfGwq8THenRa0LC3vNNplqostuehLhkWCKE7Y75vXMR7N6KU1kdoVWgN4BhXSwuRxmHMQfSY7q3HG3rDGz7mzXo1FVMr/uE4iDGm0IXY="
//初始化支付宝客户端
Expand All @@ -20,7 +20,7 @@ func AlipayUserInfoShare() {
SetAuthToken("authusrB3888b190f6df4aea964d66129f8a5X11")

//发起请求
aliRsp, err := client.AlipayUserInfoShare()
aliRsp, err := client.AliPayUserInfoShare()
if err != nil {
fmt.Println("err:", err)
return
Expand Down

0 comments on commit bdbadb5

Please sign in to comment.