Jerry 7 лет назад
Родитель
Сommit
68bbd6a931
3 измененных файлов с 7 добавлено и 6 удалено
  1. 1 1
      alipay_client_test.go
  2. 4 4
      alipay_rsp.go
  3. 2 1
      alipay_server_api.go

+ 1 - 1
alipay_client_test.go

@@ -23,7 +23,7 @@ func TestAliPayClient_AliPayTradeWapPay(t *testing.T) {
 	//请求参数
 	body := make(BodyMap)
 	body.Set("subject", "手机网站测试支付")
-	body.Set("out_trade_no", "GYWX201901301040355706100443")
+	body.Set("out_trade_no", "GYWX201901301040355706100446")
 	body.Set("quit_url", "https://www.igoogle.ink")
 	body.Set("total_amount", "100.00")
 	body.Set("product_code", "QUICK_WAP_WAY")

+ 4 - 4
alipay_rsp.go

@@ -41,17 +41,17 @@ type AliPayNotifyRequest struct {
 }
 
 type FundBillListInfo struct {
-	FundChannel string `json:"fundChannel"`
 	Amount      string `json:"amount"`
+	FundChannel string `json:"fundChannel"`
 }
 
 type VoucherDetailListInfo struct {
-	Name               string `json:"name"`
-	Type               string `json:"type"`
 	Amount             string `json:"amount"`
+	Memo               string `json:"memo"`
 	MerchantContribute string `json:"merchant_contribute"`
+	Name               string `json:"name"`
 	OtherContribute    string `json:"other_contribute"`
-	Memo               string `json:"memo"`
+	Type               string `json:"type"`
 }
 
 type AliPayTradePayAppResponse struct {

+ 2 - 1
alipay_server_api.go

@@ -164,6 +164,7 @@ func jsonToString(v interface{}) (str string) {
 		fmt.Println("err:", err)
 		return ""
 	}
+	//[{"fundChannel":"ALIPAYACCOUNT","amount":"100.00"}]
 	//log.Println("string:", string(bs))
 	s := string(bs)
 	if s == "null" {
@@ -267,7 +268,7 @@ func verifyAliPaySign(signData, sign, signType, aliPayPublicKey string) (err err
 
 	h = hashs.New()
 	h.Write([]byte(signData))
-
+	log.Println("publicKey:", publicKey)
 	err = rsa.VerifyPKCS1v15(publicKey, hashs, h.Sum(nil), signBytes)
 	log.Println("rsa.VerifyPKCS1v15:", err)
 	return