Documentation ¶
Index ¶
- type AddressComponent
- type AmountInfo
- type CateInfo
- type CloudBase
- type Cos
- type CosTempAuth
- type CosTempAuthOption
- type H5PayerInfo
- type JsApiCallSign
- type JsapiPayInfo
- type JumpWxa
- type LineColor
- type Location
- type MpTemplateMsg
- type MsgData
- type MsgImage
- type MsgLink
- type MsgMiniProgramPage
- type MsgText
- type NativePayerOption
- type Payer
- type PhoneInfo
- type PubTemplateInfo
- type RefundOption
- type ReqCreateActivityIDOption
- type ReqDeleteTemplateOption
- type ReqGenerateNFCSchemeOption
- type ReqGenerateSchemeOption
- type ReqGenerateShortLinkOption
- type ReqGenerateUrlLinkOption
- type ReqGetPhoneNumberOption
- type ReqGetQRCodeOption
- type ReqGetQRCodeUnlimitedOption
- type ReqGetTempMediaOption
- type ReqGetUserEncryptKeyOption
- type ReqJsapiOption
- type ReqRefundInfo
- type ReqScanPayXml
- type ReqSendCustomerMessageOption
- type ReqSendMessageOption
- type ReqSendUniformMessageOption
- type ReqSetUpdatableMsgOption
- type ReqTransferToBalanceInfo
- type ReqUploadTempMediaOption
- type RespAddressToLocation
- type RespCloseOrder
- type RespCode2Session
- type RespCreateActivityID
- type RespDeleteTemplate
- type RespGenerateNFCScheme
- type RespGenerateScheme
- type RespGenerateShortLink
- type RespGenerateUrlLink
- type RespGetCategory
- type RespGetPhoneNumber
- type RespGetPubTemplateKeyWordsById
- type RespGetQRCode
- type RespGetQRCodeUnlimited
- type RespGetTempMedia
- type RespGetUserEncryptKey
- type RespJsapi
- type RespLocationToAddress
- type RespOrderQuery
- type RespQueryScheme
- type RespQueryUrlLink
- type RespRefund
- type RespScancodePay
- type RespSendCustomerMessage
- type RespSendMessage
- type RespSendUniformMessage
- type RespSetUpdatableMsg
- type RespTokenInfo
- type RespUploadTempMedia
- type ResultTengxunMap
- type ScanPayerOption
- type SceneInfo
- type SchemeInfo
- type SchemeQuota
- type Sms
- type StoreInfo
- type TemplateInfo
- type TemplateParameter
- type TengxunCloud
- type TengxunCloudOption
- type TengxunMap
- type TransferToBalanceOption
- type UrlLinkInfo
- type UrlLinkQuotaInfo
- type UserKeyInfo
- type Watermark
- type Weapp
- func (w *Weapp) CreateActivityId(opts *ReqCreateActivityIDOption) (*RespCreateActivityID, error)
- func (w *Weapp) GenerateNFCScheme(opts *ReqGenerateNFCSchemeOption) (*RespGenerateNFCScheme, error)
- func (w *Weapp) GenerateScheme(opts *ReqGenerateSchemeOption) (*RespGenerateScheme, error)
- func (w *Weapp) GenerateShortLink(opts *ReqGenerateShortLinkOption) (string, error)
- func (w *Weapp) GenerateUrlLink(opts *ReqGenerateUrlLinkOption) (string, error)
- func (w *Weapp) GetCategory() (*RespGetCategory, error)
- func (w *Weapp) GetPhoneNumber(opts *ReqGetPhoneNumberOption) (*RespGetPhoneNumber, error)
- func (w *Weapp) GetPubTemplateKeyWordsById(tid string) (*RespGetPubTemplateKeyWordsById, error)
- func (w *Weapp) GetQRCode(opts *ReqGetQRCodeOption) (*RespGetQRCode, error)
- func (w *Weapp) GetTempMedia(opts *ReqGetTempMediaOption) (*RespGetTempMedia, error)
- func (w *Weapp) GetToken() (string, error)
- func (w *Weapp) GetUnlimitedQRCode(opts *ReqGetQRCodeUnlimitedOption) ([]byte, error)
- func (w *Weapp) GetUserEncryptKey(opts *ReqGetUserEncryptKeyOption) (*RespGetUserEncryptKey, error)
- func (w *Weapp) Jscode2session(jscode string) (*RespCode2Session, error)
- func (w *Weapp) QueryScheme(scheme string) (*RespQueryScheme, error)
- func (w *Weapp) QueryUrlLink(urlLink string) (*RespQueryUrlLink, error)
- func (w *Weapp) SendCustomMessage(opts *ReqSendCustomerMessageOption) (*RespSendCustomerMessage, error)
- func (w *Weapp) SendMessage(opts *ReqSendMessageOption) (*RespSendMessage, error)
- func (w *Weapp) SendUniformMessage(opts *ReqSendUniformMessageOption) (*RespSendUniformMessage, error)
- func (w *Weapp) SetUpdatableMsg(opts *ReqSetUpdatableMsgOption) (*RespSetUpdatableMsg, error)
- func (w *Weapp) UploadTempMedia(opts *ReqUploadTempMediaOption) (*RespUploadTempMedia, error)
- type WeappTemplateMsg
- type WechatOption
- type WechatPay
- type WechatPayV2
- type WechatPayV3
- func (w *WechatPayV3) CloseOrder(outTradeNo string) error
- func (w *WechatPayV3) H5Pay(payInfo H5PayerInfo) (string, error)
- func (w *WechatPayV3) Jsapi(payInfo *JsapiPayInfo) (*JsApiCallSign, error)
- func (w *WechatPayV3) NativePay(payInfo *NativePayerOption) (string, error)
- func (w *WechatPayV3) QueryOrderByOutTradeNo(outTradeNo string) (*RespOrderQuery, error)
- func (w *WechatPayV3) QueryOrderByTransactionId(transactionId string) (*RespOrderQuery, error)
- func (w *WechatPayV3) QueryRefundOrder(outRefundNo string) (*RespRefund, error)
- func (w *WechatPayV3) Refund(opts *RefundOption) (*RespRefund, error)
- type Wxmp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressComponent ¶ added in v1.2.2
type AmountInfo ¶
type Cos ¶
type Cos struct {
// contains filtered or unexported fields
}
func (*Cos) GetTempAuth ¶
func (cos *Cos) GetTempAuth(opts *CosTempAuthOption) (*CosTempAuth, error)
type CosTempAuth ¶
type CosTempAuthOption ¶
type H5PayerInfo ¶
type JsApiCallSign ¶
type JsapiPayInfo ¶
type MpTemplateMsg ¶
type MpTemplateMsg struct { AppID string `json:"appid"` // 必填,公众号appid,要求与小程序有绑定且同主体 TemplateID string `json:"template_id"` // 必填,所需下发的模板消息的id URL string `json:"url"` // 必填,模板跳转链接(海外帐号没有跳转能力) Miniprogram string `json:"miniprogram,omitempty"` // 跳小程序所需数据,不需跳小程序可不用传该数据 Data string `json:"data"` // 必填,模板内容,不填则下发空模板 }
type MsgMiniProgramPage ¶
type NativePayerOption ¶
type PubTemplateInfo ¶
type RefundOption ¶
type ReqDeleteTemplateOption ¶
type ReqDeleteTemplateOption struct {
PriTmplId string `json:"priTmplId"` // 必填,要删除的模板 ID
}
type ReqGenerateSchemeOption ¶
type ReqGenerateUrlLinkOption ¶
type ReqGenerateUrlLinkOption struct { Path string `json:"path,omitempty"` Query string `json:"query,omitempty"` IsExpire bool `json:"is_expire"` ExpireType int `json:"expire_type"` ExpireTime int `json:"expire_time"` ExpireInterval int `json:"expire_interval,omitempty"` EnvVersion string `json:"env_version,omitempty"` CloudBase *CloudBase `json:"cloud_base,omitempty"` }
type ReqGetPhoneNumberOption ¶
type ReqGetPhoneNumberOption struct {
Code string `json:"code"` // 必填,登录时获取的 code
}
type ReqGetQRCodeOption ¶
type ReqGetQRCodeUnlimitedOption ¶
type ReqGetQRCodeUnlimitedOption struct { Scene string `json:"scene"` Page string `json:"page"` CheckPath string `json:"check_path,omitempty"` EnvVersion string `json:"env_version,omitempty"` Width int `json:"width,omitempty"` AuthColor bool `json:"auto_color,omitempty"` LineColor *LineColor `json:"line_color,omitempty"` IsHyaline bool `json:"is_hyaline,omitempty"` }
type ReqGetTempMediaOption ¶
type ReqGetTempMediaOption struct {
MediaID string `json:"media_id"` // 必填,媒体文件ID
}
type ReqJsapiOption ¶
type ReqJsapiOption 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"` SupportFapiao bool `json:"support_fapiao,omitempty"` Amount *AmountInfo `json:"amount"` Payer *Payer `json:"payer"` SceneInfo *SceneInfo `json:"scene_info,omitempty"` }
type ReqRefundInfo ¶
type ReqScanPayXml ¶
type ReqScanPayXml struct { XMLName xml.Name `xml:"xml" json:"-"` Appid string `xml:"appid" json:"appid"` MchId string `xml:"mch_id" json:"mch_id"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` Body string `xml:"body" json:"body"` OutTradeNo 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"` AuthCode string `xml:"auth_code" json:"auth_code"` }
func (*ReqScanPayXml) BuildSign ¶
func (req *ReqScanPayXml) BuildSign(mchKey string)
type ReqSendCustomerMessageOption ¶
type ReqSendCustomerMessageOption struct { ToUser string `json:"touser"` // 必填,接收者(用户)的 openid MsgType string `json:"msgtype"` // 必填,消息类型 text表示文本消息;image表示图片消息;link表示图文链接;miniprogrampage表示小程序卡片 Text *MsgText `json:"text,omitempty"` // 可选,文本消息内容 Image *MsgImage `json:"image,omitempty"` // 可选,图片消息内容 Link *MsgLink `json:"link,omitempty"` // 可选,图文链接消息内容 MsgMiniProgramPage *MsgMiniProgramPage `json:"miniprogrampage,omitempty"` // 可选,小程序卡片消息内容 }
type ReqSendMessageOption ¶
type ReqSendMessageOption struct { TemplateId string `json:"template_id"` // 必填,所需下发的订阅模板id Page string `json:"page"` // 必填,点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。 Touser string `json:"touser"` // 必填,接收者(用户)的 openid MiniprogramState string `json:"miniprogram_state"` // 必填,跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 Lang string `json:"lang"` // 必填,所需下发订阅模板消息的语言类型 Data map[string]MsgData `json:"data"` // 必填,模板内容,不填则下发空模板 }
type ReqSendUniformMessageOption ¶
type ReqSendUniformMessageOption struct { ToUser string `json:"touser"` // 必填,接收者(用户)的 openid WeappTemplateMsg *WeappTemplateMsg `json:"weapp_template_msg,omitempty"` //小程序模板消息 MPTemplateMsg *MpTemplateMsg `json:"mp_template_msg,omitempty"` //公众号模板消息 }
type ReqSetUpdatableMsgOption ¶
type ReqSetUpdatableMsgOption struct { ActivityId string `json:"activity_id"` // 必填,动态消息的 ID TargetState int `json:"target_state"` // 必填,设置的状态,0 为取消分享,1 为分享动态消息 TemplateInfo *TemplateInfo `json:"template_info"` // 必填,动态消息对应的模板信息 }
type ReqTransferToBalanceInfo ¶
type ReqTransferToBalanceInfo struct { MchAppid string `xml:"mch_appid" json:"mch_appid"` Mchid string `xml:"mchid" json:"mchid"` Openid string `xml:"openid" json:"openid"` NonceStr string `xml:"nonce_str" json:"nonce_str"` PartnerTradeNo string `xml:"partner_trade_no" json:"partner_trade_no"` CheckName string `xml:"check_name" json:"check_name"` ReUserName string `xml:"re_user_name,omitempty" json:"re_user_name"` Amount int64 `xml:"amount" json:"amount"` Desc string `xml:"desc" json:"desc,omitempty"` SpbillCreateIp string `xml:"spbill_create_ip" json:"spbill_create_ip"` Sign string `xml:"sign" json:"sign"` IsCheckName bool `xml:"-" json:"-"` }
func (*ReqTransferToBalanceInfo) BuildSign ¶
func (p *ReqTransferToBalanceInfo) BuildSign(mchKey string)
type RespAddressToLocation ¶ added in v1.2.2
type RespAddressToLocation struct { Title string `json:"title"` Location *Location `json:"location"` AddressComponents *AddressComponent `json:"address_components"` }
type RespCloseOrder ¶
type RespCode2Session ¶
type RespCreateActivityID ¶
type RespDeleteTemplate ¶
type RespGenerateNFCScheme ¶
type RespGenerateScheme ¶
type RespGenerateShortLink ¶
type RespGenerateUrlLink ¶
type RespGetCategory ¶
type RespGetPhoneNumber ¶
type RespGetPubTemplateKeyWordsById ¶
type RespGetPubTemplateKeyWordsById struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` Data []PubTemplateInfo `json:"data"` }
type RespGetQRCode ¶
type RespGetQRCodeUnlimited ¶
type RespGetTempMedia ¶
type RespGetUserEncryptKey ¶
type RespGetUserEncryptKey struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` KeyInfoList []*UserKeyInfo `json:"key_info_list"` }
type RespLocationToAddress ¶ added in v1.2.2
type RespLocationToAddress struct { Address string `json:"address"` AddressComponent *AddressComponent `json:"address_component"` }
type RespOrderQuery ¶
type RespOrderQuery struct { Appid string `json:"appid"` Mchid string `json:"mchid"` 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 string `json:"success_time"` Payer *Payer `json:"payer"` Amount *AmountInfo `json:"amount"` SceneInfo *SceneInfo `json:"scene_info"` Code string `json:"code"` Message string `json:"message"` }
type RespQueryScheme ¶
type RespQueryScheme struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` SchemeInfo *SchemeInfo `json:"scheme_info,omitempty"` SchemeQuota *SchemeQuota `json:"scheme_quota,omitempty"` }
type RespQueryUrlLink ¶
type RespQueryUrlLink struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"` VisitOpenid string `json:"visit_openid"` UrlLinkQuota *UrlLinkQuotaInfo `json:"url_link_quota,omitempty"` UrlLinkInfo *UrlLinkInfo `json:"url_link_info,omitempty"` }
type RespRefund ¶
type RespRefund struct { RefundId string `json:"refund_id"` OutRefundNo string `json:"out_refund_no"` TransactionId string `json:"transaction_id"` OutTradeNo string `json:"out_trade_no"` Channel string `json:"channel"` UserReceivedAccount string `json:"user_received_account"` SuccessTime string `json:"success_time"` CreateTime string `json:"create_time"` Status string `json:"status"` Amount *refundAmountInfo `json:"amount"` Code string `json:"code"` Message string `json:"message"` }
type RespScancodePay ¶
type RespScancodePay struct { XMLName xml.Name `xml:"xml" json:"-"` ReturnCode string `xml:"return_code" json:"return_code"` ReturnMsg string `xml:"return_msg" json:"return_msg"` Appid string `xml:"appid" json:"appid"` MchId string `xml:"mch_id" json:"mch_id"` DeviceInfo string `xml:"device_info" json:"device_info"` NonceStr string `xml:"nonce_str" json:"nonce_str"` Sign string `xml:"sign" json:"sign"` ResultCode string `xml:"result_code" json:"result_code"` ErrCode string `xml:"err_code" json:"err_code"` ErrCodeDes string `xml:"err_code_des" json:"err_code_des"` Openid string `xml:"openid" json:"openid"` IsSubscribe string `xml:"is_subscribe" json:"is_subscribe"` TradeType string `xml:"trade_type" json:"trade_type"` BankType string `xml:"bank_type" json:"bank_type"` FeeType string `xml:"fee_type" json:"fee_type"` TotalFee int `xml:"total_fee" json:"total_fee"` CashFee int `xml:"cash_fee" json:"cash_fee"` CashFeeType string `xml:"cash_fee_type" json:"cash_fee_type"` TransactionId string `xml:"transaction_id" json:"transaction_id"` OutTradeNo string `xml:"out_trade_no" json:"out_trade_no"` Attach string `xml:"attach" json:"attach"` TimeEnd string `xml:"time_end" json:"time_end"` }
type RespSendCustomerMessage ¶
type RespSendMessage ¶
type RespSendUniformMessage ¶
type RespSetUpdatableMsg ¶
type RespTokenInfo ¶
type RespUploadTempMedia ¶
type ResultTengxunMap ¶ added in v1.2.2
type ScanPayerOption ¶
type SchemeInfo ¶
type SchemeQuota ¶
type Sms ¶
type Sms struct {
// contains filtered or unexported fields
}
Sms 腾讯短信通知接口
func (*Sms) BatchSendSms ¶
func (s *Sms) BatchSendSms(phone []string, signName, templateCode string, templateParam []string) (bool, error)
BatchSendSms 批量发送短信
type TemplateInfo ¶
type TemplateInfo struct {
ParameterList []TemplateParameter `json:"parameter_list"` // 必填,模板内容
}
type TemplateParameter ¶
type TengxunCloud ¶
type TengxunCloud struct { Sms *Sms // 短信 Cos *Cos // 对象存储 // contains filtered or unexported fields }
func NewTengxunCloud ¶
func NewTengxunCloud(opt TengxunCloudOption) *TengxunCloud
type TengxunCloudOption ¶
type TengxunMap ¶ added in v1.2.2
type TengxunMap struct {
// contains filtered or unexported fields
}
func NewTengxunMap ¶ added in v1.2.2
func NewTengxunMap(tokenKey string) *TengxunMap
func (*TengxunMap) AddressToLocation ¶ added in v1.2.2
func (t *TengxunMap) AddressToLocation(address string) (result *RespAddressToLocation, err error)
AddressToLocation 地址解析
func (*TengxunMap) LocationToAddress ¶ added in v1.2.2
func (t *TengxunMap) LocationToAddress(latStr, lngStr string) (result *RespLocationToAddress, err error)
LocationToAddress 逆地址解析
type TransferToBalanceOption ¶
type TransferToBalanceOption struct { Openid string // 用户openid RealName string // 真实姓名 Amount int64 // 金额 Desc string // 描述 ClientIp string // 客户端ip IsCheckName bool // 是否校验真实姓名 TransferNo string // 企业付款单号 }
企业付款到零钱
type UrlLinkInfo ¶
type UrlLinkQuotaInfo ¶
type UserKeyInfo ¶
type Weapp ¶
type Weapp struct {
// contains filtered or unexported fields
}
func (*Weapp) CreateActivityId ¶
func (w *Weapp) CreateActivityId(opts *ReqCreateActivityIDOption) (*RespCreateActivityID, error)
CreateActivityId 创建被分享动态消息或私密消息的 activity_id
func (*Weapp) GenerateNFCScheme ¶
func (w *Weapp) GenerateNFCScheme(opts *ReqGenerateNFCSchemeOption) (*RespGenerateNFCScheme, error)
GenerateNFCScheme 该接口用于获取用于 NFC 的小程序 scheme 码,适用于 NFC 拉起小程序的业务场景
func (*Weapp) GenerateScheme ¶
func (w *Weapp) GenerateScheme(opts *ReqGenerateSchemeOption) (*RespGenerateScheme, error)
GenerateScheme 接口用于获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。通过该接口,可以选择生成到期失效和永久有效的小程序码
func (*Weapp) GenerateShortLink ¶
func (w *Weapp) GenerateShortLink(opts *ReqGenerateShortLinkOption) (string, error)
GenerateShortLink 用于微信内拉起小程序的短链接 适用于 电商类小程序
func (*Weapp) GenerateUrlLink ¶
func (w *Weapp) GenerateUrlLink(opts *ReqGenerateUrlLinkOption) (string, error)
GenerateUrlLink 适用于短信、邮件、网页、微信内等拉起小程序的业务场景。通过该接口,可以选择生成到期失效和永久有效的小程序链接,有数量限制
func (*Weapp) GetCategory ¶
func (w *Weapp) GetCategory() (*RespGetCategory, error)
GetCategory 小程序账号的类目
func (*Weapp) GetPhoneNumber ¶
func (w *Weapp) GetPhoneNumber(opts *ReqGetPhoneNumberOption) (*RespGetPhoneNumber, error)
GetPhoneNumber 接口用于将 code 换取用户手机号。 说明,每个 code 只能使用一次,code的有效期为5min
func (*Weapp) GetPubTemplateKeyWordsById ¶
func (w *Weapp) GetPubTemplateKeyWordsById(tid string) (*RespGetPubTemplateKeyWordsById, error)
GetPubTemplateKeyWordsById 获取模板标题下的关键词列表
func (*Weapp) GetQRCode ¶
func (w *Weapp) GetQRCode(opts *ReqGetQRCodeOption) (*RespGetQRCode, error)
GetQRCode 用于获取小程序码,适用于需要的码数量较少的业务场景。通过该接口生成的小程序码,永久有效
func (*Weapp) GetTempMedia ¶
func (w *Weapp) GetTempMedia(opts *ReqGetTempMediaOption) (*RespGetTempMedia, error)
GetTempMedia 用于获取客服消息内的临时素材。即下载临时的多媒体文件。目前小程序仅支持下载图片文件
func (*Weapp) GetUnlimitedQRCode ¶
func (w *Weapp) GetUnlimitedQRCode(opts *ReqGetQRCodeUnlimitedOption) ([]byte, error)
GetUnlimitedQRCode 用于获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制
func (*Weapp) GetUserEncryptKey ¶
func (w *Weapp) GetUserEncryptKey(opts *ReqGetUserEncryptKeyOption) (*RespGetUserEncryptKey, error)
GetUserEncryptKey 用于获取用户encryptKey。 会获取用户最近3次的key,每个 key 的存活时间为3600s
func (*Weapp) Jscode2session ¶
func (w *Weapp) Jscode2session(jscode string) (*RespCode2Session, error)
Jscode2session 小程序登陆
func (*Weapp) QueryScheme ¶
func (w *Weapp) QueryScheme(scheme string) (*RespQueryScheme, error)
QueryScheme 该接口用于查询小程序 scheme 码,及长期有效 quota。
func (*Weapp) QueryUrlLink ¶
func (w *Weapp) QueryUrlLink(urlLink string) (*RespQueryUrlLink, error)
QueryUrlLink 用于查询小程序 url_link 配置,及长期有效 quota
func (*Weapp) SendCustomMessage ¶
func (w *Weapp) SendCustomMessage(opts *ReqSendCustomerMessageOption) (*RespSendCustomerMessage, error)
SendCustomMessage 用于发送客服消息给用户
func (*Weapp) SendMessage ¶
func (w *Weapp) SendMessage(opts *ReqSendMessageOption) (*RespSendMessage, error)
SendMessage 发送订阅消息
func (*Weapp) SendUniformMessage ¶
func (w *Weapp) SendUniformMessage(opts *ReqSendUniformMessageOption) (*RespSendUniformMessage, error)
SendUniformMessage 接口用于下发小程序和公众号统一的服务消息
func (*Weapp) SetUpdatableMsg ¶
func (w *Weapp) SetUpdatableMsg(opts *ReqSetUpdatableMsgOption) (*RespSetUpdatableMsg, error)
SetUpdatableMsg 修改被分享的动态消息
func (*Weapp) UploadTempMedia ¶
func (w *Weapp) UploadTempMedia(opts *ReqUploadTempMediaOption) (*RespUploadTempMedia, error)
UploadTempMedia 接口用于把媒体文件上传到微信服务器。目前仅支持图片
type WeappTemplateMsg ¶
type WeappTemplateMsg struct { TemplateID string `json:"template_id"` // 必填,所需下发的模板消息的id Page string `json:"page"` // 必填,点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。 FormID string `json:"form_id"` // 必填,表单提交场景下,为 submit 事件带上的 formId;支付场景下,为本次支付的 prepay_id Data string `json:"data"` // 必填,模板内容,不填则下发空模板 EmphasisKeyword string `json:"emphasis_keyword"` //模板需要放大的关键词,不填则默认无放大 }
type WechatOption ¶
type WechatPay ¶
type WechatPay struct { V2 *WechatPayV2 V3 *WechatPayV3 // contains filtered or unexported fields }
WechatPay 微信支付
func NewWechatPay ¶
func NewWechatPay(opts WechatOption) *WechatPay
type WechatPayV2 ¶
type WechatPayV2 struct {
// contains filtered or unexported fields
}
func NewWechatPayV2 ¶
func NewWechatPayV2(opts WechatOption) *WechatPayV2
func (*WechatPayV2) ScancodePay ¶
func (w *WechatPayV2) ScancodePay(payInfo *ScanPayerOption) (*RespScancodePay, error)
ScancodePay 扫码支付 扫码枪扫码支付
func (*WechatPayV2) TransferToBalance ¶
func (p *WechatPayV2) TransferToBalance(transferInfo *TransferToBalanceOption) error
TransferToBalance 企业付款到零钱 v2
type WechatPayV3 ¶
func NewWechatPayV3 ¶
func NewWechatPayV3(opts WechatOption) *WechatPayV3
func (*WechatPayV3) CloseOrder ¶
func (w *WechatPayV3) CloseOrder(outTradeNo string) error
CloseOrder 商户订单支付失败需要生成新单号重新发起支付,要对原订单号调用关单,避免重复支付 系统下单后,用户支付超时,系统退出不再受理,避免用户继续,请调用关单接口
func (*WechatPayV3) H5Pay ¶
func (w *WechatPayV3) H5Pay(payInfo H5PayerInfo) (string, error)
H5Pay h5支付 返回支付链接
func (*WechatPayV3) Jsapi ¶
func (w *WechatPayV3) Jsapi(payInfo *JsapiPayInfo) (*JsApiCallSign, error)
Jsapi 商户系统先调用该接口在微信支付服务后台生成预支付交易单,返回正确的预支付交易会话标识后再按Native、JSAPI、APP等不同场景生成交易串调起支付
func (*WechatPayV3) NativePay ¶
func (w *WechatPayV3) NativePay(payInfo *NativePayerOption) (string, error)
NativePay Native支付下单接口,微信后台系统返回链接参数code_url,商户后台系统将code_url值生成二维码图片,用户使用微信客户端扫码后发起支付
func (*WechatPayV3) QueryOrderByOutTradeNo ¶
func (w *WechatPayV3) QueryOrderByOutTradeNo(outTradeNo string) (*RespOrderQuery, error)
QueryOrderByOutTradeNo 商户订单号查询
func (*WechatPayV3) QueryOrderByTransactionId ¶
func (w *WechatPayV3) QueryOrderByTransactionId(transactionId string) (*RespOrderQuery, error)
QueryOrderByTransactionId 微信支付订单号查询
func (*WechatPayV3) QueryRefundOrder ¶
func (w *WechatPayV3) QueryRefundOrder(outRefundNo string) (*RespRefund, error)
QueryRefundOrder 查询单笔退款订单 outRefundNo 商户退款单号
func (*WechatPayV3) Refund ¶
func (w *WechatPayV3) Refund(opts *RefundOption) (*RespRefund, error)
Refund 申请退款API