wechat

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultSuccess = "SUCCESS"
	ResultFail    = "FAIL"
)
View Source
const (
	NotifyEndpoint = "/v1/payment-wechat"
)
View Source
const (
	TradeTypeMiniProgram = "JSAPI"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PayloadBase

type PayloadBase struct {
	XMLName xml.Name `xml:"xml"`
}

type PaymentProvider

type PaymentProvider struct {
	base.BasePaymentProvider
	// contains filtered or unexported fields
}

func (*PaymentProvider) Close

func (s *PaymentProvider) Close(payment *base.Payment) error

关闭订单

func (*PaymentProvider) CreatePayment

func (s *PaymentProvider) CreatePayment(payment *base.Payment) (*base.CreatePaymentResp, error)

func (*PaymentProvider) GetNotifyController

func (s *PaymentProvider) GetNotifyController() *base.PaymentNotifyController

func (*PaymentProvider) GetPayment

func (s *PaymentProvider) GetPayment(query *base.PaymentQuery) (*base.PaymentNotify, error)

func (*PaymentProvider) Init

func (s *PaymentProvider) Init(paymentUrl string, endpoint *base.PaymentEndpoint) error

func (*PaymentProvider) QueryRefund

func (s *PaymentProvider) QueryRefund(query *base.QueryRefund) (*base.QueryRefundResp, error)

退款查询

func (*PaymentProvider) QueryTransfer

func (s *PaymentProvider) QueryTransfer(query *base.QueryTransfer) (*base.QueryTransferResp, error)

func (*PaymentProvider) Refund

func (s *PaymentProvider) Refund(payment *base.Payment) error

退款

func (*PaymentProvider) Transfer

func (s *PaymentProvider) Transfer(transfer *base.PaymentTransfer) error

type ReqClosePayment

type ReqClosePayment struct {
	PayloadBase

	AppKey   string `xml:"appid" json:"appid"`
	MchKey   string `xml:"mch_id" json:"mch_id"`
	NonceStr string `xml:"nonce_str" json:"nonce_str"`
	Sign     string `xml:"sign" json:"sign"`
	TradeNo  string `xml:"out_trade_no" json:"out_trade_no"`
}

func (*ReqClosePayment) FromPayment

func (s *ReqClosePayment) FromPayment(payment *base.Payment)

func (*ReqClosePayment) GenerateSign

func (s *ReqClosePayment) GenerateSign(secret string)

type ReqNotify

type ReqNotify struct {
	PayloadBase
	RespReturn
	ResultCode string `xml:"result_code"`
	TradeNo    string `xml:"out_trade_no"`
	TradeState string `xml:"trade_state"`
}

func (*ReqNotify) ToPaymentNotify

func (s *ReqNotify) ToPaymentNotify() *base.PaymentNotify

type ReqOrder

type ReqOrder struct {
	PayloadBase

	AppKey         string `xml:"appid" json:"appid"`
	MchKey         string `xml:"mch_id" json:"mch_id"`
	NonceStr       string `xml:"nonce_str" json:"nonce_str"`
	Sign           string `xml:"sign" json:"sign"`
	Boby           string `xml:"body" json:"body"`
	TradeNo        string `xml:"out_trade_no" json:"out_trade_no"`
	TotalFee       int    `xml:"total_fee" json:"total_fee"`
	SpbillCreateIP string `xml:"spbill_create_ip" json:"spbill_create_ip"`
	NotifyUrl      string `xml:"notify_url" json:"notify_url"`
	TradeType      string `xml:"trade_type" json:"trade_type"`
	OpenID         string `xml:"openid" json:"openid"`
}

func (*ReqOrder) FromPayment

func (s *ReqOrder) FromPayment(payment *base.Payment)

func (*ReqOrder) GenerateSign

func (s *ReqOrder) GenerateSign(secret string)

type ReqOrderQuery

type ReqOrderQuery struct {
	PayloadBase

	AppKey   string `xml:"appid" json:"appid"`
	MchKey   string `xml:"mch_id" json:"mch_id"`
	TradeNo  string `xml:"out_trade_no" json:"out_trade_no"`
	NonceStr string `xml:"nonce_str" json:"nonce_str"`
	Sign     string `xml:"sign" json:"sign"`
}

func (*ReqOrderQuery) GenerateSign

func (s *ReqOrderQuery) GenerateSign(secret string)

type ReqQueryRefund

type ReqQueryRefund struct {
	PayloadBase

	AppKey   string `xml:"appid" json:"appid"`
	MchKey   string `xml:"mch_id" json:"mch_id"`
	NonceStr string `xml:"nonce_str" json:"nonce_str"`
	Sign     string `xml:"sign" json:"sign"`
	TradeNo  string `xml:"out_trade_no" json:"out_trade_no"`
}

func (*ReqQueryRefund) FromQueryRefund

func (s *ReqQueryRefund) FromQueryRefund(query *base.QueryRefund)

func (*ReqQueryRefund) GenerateSign

func (s *ReqQueryRefund) GenerateSign(secret string)

type ReqRefund

type ReqRefund struct {
	PayloadBase

	AppKey    string `xml:"appid" json:"appid"`
	MchKey    string `xml:"mch_id" json:"mch_id"`
	NonceStr  string `xml:"nonce_str" json:"nonce_str"`
	Sign      string `xml:"sign" json:"sign"`
	TradeNo   string `xml:"out_trade_no" json:"out_trade_no"`
	RefundNo  string `xml:"out_refund_no" json:"out_refund_no"`
	TotalFee  int    `xml:"total_fee" json:"total_fee"`
	RefundFee int    `xml:"refund_fee" json:"refund_fee"`
}

func (*ReqRefund) FromPayment

func (s *ReqRefund) FromPayment(payment *base.Payment)

func (*ReqRefund) GenerateSign

func (s *ReqRefund) GenerateSign(secret string)

type ReqTransfer

type ReqTransfer struct {
	PayloadBase

	AppKey   string `xml:"mch_appid" json:"mch_appid"`
	MchKey   string `xml:"mchid" json:"mchid"`
	NonceStr string `xml:"nonce_str" json:"nonce_str"`
	Sign     string `xml:"sign" json:"sign"`
	TradeNo  string `xml:"partner_trade_no" json:"partner_trade_no"`

	OpenID    string `xml:"openid" json:"openid"`
	CheckName string `xml:"check_name" json:"check_name"`
	TotalFee  int    `xml:"amount" json:"amount"`
	Desc      string `xml:"desc" json:"desc"`
}

func (*ReqTransfer) FromPaymentTransfer

func (s *ReqTransfer) FromPaymentTransfer(transfer *base.PaymentTransfer)

func (*ReqTransfer) GenerateSign

func (s *ReqTransfer) GenerateSign(secret string)

type ReqTransferQuery

type ReqTransferQuery struct {
	PayloadBase

	AppKey   string `xml:"appid" json:"appid"`
	MchKey   string `xml:"mch_id" json:"mch_id"`
	NonceStr string `xml:"nonce_str" json:"nonce_str"`
	Sign     string `xml:"sign" json:"sign"`
	TradeNo  string `xml:"partner_trade_no" json:"partner_trade_no"`
}

func (*ReqTransferQuery) FromTransferQuery

func (s *ReqTransferQuery) FromTransferQuery(transfer *base.QueryTransfer)

func (*ReqTransferQuery) GenerateSign

func (s *ReqTransferQuery) GenerateSign(secret string)

type RespClosePayment

type RespClosePayment struct {
	PayloadBase

	RespReturn
	RespErr

	ResultCode string `xml:"result_code"`
}

type RespErr

type RespErr struct {
	ErrCode     string `xml:"err_code" json:"err_code"`
	ErrCodeDesc string `xml:"err_code_des" json:"err_code_des"`
}

type RespNotify

type RespNotify struct {
	PayloadBase
	RespReturn
}

type RespQueryRefund

type RespQueryRefund struct {
	PayloadBase

	RespReturn
	RespErr

	ResultCode string `xml:"result_code"`
	TradeNo    string `xml:"out_trade_no" json:"out_trade_no"`

	Status string `xml:"refund_status_0"`
}

func (*RespQueryRefund) ToQueryRefundResp

func (s *RespQueryRefund) ToQueryRefundResp() *base.QueryRefundResp

type RespQueryTransfer

type RespQueryTransfer struct {
	PayloadBase

	RespReturn
	RespErr

	ResultCode string `xml:"result_code"`
	Status     string `xml:"status"`
	Reason     string `xml:"reason"`
}

func (*RespQueryTransfer) ToQueryTransferResp

func (s *RespQueryTransfer) ToQueryTransferResp() *base.QueryTransferResp

type RespRefund

type RespRefund struct {
	PayloadBase

	RespReturn
	RespErr

	ResultCode string `xml:"result_code"`
	TradeNo    string `xml:"out_trade_no" json:"out_trade_no"`
}

type RespReturn

type RespReturn struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
}

type RespTransfer

type RespTransfer struct {
	PayloadBase

	RespReturn
	RespErr

	ResultCode string `xml:"result_code"`
	TradeNo    string `xml:"partner_trade_no"`
	PaymentNo  string `xml:"payment_no"`
}

type ResqOrder

type ResqOrder struct {
	PayloadBase
	RespReturn
	RespErr
	ResultCode string `xml:"result_code"`
	PrepayID   string `xml:"prepay_id"`
}

Jump to

Keyboard shortcuts

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