secapi

package
Version: v0.0.0-...-d10c483 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUB_MERCHANT_MANAGE  = "https://api.mch.weixin.qq.com/secapi/mch/submchmanage?action=add"
	MODIFY_MERCHANT_INFO = "https://api.mch.weixin.qq.com/secapi/mch/modifymchinfo"
	QUERY_MERCHANT_INFO  = "https://api.mch.weixin.qq.com/secapi/mch/submchmanage?action=query"
)
View Source
const (
	BIND_APPID_URL = "https://api.mch.weixin.qq.com/secapi/mch/addsubdevconfig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRequest

type AddRequest struct {
	XMLName xml.Name `xml:"xml"`

	Name         string `xml:"merchant_name"`           //
	ShortName    string `xml:"merchant_shortname"`      //商户简称,该名称是显示给消费者看的商户名称
	ServicePhone string `xml:"service_phone,omitempty"` //方便微信在必要时能联系上商家,会在支付详情展示给消费者

	Channel  string `xml:"channel_id"`
	Business string `xml:"business"`
	Remark   string `xml:"merchant_remark"`
	// contains filtered or unexported fields
}

func (*AddRequest) Init

func (this *AddRequest) Init(appid, merchant string)

func (*AddRequest) SetSign

func (this *AddRequest) SetSign(s string)

func (*AddRequest) ToMap

func (this *AddRequest) ToMap() map[string]string

type BindRequest

type BindRequest struct {
	XMLName xml.Name `xml:"xml"`

	SubMerchant string `xml:"sub_mch_id"` //银行服务商报备的特约商户识别码
	SubAppId    string `xml:"sub_appid"`  //绑定特约商户或渠道公众号、小程序、APP支付等对应的APPID
	// contains filtered or unexported fields
}

服务商给特约子商户配置绑定关系; 注意: API只支持新增配置,不支持修改, 如银行需要修改请先登录微信服务商后台手工删除后重新配置。 可以绑定特约商户或渠道公司名字相同的公众号、小程序、开放平台应用的APPID; 如果提交绑定了subappid,支付接口就一定要传;

接口链接 URL地址: https://api.mch.weixin.qq.com/secapi/mch/addsubdevconfig

func (*BindRequest) Init

func (this *BindRequest) Init(appid, merchant string)

func (*BindRequest) SetSign

func (this *BindRequest) SetSign(s string)

func (*BindRequest) ToMap

func (this *BindRequest) ToMap() map[string]string

type Client

type Client struct {
	AppId    string
	Merchant string
	Key      string
	CerFile  string
	KeyFile  string
}

func (*Client) AddMerchant

func (this *Client) AddMerchant(req AddRequest) merchantResponse

func (*Client) BindSubMerchantApp

func (this *Client) BindSubMerchantApp(sub, app string) configResponse

绑定appid和子商户号

func (*Client) CallApi

func (this *Client) CallApi(url string, request Request, response interface{}) error

呼叫API

func (*Client) ModifyMerchant

func (this *Client) ModifyMerchant(sub, sname, sphone string) merchantResponse

func (*Client) QueryMerchant

func (this *Client) QueryMerchant(code, name string) merchantResponse

type ModifyRequest

type ModifyRequest struct {
	XMLName xml.Name `xml:"xml"`

	SubMerchant  string `xml:"sub_mch_id"`              //银行服务商报备的特约商户识别码
	ShortName    string `xml:"merchant_shortname"`      //商户简称,该名称是显示给消费者看的商户名称
	ServicePhone string `xml:"service_phone,omitempty"` //方便微信在必要时能联系上商家,会在支付详情展示给消费者
	// contains filtered or unexported fields
}

* 银行特约商户信息修改API 应用场景 1.目前支持修改简称和客服电话,子商户修改资料成功后,需要隔30天后才能修改。 2.商户简称是用户支付界面显示的商户名,必须是能清楚标识某个商户,不能乱传。

接口链接 URL地址:https://api.mch.weixin.qq.com/secapi/mch/modifymchinfo

func (*ModifyRequest) Init

func (this *ModifyRequest) Init(appid, merchant string)

func (*ModifyRequest) SetSign

func (this *ModifyRequest) SetSign(s string)

func (*ModifyRequest) ToMap

func (this *ModifyRequest) ToMap() map[string]string

type Request

type Request interface {
	Init(appid, merchant string)
	SetSign(s string)
	ToMap() map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL