You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
6.8 KiB
133 lines
6.8 KiB
package gallopay |
|
|
|
const ( |
|
baseURL = "https://api.gallopay.com" |
|
// payURL = "/payin/createorder" |
|
queryPayURL = "/payin/getorder" |
|
withdrawURL = "/payout/createorder" |
|
queryWithdrawURL = "/payout/getorder" |
|
mid = "97139655" |
|
key = "31XPUhzo2uWCW7zm" |
|
// mid = "202366100" |
|
// key = "c385fe7029344aef826d8112625b2625x" |
|
) |
|
|
|
type PayReq struct { |
|
OrderID string `json:"orderid"` // 订单号(商户系统分配的唯一订单ID) |
|
Amount string `json:"amount"` // 订单金额(精确到小数点后两位,不足两位补0) |
|
Name string `json:"name"` // 用户姓名 |
|
Email string `json:"email"` // 用户 email |
|
CustomerIP string `json:"customerip"` // 用户请求 IP |
|
Phone string `json:"phone"` // 用户手机号 |
|
NotifyURL string `json:"notifyurl"` // 支付结果回调通知地址(HTTPS) |
|
// PayMethod string `json:"paymethod"` // 支付方式, 如: UPI,默认为空 |
|
// Notes string `json:"notes"` // 备注信息 |
|
Timestamp string `json:"timestamp"` // 订单请求创建时间(秒级时间戳) |
|
} |
|
|
|
type PayResp struct { |
|
Code string `json:"code"` |
|
Msg string `json:"msg"` |
|
OrderID string `json:"orderid"` |
|
GPOrderID string `json:"gporderid"` |
|
Status string `json:"status"` |
|
PaymentLink string `json:"paymentlink"` |
|
} |
|
|
|
type PayCallbackReq struct { |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
GPOrderID string `json:"gporderid"` // 平台订单号 |
|
Status string `json:"status"` // 订单状态: success / failed |
|
Msg string `json:"msg"` // 失败原因 |
|
Currency string `json:"currency"` // 币种代码 |
|
Amount string `json:"amount"` // 订单金额(精确到小数点后两位,不足补0) |
|
Name string `json:"name"` // 用户姓名 |
|
Email string `json:"email"` // 用户邮箱 |
|
Phone string `json:"phone"` // 用户手机号 |
|
PayMethod string `json:"paymethod"` // 支付方式, 如: UPI (可选) |
|
Notes string `json:"notes"` // 订单备注信息 (可选) |
|
} |
|
|
|
type QueryPayReq struct { |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
Timestamp string `json:"timestamp"` // 秒级时间戳 (请求创建时间) |
|
} |
|
|
|
type QueryPayResp struct { |
|
Code string `json:"code"` // 结果码:0 - 成功,其他 - 出错 |
|
Msg string `json:"msg"` // 失败原因 |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
GPOrderID string `json:"gporderid"` // 平台订单号 |
|
Status string `json:"status"` // 订单处理结果状态:success - 成功,failed - 失败 |
|
Currency string `json:"currency"` // 币种代码 |
|
Amount string `json:"amount"` // 订单金额(精确到小数点后两位,不足补0) |
|
Name string `json:"name"` // 用户姓名 |
|
Email string `json:"email"` // 用户 email |
|
Phone string `json:"phone"` // 用户手机号 |
|
PayMethod string `json:"paymethod"` // 支付方式,如:UPI,默认为空 |
|
Notes string `json:"notes"` // 订单备注信息 |
|
CreationTime string `json:"creationtime"` // 平台订单创建时间(可选) |
|
IsSettled string `json:"issettled"` // 是否结算:1 - 结算,0 - 未结算 |
|
} |
|
|
|
type WithdrawReq struct { |
|
OrderID string `json:"orderid"` // 商户订单号(唯一) |
|
Amount string `json:"amount"` // 订单金额(精确到小数点后两位,不足两位补0) |
|
Name string `json:"name"` // 收款人姓名 |
|
Email string `json:"email"` // 收款人 Email |
|
Phone string `json:"phone"` // 收款人手机号 |
|
PayMethod string `json:"paymethod"` // 提现方式:imps/upi,默认 imps |
|
Address string `json:"address"` // 收款人地址 |
|
IFSC string `json:"ifsc"` // 收款人 IFSC 码 |
|
Account string `json:"account"` // 收款账号(银行卡号或 UPI 账号) |
|
NotifyURL string `json:"notifyurl"` // 提现结果回调通知地址(HTTPS) |
|
// Notes string `json:"notes"` // 备注信息(可选) |
|
Timestamp string `json:"timestamp"` // 订单请求创建时间(秒级时间戳) |
|
} |
|
|
|
type WithdrawResp struct { |
|
Code string `json:"code"` // 结果码: 0-接口调用成功, 其他-接口异常/订单处理出错 |
|
Msg string `json:"msg"` // 接口调用结果描述: 出错信息 |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
GPOrderID string `json:"gporderid"` // 平台订单号(可为空) |
|
Status string `json:"status"` // 订单处理状态: failed-失败, processing-处理中 |
|
} |
|
|
|
type WithdrawCallbackReq struct { |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
GPOrderID string `json:"gporderid"` // 平台订单号 |
|
UTR string `json:"utr"` // Unique Transaction Reference |
|
Status string `json:"status"` // 订单处理状态: success - 成功, failed - 失败 |
|
Msg string `json:"msg"` // 失败原因 |
|
PayMethod string `json:"paymethod"` // 支付方式,默认IMPS |
|
Currency string `json:"currency"` // 交易币种代码 |
|
Amount string `json:"amount"` // 订单金额(精确到小数点后两位,不足补0) |
|
Name string `json:"name"` // 收款人姓名 |
|
Email string `json:"email"` // 收款人email |
|
Phone string `json:"phone"` // 收款人手机号 |
|
Account string `json:"account"` // 收款账号(银行卡号) |
|
Notes string `json:"notes"` // 订单备注信息(可选) |
|
CreationTime string `json:"creationtime"` // 平台订单创建时间(可选) |
|
} |
|
|
|
type QueryWithdrawReq struct { |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
Timestamp string `json:"timestamp"` // 秒级时间戳 (请求创建时间) |
|
} |
|
|
|
type QueryWithdrawResp struct { |
|
Code string `json:"code"` // 调用结果:0 - 调用成功, 其他 - 验签失败/订单号不存在等 |
|
Msg string `json:"msg"` // 失败原因 |
|
OrderID string `json:"orderid"` // 商户订单号 |
|
GPOrderID string `json:"gporderid"` // 平台订单号 |
|
UTR string `json:"utr"` // Unique Transaction Reference |
|
Status string `json:"status"` // 订单处理结果状态: success - 成功, failed - 失败 |
|
PayMethod string `json:"paymethod"` // 支付方式,当前默认为IMPS |
|
Currency string `json:"currency"` // 币种代码 |
|
Amount string `json:"amount"` // 订单金额,精确到小数点后两位,不足补0 |
|
Name string `json:"name"` // 收款人姓名 |
|
Email string `json:"email"` // 收款人email |
|
Phone string `json:"phone"` // 收款人手机号 |
|
Notes string `json:"notes"` // 订单备注信息(可选) |
|
CreationTime string `json:"creationtime"` // 平台订单创建时间(可选) |
|
}
|
|
|