diff --git a/lib/luso_bank/macao_luso.go b/lib/luso_bank/macao_luso.go index 9cc9b9a..13a7137 100644 --- a/lib/luso_bank/macao_luso.go +++ b/lib/luso_bank/macao_luso.go @@ -57,11 +57,17 @@ func (s *signParam) SetSign(privateKeyStr string) error { return nil } -func (payParam *PayParam) Send(prd bool) (string, error) { +func (payParam *PayParam) Send(prd bool, method string) (string, error) { url := "https://qrpaytest.lusobank.com.mo:443" if prd { url = "https://qrpaytest.lusobank.com.mo:8443" } + switch method { + case "create": + url = url + "/upcp-iap-pps-lqrp/libQrPay/json/create" + case "pay": + url = url + "/upcp-iap-pps-lqrp/libQrPay/json/pay" + } headers := map[string]string{ "Content-Type": "application/json", } diff --git a/test/luso_pay_test.go b/test/luso_pay_test.go index dfd7b19..c05f5c6 100644 --- a/test/luso_pay_test.go +++ b/test/luso_pay_test.go @@ -17,7 +17,7 @@ func TestLusoPay(t *testing.T) { "mdseDesc ": "澳门世寶-自營購物", "transAmount ": "100", "transCur ": "MOP", - "subMchtNm ": "世寶商城", + "subMchtNm ": luso.MchtStoreNm, "notifyUrl ": "http://inapi.izhyin.cn:80/pay/boc/callback", "extMsg ": zhios_pay_utils.SerializeStr(map[string]string{ "mid": "123456",