ynrcc

package module
v0.0.0-...-7dc715c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceCloseOrder         = "CloseOrder"
	ServiceQueryTrxState      = "QueryTrxState"
	ServiceMPCreateTrade      = "MPCreateTrade"
	ServicePayResultMerNotify = "PayResultMerNotify"
)
View Source
const (
	ReturnCodeSuccess     = "000000"
	ReturnCodeInvalidSign = "100036"
)

Variables

View Source
var ErrInvalidSign = errors.New("invalid sign")

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options Options) (client *Client, err error)

func (*Client) Execute

func (c *Client) Execute(req, res any) (err error)

func (*Client) MerID

func (c *Client) MerID() string

func (*Client) ReadNotify

func (c *Client) ReadNotify(httpReq *http.Request) (req *PayResultMerNotifyRequest, err error)

func (*Client) TemID

func (c *Client) TemID() string

type CloseOrderRequest

type CloseOrderRequest struct {
	RequestCommon
	TradeNo       string `json:"tradeNo"`
	OriginTradeNo string `json:"originTradeNo"`
	OrderID       string `json:"orderId"`
	NotifyURL     string `json:"notifyUrl"`
}

type CloseOrderResponse

type CloseOrderResponse struct {
	ResponseCommon
	State string `json:"state"`
}

type MPCreateTradeRequest

type MPCreateTradeRequest struct {
	RequestCommon
	TradeNo      string `json:"tradeNo"`
	TradeChannel string `json:"tradeChannel"`
	BusinessType string `json:"businessType"`
	TotalAmt     string `json:"totalAmt"`
	TotalNum     string `json:"totalNum"`
	OrderDesc    string `json:"orderDesc"`
	OnlineFlag   string `json:"onlineFlag"`
	EventFlag    string `json:"eventFlag"`
	Ccy          string `json:"ccy"`
	SubOpenID    string `json:"subOpenId"`
	SubAppID     string `json:"subAppId"`
	NotifyURL    string `json:"notifyUrl"`
}

type MPCreateTradeResponse

type MPCreateTradeResponse struct {
	ResponseCommon
	TradeNo   string `json:"tradeNo"`
	State     string `json:"state"`
	OrderID   string `json:"orderId"`
	TradeTime string `json:"tradeTime"`
	WxPayData struct {
		TimeStamp string `json:"timeStamp"`
		Package   string `json:"package"`
		PaySign   string `json:"paySign"`
		AppID     string `json:"appId"`
		SignType  string `json:"signType"`
		NonceStr  string `json:"nonceStr"`
	} `json:"wxPayData"`
}

type Options

type Options struct {
	GatewayURL string
	Cert       string
	PriKey     string
	BankPubKey string
	MerID      string
	TemID      string
}

type PayResultMerNotifyRequest

type PayResultMerNotifyRequest struct {
	RequestCommon
	Code        string `json:"code"`
	Msg         string `json:"msg"`
	TradeNo     string `json:"tradeNo"`
	State       string `json:"state"`
	OrderID     string `json:"orderId"`
	TradeTime   string `json:"tradeTime"`
	TotalAmt    string `json:"totalAmt"`
	PaidAmt     string `json:"paidAmt"`
	DiscountAmt int    `json:"discountAmt"`
}

type PayResultMerNotifyResponse

type PayResultMerNotifyResponse struct {
	ResponseCommon
}

type QueryTrxStateRequest

type QueryTrxStateRequest struct {
	RequestCommon
	TradeNo string `json:"tradeNo"`
}

type QueryTrxStateResponse

type QueryTrxStateResponse struct {
	ResponseCommon
	TradeNo      string `json:"tradeNo"`
	State        string `json:"state"`
	OrderID      string `json:"orderId"`
	BuyerAnonyID string `json:"buyerAnonyId"`
	TotalAmt     string `json:"totalAmt"`
	PaidAmt      string `json:"paidAmt"`
	DiscountAmt  string `json:"discountAmt"`
	PayTime      string `json:"payTime"`
}

type RequestCommon

type RequestCommon struct {
	Service  string `json:"service"`
	TranCode string `json:"tranCode,omitempty"`
	SeqNo    string `json:"seqNo"`
	TxnTime  string `json:"txnTime"`
	MerID    string `json:"merId"`
	TemID    string `json:"temId"`
}

type ResponseCommon

type ResponseCommon struct {
	Code    string `json:"code"`
	Msg     string `json:"msg"`
	SubCode string `json:"subCode"`
	SubMsg  string `json:"subMsg"`
}

func (ResponseCommon) Err

func (r ResponseCommon) Err() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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