From 083ff9d58d12e06ce9beb484630c15d6b3e8d353 Mon Sep 17 00:00:00 2001 From: jiaoboxiang Date: Wed, 9 Nov 2022 13:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BE=B3=E9=96=80=E5=9C=8B=E9=9A=9B=E9=8A=80?= =?UTF-8?q?=E8=A1=8C=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/luso_bank/macao_luso.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/luso_bank/macao_luso.go b/lib/luso_bank/macao_luso.go index 24e2e5a..c48ab98 100644 --- a/lib/luso_bank/macao_luso.go +++ b/lib/luso_bank/macao_luso.go @@ -65,7 +65,7 @@ func (s *signParam) SetSign(privateKeyStr string) error { return nil } -func (payParam *PayParam) Send(prd bool, method string) (string, error) { +func (payParam *PayParam) Send(prd, isNeedEncode bool, method string) (string, error) { url := "https://qrpaytest.lusobank.com.mo:443" if prd { url = "https://qrpaytest.lusobank.com.mo:8443" @@ -80,7 +80,11 @@ func (payParam *PayParam) Send(prd bool, method string) (string, error) { "Content-Type": "application/json", } zhios_pay_utils.CurlDebug = true - res, err := zhios_pay_utils.CurlPost(url, php2go.URLEncode(zhios_pay_utils.SerializeStr(payParam)), headers) + body := zhios_pay_utils.SerializeStr(payParam) + if isNeedEncode { + body = php2go.URLEncode(body) + } + res, err := zhios_pay_utils.CurlPost(url, body, headers) if err != nil { return "", err }