From 157fc7ed787c893771dde91ea3e1922dca3e93e1 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 21 Jun 2023 10:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card_pay/api.go | 10 ++++++---- card_pay/card_pay.go | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/card_pay/api.go b/card_pay/api.go index f752538..44226cf 100644 --- a/card_pay/api.go +++ b/card_pay/api.go @@ -21,14 +21,16 @@ const ( ) func CardPaySend(method string, keyArr map[string]string, param map[string]string) (string, error) { - url := "https://efps.epaylinks.cn/" + method + url := "https://test-efps.epaylinks.cn/" + method //https://efps.epaylinks.cn/ for key, value := range param { if value == "" { delete(param, key) } } - param["customerCode"] = keyArr["customerCode"] + if param["customerCode"] == "" { + param["customerCode"] = keyArr["customerCode"] + } param["nonceStr"] = randomString(32) data := zhios_third_party_utils.SerializeStr(param) sign, err := CardPayGetSign(keyArr["privateKeyStr"], data) @@ -53,7 +55,7 @@ func CardPaySend(method string, keyArr map[string]string, param map[string]strin } func CardPaySendSecond(method string, keyArr map[string]string, param map[string]interface{}) (string, error) { - url := "https://efps.epaylinks.cn/" + method + url := "https://test-efps.epaylinks.cn/" + method //https://efps.epaylinks.cn/ for key, value := range param { if value == "" { @@ -85,7 +87,7 @@ func CardPaySendSecond(method string, keyArr map[string]string, param map[string } func CardPayApplySend(method string, keyArr map[string]string, param map[string]string) (string, error) { - url := "https://efps.epaylinks.cn/" + method + url := "https://test-efps.epaylinks.cn/" + method //https://efps.epaylinks.cn/ for key, value := range param { if value == "" { diff --git a/card_pay/card_pay.go b/card_pay/card_pay.go index 9d5f678..bf05cf3 100644 --- a/card_pay/card_pay.go +++ b/card_pay/card_pay.go @@ -203,3 +203,26 @@ func ApplyStoreQuery(keyArr, param map[string]string) (string, error) { //} return CardPayApplySend("api/cust/SP/Merchant/query", keyArr, param) } + +func AccountQuery(keyArr, param map[string]string) (string, error) { + + //param := map[string]string{ + // "accountType": "2", + // "customerCode": "562932003186159", + //} + return CardPaySend("api/acc/accountQuery", keyArr, param) +} +func WithdrawalForSubMerchant(keyArr, param map[string]string) (string, error) { + + //param := map[string]string{ + // "version": "3.0", + // "outTradeNo": "1233333444", + // "memberId": "562658004035964", + // //"protocol": "p202306201841814421887", + // "payAmount": "98", + // "procedureCustomerCode": "", + // "payCurrency": "CNY", + // "notifyUrl": "http://inapi.izhyin.cn/api/v1/swipe/withdrawal/notify/123456", + //} + return CardPaySend("/api/txs/pay/WithdrawalForSubMerchant", keyArr, param) +}