v3wechat

package
v0.6.25 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const PC_BLACK = "BLACK"
View Source
const PC_BLUE = "BLUE"

plate color车牌颜色,枚举值: BLUE:蓝色 GREEN:绿色 YELLOW:黄色 BLACK:黑色 WHITE:白色 LIMEGREEN:黄绿色

View Source
const PC_GREEN = "GREEN"
View Source
const PC_LIMEGREEN = "LIMEGREEN"
View Source
const PC_WHITE = "WHITE"
View Source
const PC_YELLOW = "YELLOW"
View Source
const TS_ACCEPTED = "ACCEPTED"
View Source
const TS_PAY_FAIL = "PAY_FAIL"
View Source
const TS_REFUND = "REFUND"
View Source
const TS_SUCCESS = "SUCCESS"

trade state 枚举值: SUCCESS:支付成功 ACCEPTED:已接收,等待扣款 PAY_FAIL:支付失败(其他原因,如银行返回失败) REFUND:转入退款

View Source
const UR_N = "N"
View Source
const UR_Y = "Y"

user_repaid 枚举值: Y:用户已还款 N:用户未还款

View Source
const VS_BLOCKED = "BLOCKED"
View Source
const VS_NORMAL = "NORMAL"

state enum

Variables

This section is empty.

Functions

func GetRandomString

func GetRandomString(length int) string

func PrivateKeySignSHA256

func PrivateKeySignSHA256(signData string, key string) (sign string, err error)

func RsaVerySignWithSHA256Base64

func RsaVerySignWithSHA256Base64(originalData, signData string, key string) (err error)

func SHA256BAS64

func SHA256BAS64(signstr string, key *rsa.PrivateKey) (string, error)

func Sign

func Sign(method string, url string, timestamp string, nonce string, body []byte, key string) (sign string, err error)

func Struct2mapJson added in v0.6.25

func Struct2mapJson(v interface{}) map[string]string

func VerifySign

func VerifySign(body, timestamp, nonceStr, sign, publicKey string) (err error)

Types

type Client

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

func NewClient

func NewClient(mchId string, options ...Option) *Client

func (*Client) PayJsapi added in v0.6.25

func (c *Client) PayJsapi(req *PayJsapiReq) (rsp *PayJsapiRsp, err error)

func (*Client) PayJsapiOutTradeNoQuery added in v0.6.25

func (c *Client) PayJsapiOutTradeNoQuery(outTradeNo string) (rsp *PayJsapiOutTradeNoRsp, err error)

func (*Client) QueryUserCoupon

func (c *Client) QueryUserCoupon(openid string, couponId string, appid string) (rsp *QueryUserCouponRsp, err error)

func (*Client) QueryUserCoupons added in v0.6.25

func (c *Client) QueryUserCoupons(openid string, req *QueryUserCouponsReq) (rsp *QueryUserCouponsRsp, err error)

func (*Client) SendCouponStock

func (c *Client) SendCouponStock(openid string, req *SendCouponStockReq) (rsp *SendCouponStockRsp, err error)

func (*Client) VehicleParkingParkings added in v0.6.25

func (c *Client) VehicleParkingParkings(req *VehicleParkingParkingsReq) (rsp *VehicleParkingParkingsRsp, err error)

创建停车入场

func (*Client) VehicleParkingServicesFind added in v0.6.25

func (c *Client) VehicleParkingServicesFind(req *VehicleParkingServiceFindReq) (rsp *VehicleParkingServiceFindRsp, err error)

查询车牌服务开通信息

func (*Client) VehicleTransactionParking added in v0.6.25

func (c *Client) VehicleTransactionParking(req *VehicleTransactionsParkingReq) (rsp *VehicleTransactionsParkingRsp, err error)

扣费受理

func (*Client) VehicleTransactionsOutTradeNo added in v0.6.25

func (c *Client) VehicleTransactionsOutTradeNo(outTradeNo string, subMchId string) (rsp *VehicleTransactionsParkingRsp, err error)

查询订单

type MchInfo

type MchInfo struct {
	MchId      string
	PublicKey  string
	PrivateKey string
	SerialNo   string
}

type Option

type Option func(c *Client)

func GetMchInfoOptions

func GetMchInfoOptions(f func(c *Client) *MchInfo) Option

type PayJsapiAmountInfo added in v0.6.25

type PayJsapiAmountInfo struct {
	Total    int    `json:"total"`
	Currency string `json:"currency,omitempty"`
}

type PayJsapiOutTradeNoRsp added in v0.6.25

type PayJsapiOutTradeNoRsp struct {
	Appid          string            `json:"appid"`
	Mchid          string            `json:"mchid"`
	OutTradeNo     string            `json:"out_trade_no"`
	TransactionId  string            `json:"transaction_id,omitempty"`
	TradeType      string            `json:"trade_type,omitempty"`
	TradeState     string            `json:"trade_state"`
	TradeStateDesc string            `json:"trade_state_desc"`
	BankType       string            `json:"bank_type,omitempty"`
	Attach         string            `json:"attach,omitempty"`
	SuccessTime    string            `json:"success_time,omitempty"`
	Payer          PayJsapiPayerInfo `json:"payer"`
}

type PayJsapiPayerInfo added in v0.6.25

type PayJsapiPayerInfo struct {
	Openid string `json:"openid"`
}

type PayJsapiReq added in v0.6.25

type PayJsapiReq struct {
	Appid       string             `json:"appid"`
	Mchid       string             `json:"mchid"`
	Description string             `json:"description"`
	OutTradeNo  string             `json:"out_trade_no"`
	TimeExpire  string             `json:"time_expire,omitempty"`
	Attach      string             `json:"attach,omitempty"`
	NotifyUrl   string             `json:"notify_url"`
	GoodsTag    string             `json:"goods_tag,omitempty"`
	Amount      PayJsapiAmountInfo `json:"amount"`
	Payer       PayJsapiPayerInfo  `json:"payer"`
}

type PayJsapiRsp added in v0.6.25

type PayJsapiRsp struct {
	PrepayId string `json:"prepay_id"`
}

type QueryUserCouponConsumeInformation

type QueryUserCouponConsumeInformation struct {
	ConsumeTime   string `json:"consume_time"`
	ConsumeMchid  string `json:"consume_mchid"`
	TransactionId string `json:"transaction_id"`
}

type QueryUserCouponCutToMessage

type QueryUserCouponCutToMessage struct {
	SinglePriceMax int64 `json:"single_price_max"`
	CutToPrice     int64 `json:"cut_to_price"`
}

type QueryUserCouponGoodsDetail

type QueryUserCouponGoodsDetail struct {
	GoodsId        string `json:"goods_id"`
	Quantity       uint32 `json:"quantity"`
	Price          uint64 `json:"price"`
	DiscountAmount uint64 `json:"discount_amount"`
}

type QueryUserCouponNormalCouponInformation

type QueryUserCouponNormalCouponInformation struct {
	CouponAmount       uint64 `json:"coupon_amount"`
	TransactionMinimum uint64 `json:"transaction_minimum"`
}

type QueryUserCouponReq

type QueryUserCouponReq struct {
}

type QueryUserCouponRsp

type QueryUserCouponRsp struct {
	StockCreateMchId        string                                 `json:"stock_creator_mchid"`
	StockId                 string                                 `json:"stock_id"`
	CouponId                string                                 `json:"coupon_id"`
	CutToMessage            QueryUserCouponCutToMessage            `json:"cut_to_message"`
	CouponName              string                                 `json:"coupon_name"`
	Status                  string                                 `json:"status"`
	Description             string                                 `json:"description"`
	CreateTime              string                                 `json:"create_time"`
	CouponType              string                                 `json:"coupon_type"`
	NoCash                  bool                                   `json:"no_cash"`
	AvailableBeginTime      string                                 `json:"available_begin_time"`
	AvailableEndTime        string                                 `json:"available_end_time"`
	Singleitem              bool                                   `json:"singleitem"`
	NormalCouponInformation QueryUserCouponNormalCouponInformation `json:"normal_coupon_information"`
	ConsumeInformation      QueryUserCouponConsumeInformation      `json:"consume_information"`
	GoodsDetail             QueryUserCouponGoodsDetail             `json:"goods_detail"`
}

type QueryUserCouponsReq added in v0.6.25

type QueryUserCouponsReq struct {
	Appid          string `json:"appid"`
	StockId        string `json:"stock_id,omitempty"`
	Status         string `json:"status,omitempty"`
	CreatorMchId   string `json:"creator_mchid,omitempty"`
	SenderMchId    string `json:"sender_mchid,omitempty"`
	AvailableMchId string `json:"available_mchid,omitempty"`
	Offset         uint32 `json:"offset,omitempty"`
	Limit          uint32 `json:"limit,omitempty"`
}

type QueryUserCouponsRsp added in v0.6.25

type QueryUserCouponsRsp struct {
	Data       []QueryUserCouponRsp `json:"data"`
	TotalCount uint32               `json:"total_count"`
	Limit      uint32               `json:"limit"`
	Offset     uint32               `json:"offset"`
}

type RequestErr

type RequestErr struct {
	Code    string      `json:"code"`
	Message string      `json:"message"`
	Field   string      `json:"field"`
	Value   string      `json:"value"`
	Issue   string      `json:"issue"`
	Detail  interface{} `json:"detail"`
	ReqText string      `json:"req_text"`
}

func (*RequestErr) Error

func (e *RequestErr) Error() string

type SendCouponStockReq

type SendCouponStockReq struct {
	Appid             string `json:"appid"`
	CouponMinimum     uint64 `json:"coupon_minimum,omitempty"`
	CouponValue       uint64 `json:"coupon_value,omitempty"`
	OutRequestNo      string `json:"out_request_no"`
	StockCreatorMchid string `json:"stock_creator_mchid"`
	StockId           string `json:"stock_id"`
}

type SendCouponStockRsp

type SendCouponStockRsp struct {
	CouponId string `json:"coupon_id"`
}

type VehicleParkingParkingsReq added in v0.6.25

type VehicleParkingParkingsReq struct {
	SubMchId     string `json:"sub_mchid"`
	OutParkingNo string `json:"out_parking_no"`
	PlateNumber  string `json:"plate_number"`
	PlateColor   string `json:"plate_color"`
	NotifyUrl    string `json:"notify_url"`
	StartTime    string `json:"start_time"`
	ParkingName  string `json:"parking_name"`
	FreeDuration int    `json:"free_duration"`
}

type VehicleParkingParkingsRsp added in v0.6.25

type VehicleParkingParkingsRsp struct {
	Id           string `json:"id"`
	OutParkingNo string `json:"out_parking_no"`
	PlateNumber  string `json:"plate_number"`
	PlateColor   string `json:"plate_color"`
	StartTime    string `json:"start_time"`
	ParkingName  string `json:"parking_name"`
	FreeDuration int    `json:"free_duration"`
	State        string `json:"state"`
	BlockReason  string `json:"block_reason"`
}

type VehicleParkingServiceFindReq added in v0.6.25

type VehicleParkingServiceFindReq struct {
	Appid       string `json:"appid"`
	SubMchId    string `json:"sub_mchid"`
	PlateNumber string `json:"plate_number"`
	PlateColor  string `json:"plate_color"`
	Openid      string `json:"openid"`
}

type VehicleParkingServiceFindRsp added in v0.6.25

type VehicleParkingServiceFindRsp struct {
	PlatformNumber  string `json:"platform_number"`
	PlatformColor   string `json:"platform_color"`
	ServiceOpenTime string `json:"service_open_time"`
	Openid          string `json:"openid"`
	ServiceState    string `json:"service_state"`
}

type VehicleTransactionParkingPayer added in v0.6.25

type VehicleTransactionParkingPayer struct {
	Openid    string `json:"openid"`
	SubOpenid string `json:"sub_openid"`
}

type VehicleTransactionsParkingAmount added in v0.6.25

type VehicleTransactionsParkingAmount struct {
	Total         int    `json:"total"`
	Currency      string `json:"currency"`
	PayerTotal    int    `json:"payer_total,omitempty"`
	DiscountTotal int    `json:"discount_total,omitempty"`
}

type VehicleTransactionsParkingInfo added in v0.6.25

type VehicleTransactionsParkingInfo struct {
	ParkingId        string `json:"parking_id"`
	PlateNumber      string `json:"plate_number"`
	PlateColor       string `json:"plate_color"`
	StartTime        string `json:"start_time"`
	EndTime          string `json:"end_time"`
	ParkingName      string `json:"parking_name"`
	ChargingDuration int    `json:"charging_duration"`
	DeviceId         string `json:"device_id"`
}

type VehicleTransactionsParkingPromotionDetail added in v0.6.25

type VehicleTransactionsParkingPromotionDetail struct {
	CouponId            string `json:"coupon_id"`
	Name                string `json:"name"`
	Scope               string `json:"scope"`
	Type                string `json:"type"`
	StockId             string `json:"stock_id"`
	Amount              int    `json:"amount"`
	WeChatPayContribute int    `json:"wechatpay_contribute"`
	MerchantContribute  int    `json:"merchant_contribute"`
	OtherContribute     int    `json:"other_contribute"`
	Currency            string `json:"currency"`
}

type VehicleTransactionsParkingReq added in v0.6.25

type VehicleTransactionsParkingReq struct {
	Appid         string                           `json:"appid"`
	SubAppid      string                           `json:"sub_appid"`
	SubMchId      string                           `json:"sub_mchid"`
	Description   string                           `json:"description"`
	Attach        string                           `json:"attach"`
	OutTradeNo    string                           `json:"out_trade_no"`
	TradeScene    string                           `json:"trade_scene"`
	GoodsTag      string                           `json:"goods_tag"`
	NotifyUrl     string                           `json:"notify_url"`
	ProfitSharing string                           `json:"profit_sharing"`
	Amount        VehicleTransactionsParkingAmount `json:"amount"`
	ParkingInfo   VehicleTransactionsParkingInfo   `json:"parking_info"`
}

type VehicleTransactionsParkingRsp added in v0.6.25

type VehicleTransactionsParkingRsp struct {
	Appid                 string                                    `json:"appid"`
	SubAppid              string                                    `json:"sub_appid"`
	SubMchId              string                                    `json:"sub_mchid"`
	SpMchId               string                                    `json:"sp_mchid"`
	Description           string                                    `json:"description"`
	CreateTime            string                                    `json:"create_time"`
	OutTradeNo            string                                    `json:"out_trade_no"`
	TradeState            string                                    `json:"trade_state"`
	TradeStateDescription string                                    `json:"trade_state_description"`
	SuccessTime           string                                    `json:"success_time"`
	BankType              string                                    `json:"bank_type"`
	UserRepaid            string                                    `json:"user_repaid"`
	Attach                string                                    `json:"attach"`
	TradeScene            string                                    `json:"trade_scene"`
	ParkingInfo           VehicleTransactionsParkingInfo            `json:"parking_info"`
	Payer                 VehicleTransactionParkingPayer            `json:"payer"`
	Amount                VehicleTransactionsParkingAmount          `json:"amount"`
	PromotionDetail       VehicleTransactionsParkingPromotionDetail `json:"promotion_detail"`
}

Jump to

Keyboard shortcuts

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