Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateSign(data url.Values, token string) string
- func MappingStatus(status int, result *config.Result)
- func New() payment.Driver
- func SetDefaults(a *config.Account)
- type CreateTransactionRequest
- type CreateTransactionResponse
- type EPUSDT
- func (a *EPUSDT) Client() *resty.Request
- func (a *EPUSDT) IsSupported(s config.Support) bool
- func (a *EPUSDT) Pay(ctx echo.Context, cfg *config.Pay) (*config.PayResponse, error)
- func (a *EPUSDT) PayNotify(ctx echo.Context) error
- func (a *EPUSDT) PayQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *EPUSDT) Refund(ctx echo.Context, cfg *config.Refund) (*config.Result, error)
- func (a *EPUSDT) RefundNotify(ctx echo.Context) error
- func (a *EPUSDT) RefundQuery(ctx echo.Context, cfg *config.Query) (*config.Result, error)
- func (a *EPUSDT) SetAccount(account *config.Account) payment.Driver
- func (a *EPUSDT) SetNotifyCallback(callback func(echo.Context) error) payment.Driver
- func (a *EPUSDT) VerifySign(ctx echo.Context) error
- type OrderNotifyResponse
- type QueryNetworkResponse
- type QueryNetworksRequest
- type QueryTransactionRequest
- type QueryTransactionResponse
- type Response
Constants ¶
View Source
const ( StatusWaitPay = 1 StatusPaid = 2 StatusExpired = 3 )
View Source
const Name = `epusdt`
Variables ¶
View Source
var ( URLCreateOrder = `/api/v1/order/create-transaction` URLQueryOrder = `/api/v1/order/query-transaction` URLQueryNet = `/api/v1/order/query-networks` )
Functions ¶
func MappingStatus ¶
MappingStatus Order Status
func SetDefaults ¶ added in v0.6.3
Types ¶
type CreateTransactionRequest ¶
type CreateTransactionRequest struct {
OrderId string `json:"order_id" validate:"required|maxLen:32"`
Amount float64 `json:"amount" validate:"required|isFloat|gt:0.01"`
NotifyUrl string `json:"notify_url" validate:"required"`
Signature string `json:"signature" validate:"required"`
RedirectUrl string `json:"redirect_url"`
TradeType string `json:"trade_type,omitempty"`
Timestamp int64 `json:"timestamp" validate:"required"`
}
CreateTransactionRequest 创建交易请求
func (*CreateTransactionRequest) URLValues ¶
func (c *CreateTransactionRequest) URLValues() url.Values
type CreateTransactionResponse ¶
type CreateTransactionResponse struct {
TradeId string `json:"trade_id"` // epusdt订单号
OrderId string `json:"order_id"` // 客户交易id
Amount float64 `json:"amount"` // 订单金额,保留4位小数
ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数
Token string `json:"token"` // 收款钱包地址
ExpirationTime int64 `json:"expiration_time"` // 过期时间 时间戳(毫秒)
PaymentUrl string `json:"payment_url"` // 收银台地址
}
CreateTransactionResponse 创建订单成功返回
type EPUSDT ¶
type EPUSDT struct {
// contains filtered or unexported fields
}
func (*EPUSDT) RefundNotify ¶
RefundNotify 退款回调处理
func (*EPUSDT) RefundQuery ¶
RefundQuery 退款查询
func (*EPUSDT) SetNotifyCallback ¶
type OrderNotifyResponse ¶
type OrderNotifyResponse struct {
TradeId string `json:"trade_id"` // epusdt订单号
OrderId string `json:"order_id"` // 客户交易id
Amount float64 `json:"amount"` // 订单金额,保留4位小数
ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数
Token string `json:"token"` // 收款钱包地址
BlockTransactionId string `json:"block_transaction_id"` // 区块id
Signature string `json:"signature"` // 签名
Status int `json:"status"` // 1:等待支付,2:支付成功,3:已过期
}
OrderNotifyResponse 订单异步回调结构体
func (*OrderNotifyResponse) URLValues ¶
func (c *OrderNotifyResponse) URLValues() url.Values
func (*OrderNotifyResponse) Verify ¶
func (c *OrderNotifyResponse) Verify(token string) bool
type QueryNetworkResponse ¶ added in v0.6.3
type QueryNetworksRequest ¶ added in v0.6.3
type QueryNetworksRequest struct {
Timestamp int64 `json:"timestamp" validate:"required"`
Signature string `json:"signature" validate:"required"`
}
QueryNetworksRequest 查询支持的智能合约网络请求
func (*QueryNetworksRequest) URLValues ¶ added in v0.6.3
func (c *QueryNetworksRequest) URLValues() url.Values
type QueryTransactionRequest ¶ added in v0.4.1
type QueryTransactionRequest struct {
TradeId string `json:"trade_id" validate:"required|maxLen:32"`
Timestamp int64 `json:"timestamp" validate:"required"`
Signature string `json:"signature" validate:"required"`
}
QueryTransactionRequest 查询交易请求
func (*QueryTransactionRequest) URLValues ¶ added in v0.4.1
func (c *QueryTransactionRequest) URLValues() url.Values
type QueryTransactionResponse ¶ added in v0.4.1
type QueryTransactionResponse struct {
TradeId string `json:"trade_id"` // epusdt订单号
Status int `json:"status"` // 状态
Currency string `json:"currency"` // 支付币种
Amount float64 `json:"amount"` // 订单金额,保留4位小数
ActualCurrency string `json:"actual_currency"` // 实付币种
ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数
}
Click to show internal directories.
Click to hide internal directories.