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

+ 1 - 1
alipay_client_test.go

@@ -77,7 +77,7 @@ func TestAliPayClient_AliPayTradePagePay(t *testing.T) {
 	//请求参数
 	body := make(BodyMap)
 	body.Set("subject", "网站测试支付")
-	body.Set("out_trade_no", "GYWX201901301040355706100435")
+	body.Set("out_trade_no", "GYWX201901301040355706100436")
 	body.Set("quit_url", "https://www.igoogle.ink")
 	body.Set("total_amount", "88.88")
 	body.Set("product_code", "FAST_INSTANT_TRADE_PAY")

+ 2 - 2
alipay_server_api.go

@@ -119,7 +119,7 @@ func VerifyAliPayResultSign(aliPayPublicKey string, notifyRsp *AliPayNotifyReque
 	body.Set("fund_bill_list", jsonToString(notifyRsp.FundBillList))
 	body.Set("passback_params", notifyRsp.PassbackParams)
 	body.Set("voucher_detail_list", jsonToString(notifyRsp.VoucherDetailList))
-	log.Println("body.get:", body.Get("voucher_detail_list"))
+
 	newBody := make(BodyMap)
 	for k, v := range body {
 		if v != null {
@@ -130,7 +130,7 @@ func VerifyAliPayResultSign(aliPayPublicKey string, notifyRsp *AliPayNotifyReque
 	pKey := FormatAliPayPublicKey(aliPayPublicKey)
 	signStr := sortAliPaySignParams(newBody)
 	log.Println("签名字符串:", signStr)
-	err = verifyAliPaySign(signStr, notifyRsp.Sign, "RSA", pKey)
+	err = verifyAliPaySign(signStr, notifyRsp.Sign, notifyRsp.SignType, pKey)
 	if err != nil {
 		return false, err
 	}