diff --git a/md/alipay.go b/md/alipay.go index 1e0132f..d9c0388 100644 --- a/md/alipay.go +++ b/md/alipay.go @@ -64,6 +64,27 @@ type AlipayFundTransUniTransfer struct { } `json:"alipay_fund_trans_uni_transfer_response"` Sign string `json:"sign"` } +type AlipayFundTransCommonQuery struct { + AlipayFundTransCommonQueryResponse struct { + Code string `json:"code"` + Msg string `json:"msg"` + OrderId string `json:"order_id"` + PayFundOrderId string `json:"pay_fund_order_id"` + OutBizNo string `json:"out_biz_no"` + TransAmount string `json:"trans_amount"` + Status string `json:"status"` + PayDate string `json:"pay_date"` + ArrivalTimeEnd string `json:"arrival_time_end"` + OrderFee string `json:"order_fee"` + ErrorCode string `json:"error_code"` + FailReason string `json:"fail_reason"` + SubOrderErrorCode string `json:"sub_order_error_code"` + SubOrderFailReason string `json:"sub_order_fail_reason"` + SubOrderStatus string `json:"sub_order_status"` + SettleSerialNo string `json:"settle_serial_no"` + } `json:"alipay_fund_trans_common_query_response"` + Sign string `json:"sign"` +} type ZhimaCreditPayafteruseCreditbizorderFinish struct { ZhimaCreditPayafteruseCreditbizorderFinishResponse struct { Code string `json:"code"` diff --git a/pay/alipay.go b/pay/alipay.go index 88350a2..f804fc0 100644 --- a/pay/alipay.go +++ b/pay/alipay.go @@ -222,6 +222,28 @@ func AlipayFundTransUniTransfer(args map[string]string) (*md.AlipayFundTransUniT res := bs.(*md.AlipayFundTransUniTransfer) return res, nil } +func AlipayFundTransCommonQuery(args map[string]string) (*md.AlipayFundTransCommonQuery, error) { + client := Comm(args) + if client == nil { + return nil, errors.New("获取失败") + } + //请求参数 + bm := make(gopay.BodyMap) + bm.SetBodyMap("biz_content", func(bz gopay.BodyMap) { + bz.Set("out_biz_no", args["out_biz_no"]) + bz.Set("product_code", args["product_code"]) + bz.Set("biz_scene", args["biz_scene"]) + }) + + var aliPsp md.AlipayFundTransCommonQuery + bs, err := PostAliPayAPISelfV2(client, bm, "alipay.fund.trans.common.query", &aliPsp) + if err != nil { + xlog.Error(err) + return nil, err + } + res := bs.(*md.AlipayFundTransCommonQuery) + return res, nil +} //扣款 func AlipayTradePay(args map[string]string) (*md.AlipayTradePay, error) {