jsapi

package
v0.0.0-...-2b36f50 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrder

func CreateOrder(c *pay.Client, ctx context.Context, req JspCreateOrderReq) (response *jsapi.PrepayWithRequestPaymentResponse, err error)

CreateOrder 创建订单

func Refund

func Refund(c *pay.Client, ctx context.Context, req RefundReq) (resp *refunddomestic.Refund, result *core.APIResult, err error)

Types

type JspCreateOrderReq

type JspCreateOrderReq struct {
	OutTradeNo string
	Attach     string
	OpenID     string
	Desc       string
	Amount     int64
}

type PayResult

type PayResult struct {
	Mchid          string    `json:"mchid"`
	Appid          string    `json:"appid"`
	OutTradeNo     string    `json:"out_trade_no"`
	TransactionID  string    `json:"transaction_id"` // 微信交易编号
	TradeType      string    `json:"trade_type"`
	TradeState     string    `json:"trade_state"`
	TradeStateDesc string    `json:"trade_state_desc"`
	BankType       string    `json:"bank_type"`
	Attach         string    `json:"attach"`
	SuccessTime    time.Time `json:"success_time"`
	Payer          struct {
		Openid string `json:"openid"`
	} `json:"payer"`
	Amount struct {
		Total         int    `json:"total"`
		PayerTotal    int    `json:"payer_total"`
		Currency      string `json:"currency"`
		PayerCurrency string `json:"payer_currency"`
	} `json:"amount"`
}

func (PayResult) Json

func (r PayResult) Json() ([]byte, error)

type RefundReq

type RefundReq struct {
	TransactionID string
	OrderCode     string
	OutRefundCode string
	Reason        string
	Amount        int64
}

Jump to

Keyboard shortcuts

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