charge

package
v0.0.0-...-3b7ab86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	B   xftpay.Backend
	Key string
}

func (Client) Pay

func (c Client) Pay(r *PayRequest) (s *PayResponse, err error)

type PayRequest

type PayRequest struct {
	AppID        string `json:"app_id"`
	MerchantCode string `json:"merchant_code"`
	StoreCode    string `json:"store_code"`
	LimitPay     string `json:"limit_pay"`
	OutTradeNo   string `json:"out_trade_no"`
	Channel      string `json:"channle"`
	Product      string `json:"product"`
	ClientIP     string `json:"client_ip"`
	Amount       string `json:"amount"`
	Subject      string `json:"subject"`
	Body         string `json:"body"`
	Descryption  string `json:"description"`
	Extra        string `json:"extra"`
	NotifyURL    string `json:"notify_url"`
	TimeStart    string `json:"time_start"`
	TimeExpire   string `json:"time_expire"`
	SignType     string `json:"sign_type"`
	Sign         string `json:"sign"`
}

type PayResponse

type PayResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Result  bool   `json:"result"`
	Data    struct {
		ID           string `json:"id"`
		OutTradeNo   string `json:"out_trade_no"`
		State        string `json:"state"`
		Credential   string `json:"credential"`
		ThirdTradeNo string `json:"third_trade_no"`
		FailureCode  string `json:"failure_code"`
		FailureMsg   string `json:"failure_msg"`
		SignType     string `json:"sign_type"`
		Sgin         string `json:"sign"`
	} `json:"data"`
}

func Pay

func Pay(r *PayRequest) (s *PayResponse, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL