package ddaypay const ( // payURL = "https://test-pay.dday.live/payIn/create" // queryPayURL = "https://test-pay.dday.live/payQuery/queryPayStatus" // withdrawURL = "https://test-pay.dday.live/payOut/create" // queryWithdrawURL = "https://test-pay.dday.live/payQuery/queryWithdrawStatus" payURL = "https://pay-in.dday.live/payIn/create" queryPayURL = "https://pay-query.dday.live/payQuery/queryPayStatus" withdrawURL = "https://pay-out.dday.live/payOut/create" queryWithdrawURL = "https://pay-query.dday.live/payQuery/queryWithdrawStatus" mid = "128" key = "913818c1d6ad413aba85f67d9daf7cc1" // mid = "202366100" // key = "c385fe7029344aef826d8112625b2625x" ) type PayReq struct { MchId string `json:"mchId"` // 商户ID TradeNo string `json:"tradeNo"` // 订单ID TradeAmount string `json:"tradeAmount"` // 代收金额 PayerIp string `json:"payerIp"` // 支付人IP PayerPhone string `json:"payerPhone"` // 支付人手机号(无须 +91) NotifyUrl string `json:"notifyUrl"` // 回调地址 Sign string `json:"sign"` // 签名(可选) } type PayResp struct { Code int `json:"code"` // 状态码:0 为成功,其它为失败(仅表示平台是否接收到) Msg string `json:"msg"` // 错误原因 Data struct { MchId int `json:"mchId"` // 商户ID TradeUrl string `json:"tradeUrl"` // 收银台地址 OrderId string `json:"orderId"` // 平台订单ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID } `json:"data"` // 响应数据,仅当 code == "0" 时返回 } type PayCallbackReq struct { MchId string `json:"mchId"` // 商户ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID OrderAmount string `json:"orderAmount"` // 商户订单金额 OrderStatus string `json:"orderStatus"` // 订单状态:success 成功,failure 失败 PlatOrderId string `json:"platOrderId"` // 平台订单ID Sign string `json:"sign"` // 签名(可选) } type QueryPayReq struct { MchId string `json:"mchId"` // 商户ID TradeNo string `json:"tradeNo"` // 商户订单ID Sign string `json:"sign"` // 签名(可选) } type QueryPayResp struct { Code int `json:"code"` // 状态码:0 为成功,其它为失败(仅表示平台是否接收成功) Msg string `json:"msg"` // 错误原因 Data struct { // MchId string `json:"mchId"` // 商户ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID PlatOrderId string `json:"platOrderId"` // 平台订单ID OrderAmount string `json:"orderAmount"` // 订单金额 OrderStatus string `json:"orderStatus"` // 订单状态:orderCreate / failure / success } `json:"data"` // 查询结果数据,仅 code == "0" 时有数据 } type WithdrawReq struct { MchId string `json:"mchId"` // 商户ID TradeNo string `json:"tradeNo"` // 订单ID TradeAmount string `json:"tradeAmount"` // 代付金额 PayerIp string `json:"payerIp"` // 提现人IP PayerPhone string `json:"payerPhone"` // 提现人手机号(无须 +91) IfscCode string `json:"ifscCode"` // 银行卡提款 IFSC BankCardNumber string `json:"bankCardNumber"` // 银行卡号 BankAccountName string `json:"bankAccountName"` // 银行卡持有人姓名 NotifyUrl string `json:"notifyUrl"` // 回调地址 Sign string `json:"sign"` // 签名(可选) } type WithdrawResp struct { Code int `json:"code"` // 状态码:0 为成功,其它为失败(仅代表平台是否接收成功) Msg string `json:"msg"` // 错误原因 Data struct { MchId int `json:"mchId"` // 商户ID OrderId string `json:"orderId"` // 平台订单ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID } `json:"data"` // 返回数据,仅当 code == "0" 时有值 } type WithdrawCallbackReq struct { MchId string `json:"mchId"` // 商户ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID OrderAmount string `json:"orderAmount"` // 商户订单金额 OrderStatus string `json:"orderStatus"` // 订单状态:success 成功,failure 失败 PlatOrderId string `json:"platOrderId"` // 平台订单ID Sign string `json:"sign"` // 签名(可选) } type QueryWithdrawReq struct { MchId string `json:"mchId"` // 商户ID TradeNo string `json:"tradeNo"` // 商户订单ID Sign string `json:"sign"` // 签名(可选) } type QueryWithdrawResp struct { Code int `json:"code"` // 状态码:0 为成功,其余为失败(仅表示平台是否收到请求) Msg string `json:"msg"` // 错误原因 Data struct { MchId int `json:"mchId"` // 商户ID TradeOrderId string `json:"tradeOrderId"` // 商户订单ID PlatOrderId string `json:"platOrderId"` // 平台订单ID OrderAmount string `json:"orderAmount"` // 订单金额 OrderStatus string `json:"orderStatus"` // 订单状态:submitted / failure / success } `json:"data"` // 查询结果,仅 code == "0" 时返回 }