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 }