Documentation
¶
Index ¶
- type Client
- func (c *Client) ApplyRefund(txID, refundID, reason string, amount int64) (RespApplyRefund, error)
- func (c *Client) CloseOrder(txID string) error
- func (c *Client) CreateOrder(orderId, description string, amount int64) (RespCreateOrder, error)
- func (c *Client) CreateOrderH5(orderId, description, clientIP string, amount int64) (RespCreateOrder, error)
- func (c *Client) OrderNotifyResolve(notify PayNotify) (OrderNotifyData, error)
- func (c *Client) QueryOrder(orderId string) (RespQueryOrder, error)
- func (c *Client) QueryRefund(refundId string) (RespApplyRefund, error)
- func (c *Client) RefundNotifyResolve(notify PayNotify) (RefundNotifyData, error)
- type InitConfig
- type OrderNotifyData
- type PayNotify
- type RefundNotifyData
- type RespApplyRefund
- type RespCreateOrder
- type RespQueryOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Initialize ¶
func Initialize(p InitConfig) (*Client, error)
func (*Client) ApplyRefund ¶
func (c *Client) ApplyRefund(txID, refundID, reason string, amount int64) (RespApplyRefund, error)
func (*Client) CloseOrder ¶
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(orderId, description string, amount int64) (RespCreateOrder, error)
func (*Client) CreateOrderH5 ¶
func (c *Client) CreateOrderH5(orderId, description, clientIP string, amount int64) (RespCreateOrder, error)
func (*Client) OrderNotifyResolve ¶
func (c *Client) OrderNotifyResolve(notify PayNotify) (OrderNotifyData, error)
func (*Client) QueryOrder ¶
func (c *Client) QueryOrder(orderId string) (RespQueryOrder, error)
func (*Client) QueryRefund ¶
func (c *Client) QueryRefund(refundId string) (RespApplyRefund, error)
func (*Client) RefundNotifyResolve ¶
func (c *Client) RefundNotifyResolve(notify PayNotify) (RefundNotifyData, error)
type InitConfig ¶
type OrderNotifyData ¶
type OrderNotifyData struct {
AppID string `json:"appid"`
MchID string `json:"mchid"`
OutTradeNo string `json:"out_trade_no"`
TransactionId string `json:"transaction_id"`
TradeType string `json:"trade_type"`
TradeState string `json:"trade_state"`
BankType string `json:"bank_type"`
SuccessTime string `json:"success_time"`
Payer struct {
Openid string `json:"openid"`
} `json:"payer"`
Amount struct {
Total int64 `json:"total"`
PayerTotal int64 `json:"payer_total"`
Currency string `json:"currency"`
PayerCurrency string `json:"payer_currency"`
} `json:"amount"`
}
type PayNotify ¶
type PayNotify struct {
ID string `json:"id"`
CreateTime string `json:"create_time"`
ResourceType string `json:"resource_type"`
EventType string `json:"event_type"`
Resource struct {
Algorithm string `json:"algorithm"`
Ciphertext string `json:"ciphertext"`
Nonce string `json:"nonce"`
OriginalType string `json:"original_type"`
AssociatedData string `json:"associated_data"`
} `json:"resource"`
Summary string `json:"summary"`
}
type RefundNotifyData ¶
type RefundNotifyData struct {
MchID string `json:"mchid"`
TransactionId string `json:"transaction_id"`
OutTradeNo string `json:"out_trade_no"`
RefundID string `json:"refund_id"`
OutRefundNo string `json:"out_refund_no"`
RefundStatus string `json:"refund_status"`
SuccessTime string `json:"success_time"`
UserReceivedAccount string `json:"user_received_account"`
Amount struct {
Total int64 `json:"total"`
PayerTotal int64 `json:"payer_total"`
Refund int64 `json:"refund"`
PayerRefund int64 `json:"payer_refund"`
} `json:"amount"`
}
type RespApplyRefund ¶
type RespApplyRefund struct {
Amount struct {
Currency string `json:"currency"`
DiscountRefund int64 `json:"discount_refund"`
PayerRefund int64 `json:"payer_refund"`
PayerTotal int64 `json:"payer_total"`
Refund int64 `json:"refund"`
SettlementRefund int64 `json:"settlement_refund"`
SettlementTotal int64 `json:"settlement_total"`
Total int64 `json:"total"`
} `json:"amount"`
Channel string `json:"channel"`
CreateTime string `json:"create_time"`
FundsAccount string `json:"funds_account"`
OutRefundNo string `json:"out_refund_no"`
OutTradeNo string `json:"out_trade_no"`
RefundId string `json:"refund_id"`
Status string `json:"status"`
TransactionId string `json:"transaction_id"`
UserReceivedAccount string `json:"user_received_account"`
}
type RespCreateOrder ¶
type RespQueryOrder ¶
type RespQueryOrder struct {
OutTradeNo string `json:"out_trade_no"`
TransactionId string `json:"transaction_id"`
TradeType string `json:"trade_type"`
TradeStateDesc string `json:"trade_state_desc"`
TradeState string `json:"trade_state"`
SuccessTime string `json:"success_time"`
Payer struct {
Openid string `json:"openid"`
} `json:"payer"`
MchId string `json:"mchid"`
BankType string `json:"bank_type"`
AppId string `json:"appid"`
Attach string `json:"attach"`
Amount struct {
Currency string `json:"currency"`
PayerCurrency string `json:"payer_currency"`
PayerTotal int64 `json:"payer_total"`
Total int64 `json:"total"`
} `json:"amount"`
}
Click to show internal directories.
Click to hide internal directories.