models

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

View Source
const (
	CALLBACK_MSG_TYPE_EVENT    = "event"
	CALLBACK_MSG_TYPE_TEXT     = "text"
	CALLBACK_MSG_TYPE_IMAGE    = "image"
	CALLBACK_MSG_TYPE_VOICE    = "voice"
	CALLBACK_MSG_TYPE_VIDEO    = "video"
	CALLBACK_MSG_TYPE_LOCATION = "location"
	CALLBACK_MSG_TYPE_LINK     = "link"
)
View Source
const WX_TRADE_STATE_ = "JSAPI" //公众号支付
View Source
const WX_TRADE_STATE_APP = "APP" //APP支付
View Source
const WX_TRADE_STATE_CLOSED = "CLOSED" // 已关闭
View Source
const WX_TRADE_STATE_FACEPAY = "FACEPAY" //刷脸支付
View Source
const WX_TRADE_STATE_MICROPAY = "MICROPAY" //付款码支付
View Source
const WX_TRADE_STATE_MWEB = "MWEB" //H5支付
View Source
const WX_TRADE_STATE_NATIVE = "NATIVE" //扫码支付
View Source
const WX_TRADE_STATE_NOTPAY = "NOTPAY" // 未支付
View Source
const WX_TRADE_STATE_PAYERROR = "PAYERROR" // 支付失败(其他原因,如银行返回失败)
View Source
const WX_TRADE_STATE_REFUND = "REFUND" // 转入退款
View Source
const WX_TRADE_STATE_REVOKED = "REVOKED" // 已撤销(付款码支付)
View Source
const WX_TRADE_STATE_SUCCESS = "SUCCESS" // 支付成功
View Source
const WX_TRADE_STATE_USERPAYING = "USERPAYING" // 用户支付中(付款码支付)

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	// 订单总金额,单位为分
	Total int64 `json:"total"`
	// 退款标价金额,单位为分,可以做部分退款
	Refund int64 `json:"refund"`
	// 现金支付金额,单位为分,只能为整数
	PayerTotal int64 `json:"payer_total"`
	// 退款给用户的金额,不包含所有优惠券金额
	PayerRefund int64 `json:"payer_refund"`
}

Amount

type Callback

type Callback struct {
	XMLName    xml.Name `xml:"xml"`
	Text       string   `xml:",chardata"`
	ToUserName string   `xml:"ToUserName" json:"ToUserName"`
	AgentID    string   `xml:"AgentID" json:"AgentID"`
	Encrypt    string   `xml:"Encrypt" json:"Encrypt"`
}

type CallbackMessageHeader

type CallbackMessageHeader struct {
	contract.EventInterface
	XMLName      xml.Name `xml:"xml"`
	Text         string   `xml:",chardata"`
	ToUserName   string   `xml:"ToUserName"`
	FromUserName string   `xml:"FromUserName"`
	CreateTime   string   `xml:"CreateTime"`
	MsgType      string   `xml:"MsgType"`
	Event        string   `xml:"Event"`
	ChangeType   string   `xml:"ChangeType"`
	Content      []byte
}

func (CallbackMessageHeader) GetChangeType

func (header CallbackMessageHeader) GetChangeType() string

func (CallbackMessageHeader) GetContent

func (header CallbackMessageHeader) GetContent() []byte

func (CallbackMessageHeader) GetCreateTime

func (header CallbackMessageHeader) GetCreateTime() string

func (CallbackMessageHeader) GetEvent

func (header CallbackMessageHeader) GetEvent() string

func (CallbackMessageHeader) GetFromUserName

func (header CallbackMessageHeader) GetFromUserName() string

func (CallbackMessageHeader) GetMsgType

func (header CallbackMessageHeader) GetMsgType() string

func (CallbackMessageHeader) GetToUserName

func (header CallbackMessageHeader) GetToUserName() string

func (CallbackMessageHeader) ReadMessage

func (header CallbackMessageHeader) ReadMessage(msg interface{}) error

type Department

type Department struct {
	ID                int      `gorm:"column:id" json:"id"`
	Name              string   `gorm:"column:name" json:"name"`
	NameEN            string   `gorm:"column:name_en" json:"name_en"`
	DepartmentLeaders []string `gorm:"column:department_leader" json:"department_leader"`
	ParentID          int      `gorm:"column:parentid" json:"parentid"`
	Order             int      `gorm:"column:order" json:"order"`
}

type PromotionDetail

type PromotionDetail struct {
	// 券ID
	CouponID string `json:"coupon_id,omitempty"`
	// 优惠名称
	Name string `json:"name,omitempty"`
	// GLOBAL:全场代金券;SINGLE:单品优惠
	Scope string `json:"scope,omitempty"`
	// CASH:充值;NOCASH:预充值。
	Type string `json:"type,omitempty"`
	// 优惠券面额
	Amount int64 `json:"amount,omitempty"`
	// 活动ID,批次ID
	StockID string `json:"stock_id,omitempty"`
	// 单位为分
	WechatpayContribute int64 `json:"wechatpay_contribute,omitempty"`
	// 单位为分
	MerchantContribute int64 `json:"merchant_contribute,omitempty"`
	// 单位为分
	OtherContribute int64 `json:"other_contribute,omitempty"`
	// CNY:人民币,境内商户号仅支持人民币。
	Currency    string                 `json:"currency,omitempty"`
	GoodsDetail []PromotionGoodsDetail `json:"goods_detail,omitempty"`
}

PromotionDetail

type PromotionGoodsDetail

type PromotionGoodsDetail struct {
	// 商品编码
	GoodsID string `json:"goods_id"`
	// 商品数量
	Quantity int64 `json:"quantity"`
	// 商品价格
	UnitPrice int64 `json:"unit_price"`
	// 商品优惠金额
	DiscountAmount int64 `json:"discount_amount"`
	// 商品备注
	GoodsRemark string `json:"goods_remark,omitempty"`
}

PromotionGoodsDetail

type Refund

type Refund struct {
	//服务商户号
	SpMchid string `json:"sp_mchid,omitempty"`
	//子商户号
	SubMchid string `json:"sub_mchid,omitempty"`
	// 原支付交易对应的商户订单号
	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"`
	// 退款成功时间,退款状态status为SUCCESS(退款成功)时,返回该字段。遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
	SuccessTime *time.Time `json:"success_time,omitempty"`
	// 取当前退款单的退款入账方,有以下几种情况: 1)退回银行卡:{银行名称}{卡类型}{卡尾号} 2)退回支付用户零钱:支付用户零钱 3)退还商户:商户基本账户商户结算银行账户 4)退回支付用户零钱通:支付用户零钱通
	UserReceivedAccount string `json:"user_received_account"`
	// 金额详细信息
	Amount *Amount `json:"amount"`
}

--- Refund models ---- Refund

type Tag

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

type Transaction

type Transaction struct {
	Amount          *TransactionAmount    `json:"amount,omitempty"`
	AppID           string                `json:"appid,omitempty"`
	SpAppid         string                `json:"sp_appid,omitempty"`
	SpMchid         string                `json:"sp_mchid,omitempty"`
	SubAppid        string                `json:"sub_appid,omitempty"`
	SubMchid        string                `json:"sub_mchid,omitempty"`
	Attach          string                `json:"attach,omitempty"`
	BankType        string                `json:"bank_type,omitempty"`
	MchID           string                `json:"mchid,omitempty"`
	OutTradeNo      string                `json:"out_trade_no,omitempty"`
	Payer           *TransactionPayer     `json:"payer,omitempty"`
	PromotionDetail []PromotionDetail     `json:"promotion_detail,omitempty"`
	SuccessTime     string                `json:"success_time,omitempty"`
	TradeState      string                `json:"trade_state,omitempty"`
	TradeStateDesc  string                `json:"trade_state_desc,omitempty"`
	TradeType       string                `json:"trade_type,omitempty"`
	TransactionID   string                `json:"transaction_id,omitempty"`
	SceneInfo       *TransactionSceneInfo `json:"scene_info,omitempty"`
}

Transaction

type TransactionAmount

type TransactionAmount struct {
	Currency      string `json:"currency,omitempty"`
	PayerCurrency string `json:"payer_currency,omitempty"`
	PayerTotal    int64  `json:"payer_total,omitempty"`
	Total         int64  `json:"total,omitempty"`
}

TransactionAmount

type TransactionPayer

type TransactionPayer struct {
	OpenID    string `json:"openid,omitempty"`
	SubOpenid string `json:"sub_openid,omitempty"`
	SpOpenid  string `json:"sp_openid,omitempty"`
}

TransactionPayer

type TransactionSceneInfo added in v3.1.1

type TransactionSceneInfo struct {
	DeviceId string `json:"device_id,omitempty"`
}

TransactionSceneInfo

Jump to

Keyboard shortcuts

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