This commit is contained in:
邹宗楠
2025-08-08 17:19:50 +08:00
parent eb7add180c
commit ab6984b31d
2 changed files with 9 additions and 12 deletions

View File

@@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"net/http" "net/http"
"time" "time"
) )
@@ -41,7 +40,6 @@ func (a *API) QueryBillBalance(param *QueryBillBalanceReq) (*QueryBillBalanceRes
// EwalletWithdrawD1 账户D1提现 // EwalletWithdrawD1 账户D1提现
func (a *API) EwalletWithdrawD1(param *EwalletWithdrawD1Req) (string, string, error) { func (a *API) EwalletWithdrawD1(param *EwalletWithdrawD1Req) (string, string, error) {
globals.SugarLogger.Debugf("-----param:= %s", utils.Format4Output(param, false))
reqParameter := map[string]interface{}{ reqParameter := map[string]interface{}{
"reqData": utils.Struct2Map(param, "", false), "reqData": utils.Struct2Map(param, "", false),
"reqId": utils.GetUUID(), "reqId": utils.GetUUID(),
@@ -49,8 +47,6 @@ func (a *API) EwalletWithdrawD1(param *EwalletWithdrawD1Req) (string, string, er
"timestamp": time.Now().Unix(), "timestamp": time.Now().Unix(),
} }
result, err := a.AccessAPISign(BillProdUrl, BillDrawD1, http.MethodPost, "", reqParameter) result, err := a.AccessAPISign(BillProdUrl, BillDrawD1, http.MethodPost, "", reqParameter)
globals.SugarLogger.Debugf("-----result:= %s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("-----result:= %v", err)
if err != nil { if err != nil {
return "", "", err return "", "", err
} }
@@ -58,7 +54,7 @@ func (a *API) EwalletWithdrawD1(param *EwalletWithdrawD1Req) (string, string, er
return "", "", fmt.Errorf(result["retMsg"].(string)) return "", "", fmt.Errorf(result["retMsg"].(string))
} }
return result["respData"].(map[string]string)["drawJnl"], result["respData"].(map[string]string)["merOrderNo"], nil return result["respData"].(map[string]interface{})["drawJnl"].(string), result["respData"].(map[string]interface{})["merOrderNo"].(string), nil
} }
// EwalletWithdrawQuery 提现结果查询 // EwalletWithdrawQuery 提现结果查询

View File

@@ -19,18 +19,19 @@ func TestQueryBillBalance(t *testing.T) {
// TestEwalletWithdrawD1 账户D1体现 // TestEwalletWithdrawD1 账户D1体现
func TestEwalletWithdrawD1(t *testing.T) { func TestEwalletWithdrawD1(t *testing.T) {
api.EwalletWithdrawD1(&EwalletWithdrawD1Req{ r1, r2, err := api.EwalletWithdrawD1(&EwalletWithdrawD1Req{
OrgNo: "1", OrgNo: "983931",
MerchantNo: "8221000581200BS", MerchantNo: "822651059990E2S",
DrawAmt: "10", DrawAmt: "0.01",
NotifyUrl: "test", NotifyUrl: "http://callback.jxc4.com/lakalaCallback/ewalletWithdrawD1",
MerOrderNo: "hxmkl20220816900003", MerOrderNo: "20250808170859324127661",
PayNo: "", PayNo: "",
PayType: "", PayType: "01",
Remark: "", Remark: "",
Summary: "", Summary: "",
BankId: "", BankId: "",
}) })
fmt.Println(r1, r2, err)
} }
// TestEwalletWithdrawQuery 提现结果查询 // TestEwalletWithdrawQuery 提现结果查询