wechat

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Access_token string
	Expires_in   int64
	Update       int64
}

type PushInfo

type PushInfo struct {
	AppId                 string `xml:AppId`
	CreateTime            int64  `xml:CreateTime`
	InfoType              string `xml:InfoType`
	ComponentVerifyTicket string `xml:ComponentVerifyTicket`
}

type Ticket

type Ticket struct {
	Ticket     string
	Expires_in int64
	Update     int64
}

type TokenXML

type TokenXML struct {
	AppId   string `xml:AppId`
	Encrypt string `xml:Encrypt`
}

type WXDetail

type WXDetail struct {
	Goods_detail []WXGoodsDetail `json:"goods_detail"`
}

type WXGoodsDetail

type WXGoodsDetail struct {
	Goods_id   string `json:"goods_id"`
	Goods_name string `json:"goods_name"`
	Quantity   string `json:"quantity"`
	Price      string `json:"price"`
}

type WxOrderResult

type WxOrderResult struct {
	Return_code  string `xml:"return_code"`
	Return_msg   string `xml:"return_msg"`
	Appid        string `xml:"appid"`
	Mch_id       string `xml:"mch_id"`
	Nonce_str    string `xml:"nonce_str"`
	Sign         string `xml:"sign"`
	Result_code  string `xml:"result_code"`
	Prepay_id    string `xml:"prepay_id"`
	Trade_type   string `xml:"trade_type"`
	Err_code_des string `xml:"err_code_des"`
}

type WxService

type WxService struct {
	dao.BaseDao
	//Admin service.AdminService
	//Goods goods.GoodsService
	User user.UserService
	//Orders       order.OrdersService
	Organization company.OrganizationService
}

func (WxService) ChangeWxConfig

func (entity WxService) ChangeWxConfig(DB *gorm.DB, ID uint64, Value dao.WxConfig) error
	if item.ID == 0 {
		err = DB.Create(item).Error
		glog.Error(err)
		return item
	} else {
		return item
	}
}

func (WxService) CloseOrder

func (entity WxService) CloseOrder(OrderNo string, OID uint64) (Success bool, Message string)

关闭订单

func (WxService) Decrypt

func (entity WxService) Decrypt(encryptedData, session_key, iv_text string) (bool, string)

func (WxService) GetAccessToken

func (entity WxService) GetAccessToken(WxConfig dao.WxConfig) string

func (WxService) GetTransfersInfo

func (entity WxService) GetTransfersInfo(transfers dao.Transfers) (Success bool)

查询提现接口

func (WxService) GetWXAConfig

func (entity WxService) GetWXAConfig(prepay_id string, WxConfig dao.WxConfig) (outData map[string]string)

func (WxService) INComeNotify

func (entity WxService) INComeNotify(slUser dao.User, itemName string, timeText string, typeText string) *result.ActionResult

收入提醒

@slUser 收入的用户

func (WxService) MPOrder

func (entity WxService) MPOrder(OrderNo string, title, description string, ogs []dao.OrdersGoods, openid string, IP string, Money uint64, attach string) (Success result.ActionResultCode, Message string, result WxOrderResult)

func (WxService) MWQRCodeTemp

func (entity WxService) MWQRCodeTemp(OID uint64, UserID uint64, qrtype, params string) *result.ActionResult
func (entity WxService) MiniProgramByAppIDAndMchID(AppID, MchID string) dao.WxConfig {
	var wx dao.WxConfig
	err := dao.Orm().Model(&dao.WxConfig{}).Where("AppID=? and MchID=?", AppID, MchID).First(&wx).Error
	glog.Error(err)
	return wx
}
func (entity WxService) GetWxConfig(ID uint64) dao.WxConfig {
	var wx dao.WxConfig
	err := dao.Orm().Model(&dao.WxConfig{}).Where("ID=?", ID).First(&wx).Error
	glog.Error(err)
	return wx
}

func (WxService) MiniProgram

func (entity WxService) MiniProgram() dao.WxConfig

func (self WxService) WX() WxConfig {

	return WxConfig{AppID: "wx037d3b26b2ba34b2", AppSecret: "c930d5b6a337c6bad9b41556cdcb94d2", Token: "", EncodingAESKey: "", MchID: "1253136001", PayKey: "6af34073b83d6f8a4f35289b92226f20"}
}

小程序

func (WxService) MiniProgramInfo

func (entity WxService) MiniProgramInfo(Code, AppID, AppSecret string) (err error, OpenID, SessionKey string)

func (WxService) MiniWeb

func (entity WxService) MiniWeb() dao.WxConfig

公众号

func (WxService) MwGetTicket

func (entity WxService) MwGetTicket(WxConfig dao.WxConfig) string

func (WxService) MwGetWXJSConfig

func (entity WxService) MwGetWXJSConfig(url string, OID uint64) map[string]interface{}

func (WxService) NewOrderNotify

func (entity WxService) NewOrderNotify(Order dao.Orders, ogs []dao.OrdersGoods) *result.ActionResult

新订单

func (WxService) NewUserJoinNotify

func (entity WxService) NewUserJoinNotify(NewUser dao.User, notifyUser dao.User) *result.ActionResult

新用户加入,绑定上下级关系

func (WxService) Order

func (entity WxService) Order(OrderNo string, title, description string, detail, openid string, IP string, Money uint64, attach string, WxConfig dao.WxConfig) (Success result.ActionResultCode, Message string, wxResult WxOrderResult)

func (WxService) OrderDeliveryNotify

func (entity WxService) OrderDeliveryNotify(Order dao.Orders, ogs []dao.OrdersGoods) *result.ActionResult

发货通知

func (WxService) OrderQuery

func (entity WxService) OrderQuery(OrderNo string) (Success bool, Result util.Map)

订单查询

func (WxService) Refund

func (entity WxService) Refund(order dao.Orders, ordersPackage dao.OrdersPackage, PayMoney, RefundMoney uint64, Desc string, Type uint64) (Success bool, Message string)

退款

func (WxService) SendUniformMessage

func (entity WxService) SendUniformMessage(sendData map[string]interface{}) (*result.ActionResult, int)

func (WxService) SendWXMessage

func (entity WxService) SendWXMessage(sendData map[string]interface{}) *result.ActionResult

func (WxService) SignatureVerification

func (entity WxService) SignatureVerification(dataMap util.Map) bool

func (WxService) Transfers

func (entity WxService) Transfers(transfers dao.Transfers) (Success bool, Message string)

提现

Jump to

Keyboard shortcuts

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