mchv3

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

README

bingo_wx

微信公众号、企业微信快速开发框架,无需熟悉微信的接口规范就可以快速对接现有的业务。基于bingo
包括

  • 微信公众号
  • 企业微信
  • 新增了 apiv3

api v3 的使用

导入包
import (
 "github.com/aosfather/bingo_wx/apiv3"
)

构建api v3 sdk

apiv3 需要服务商商户私钥加密信息和微信平台沟通

api:=apiv3.ApiV3{}
api.MerchantId="服务商商户号"
//读取私钥
pk,err:=ioutil.ReadFile("e:/opt/私钥.pem")
	if err!=nil {
		t.Error("私钥没找到")
	}
//读取平台公钥如果有的话
fpub,err:=ioutil.ReadFile("e:/opt/平台公钥.cert")
	if err!=nil {
		t.Error("没有公钥")
	}
//设置私钥编号和私钥内容,编号在下载的界面有
api.SetMerchantKey("EDFA23343",pk))
//设置私钥编号和私钥内容,编号在下载的界面有
api.SetFlatKey("PEDFA23343",fpub))

开始使用sdk 调用相应的接口

现在apiv3包中有两个通用的方法对应Get和Post请求,DoGet,DoPost。
除此之外apiv3包还封装了和实名认证申请相关的接口。例如下面的“查询商户实名状态的”

//调用查询商户实名状态的接口
apiv3.MerchantApplymentState(api,"xxxxxxxxxx")
sdk提供了下载平台公钥的接口

apiv3接口中提供了下载平台公钥的方法,前提是需要设置api v3的密钥,这个在微信商户后台设置的。

//指明下载保存的文件名,会将下载更新的平台秘钥写入该文件,包括秘钥编号
api.DownloadFlatPublicKey("/opt/xx_cert.txt")

Documentation

Index

Constants

View Source
const (
	GATEWAY   = "https://api.mch.weixin.qq.com"
	UserAgent = "User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0"
)
View Source
const (
	PayTypeAPP    = "app"
	PayTypeJSAPI  = "jsapi"
	PayTypeNative = "native"
	PayTypeH5     = "h5"
)
View Source
const DEBUG bool = true
View Source
const Fmt = time.RFC3339

Variables

This section is empty.

Functions

func Applyment

func Applyment(cli *Client, params *ApplymentReq) (applymentId int64, err error)

提交申请单API doc: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/applyment4sub/chapter3_1.shtml

func CombineTransaction

func CombineTransaction(v3 *Client, order CombinePayOrder) (result map[string]string, err error)

func Transaction

func Transaction(v3 *Client, order PayOrder) (result map[string]string, err error)

Types

type AdditionInfo

type AdditionInfo struct {
	LegalPersonCommitment string `json:"legal_person_commitment,omitempty"` // 法人开户承诺函
	LegalPersonVideo      string `json:"legal_person_video,omitempty"`      // 法人开户意愿视频
	BusinessAdditionPics  string `json:"business_addition_pics,omitempty"`  // 补充材料
	BusinessAdditionMsg   string `json:"business_addition_msg,omitempty"`   // 补充说明
}

type AppInfo

type AppInfo struct {
	AppAppid    string `json:"app_appid,omitempty"`     // 服务商应用APPID
	AppSubAppid string `json:"app_sub_appid,omitempty"` // 商家应用APPID
	AppPics     string `json:"app_pics"`                // APP截图
}

type ApplymentQueryReply

type ApplymentQueryReply struct {
	BusinessCode      string `json:"business_code"`       // 业务申请编号
	ApplymentId       int64  `json:"applyment_id"`        // 微信支付申请单号
	SubMchid          string `json:"sub_mchid"`           // 特约商户号
	SignUrl           string `json:"sign_url"`            // 超级管理员签约链接
	ApplymentState    string `json:"applyment_state"`     // 申请单状态
	ApplymentStateMsg string `json:"applyment_state_msg"` // 申请状态描述
	AuditDetail       struct {
		Field        string `json:"field"`         // 字段名
		FieldName    string `json:"field_name"`    // 字段名称
		RejectReason string `json:"reject_reason"` // 驳回原因
	} `json:"audit_detail"` // 驳回原因详情
}

func QueryApplymentState

func QueryApplymentState(cli *Client, applymentId int64) (state *ApplymentQueryReply, err error)

查询申请单状态API doc: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/applyment4sub/chapter3_2.shtml

func QueryApplymentStateByCode

func QueryApplymentStateByCode(cli *Client, bussinessCode string) (state *ApplymentQueryReply, err error)

通过业务申请编号查询申请状态

type ApplymentReply

type ApplymentReply struct {
	ApplymentId int64 `json:"applyment_id"`
}

type ApplymentReq

type ApplymentReq struct {
	BusinessCode string `json:"business_code"` // 业务申请编号
	ContactInfo  struct {
		ContactName     string `json:"contact_name"`                // 超级管理员姓名
		ContactIdNumber string `json:"contact_id_number,omitempty"` // 超级管理员身份证件号码
		Openid          string `json:"openid,omitempty"`            // 超级管理员微信openid
		MobilePhone     string `json:"mobile_phone"`                // 联系手机
		ContactEmail    string `json:"contact_email,omitempty"`     // 邮箱
	} `json:"contact_info"` // 超管
	SubjectInfo struct {
		SubjectType           string               `json:"subject_type"`                      // 主体类型
		BusinessLicenseInfo   *BusinessLicenseInfo `json:"business_license_info,omitempty"`   // 营业执照
		CertificateInfo       *CertificateInfo     `json:"certificate_info,omitempty"`        // 登记证书
		OrganizationInfo      *OrganizationInfo    `json:"organization_info,omitempty"`       // 组织机构代码证
		CertificateLetterCopy string               `json:"certificate_letter_copy,omitempty"` // 单位证明函照片
		IdentityInfo          struct {
			IdDocType  string      `json:"id_doc_type"`            // 证件类型
			IdCardInfo *IdCardInfo `json:"id_card_info,omitempty"` // 身份证信息
			IdDocInfo  *IdDocInfo  `json:"id_doc_info,omitempty"`  // 其他类型证件信息
			Owner      bool        `json:"owner"`                  // 经营者/法人是否为受益人
		} `json:"identity_info"` // 经营者/法人身份证件
		UboInfo *UboInfo `json:"ubo_info,omitempty"` // 最终受益人信息
	} `json:"subject_info"` // 主体资料
	BusinessInfo struct {
		MerchantShortname string `json:"merchant_shortname"` // 商户简称
		ServicePhone      string `json:"service_phone"`      // 客服电话
		SalesInfo         struct {
			SalesScenesType string           `json:"sales_scenes_type"`           // 经营场景类型
			BizStoreInfo    *BizStoreInfo    `json:"biz_store_info,omitempty"`    // 线下门店场景
			MpInfo          *MpInfo          `json:"mp_info,omitempty"`           // 公众号场景
			MiniProgramInfo *MiniProgramInfo `json:"mini_program_info,omitempty"` // 小程序场景
			AppInfo         *AppInfo         `json:"app_info,omitempty"`          // APP场景
			WebInfo         *WebInfo         `json:"web_info,omitempty"`          // 互联网网站场景
			WeworkInfo      *WeworkInfo      `json:"wework_info,omitempty"`       // 企业微信场景
		} `json:"sales_info"` // 经营场景
	} `json:"business_info"` // 经营资料
	SettlementInfo struct {
		SettlementId        string `json:"settlement_id"`                  // 入驻结算规则ID
		QualificationType   string `json:"qualification_type"`             // 所属行业
		Qualifications      string `json:"qualifications,omitempty"`       // 特殊资质图片
		ActivitiesId        string `json:"activities_id,omitempty"`        // 优惠费率活动ID
		ActivitiesRate      string `json:"activities_rate,omitempty"`      // 优惠费率活动值
		ActivitiesAdditions string `json:"activities_additions,omitempty"` // 优惠费率活动补充材料
	} `json:"settlement_info"` // 结算规则
	BankAccountInfo struct {
		BankAccountType string `json:"bank_account_type"`        // 账户类型
		AccountName     string `json:"account_name"`             // 开户名称
		AccountBank     string `json:"account_bank"`             // 开户银行
		BankAddressCode string `json:"bank_address_code"`        // 开户银行省市编码
		BankBranchId    string `json:"bank_branch_id,omitempty"` // 开户银行联行号
		BankName        string `json:"bank_name,omitempty"`      // 开户银行全称(含支行)
		AccountNumber   string `json:"account_number"`           // 银行账号
	} `json:"bank_account_info"` // 结算银行账户
	AdditionInfo *AdditionInfo `json:"addition_info,omitempty"` // 补充材料
}

type BizStoreInfo

type BizStoreInfo struct {
	BizStoreName     string `json:"biz_store_name"`     // 门店名称
	BizAddressCode   string `json:"biz_address_code"`   // 门店省市编码
	BizStoreAddress  string `json:"biz_store_address"`  // 门店地址
	StoreEntrancePic string `json:"store_entrance_pic"` // 门店门头照片
	IndoorPic        string `json:"indoor_pic"`         // 店内环境照片
	BizSubAppid      string `json:"biz_sub_appid"`      // 线下场所对应的商家APPID
}

type BusinessLicenseInfo

type BusinessLicenseInfo struct {
	LicenseCopy   string `json:"license_copy"`   // 营业执照照片
	LicenseNumber string `json:"license_number"` // 注册号/统一社会信用代码
	MerchantName  string `json:"merchant_name"`  // 商户名称
	LegalPerson   string `json:"legal_person"`   // 个体户经营者/法人姓名
}

type CertResponse

type CertResponse struct {
	Data []struct {
		SerialNo           string      `json:"serial_no"`           // 证书序列号
		EffectiveTime      string      `json:"effective_time"`      // 生效时间
		ExpireTime         string      `json:"expire_time"`         // 过期时间
		EncryptCertificate EncryptData `json:"encrypt_certificate"` // 证书内容
	} `json:"data"`
}

type CertificateInfo

type CertificateInfo struct {
	CertCopy       string `json:"cert_copy"`       // 登记证书照片
	CertType       string `json:"cert_type"`       // 登记证书类型
	CertNumber     string `json:"cert_number"`     // 证书号
	MerchantName   string `json:"merchant_name"`   // 商户名称
	CompanyAddress string `json:"company_address"` // 注册地址
	LegalPerson    string `json:"legal_person"`    // 法定代表人
	PeriodBegin    string `json:"period_begin"`    // 有效期限开始日期
	PeriodEnd      string `json:"period_end"`      // 有效期限结束日期
}

type Client

type Client struct {
	GateWay            string            // 网关
	Isv                bool              // 是否是服务商client
	MerchantId         string            // 商户id
	SerialNumber       string            // 商户序列号
	AppSecret          string            // 商户密钥 微信支付在回调通知和平台证书下载接口中,对关键信息进行了AES-256-GCM加密
	PrivateKey         *rsa.PrivateKey   // 商户API私钥
	WechatCertificate  *x509.Certificate // 平台证书
	WechatSerialNumber string            // 微信平台序列号
	// contains filtered or unexported fields
}
var Cli *Client // 默认客户端

func NewClient

func NewClient(isv bool, merchantId, serialNumber, appSecret, keyFile string) (cli *Client, err error)

实例化一个客户端

func (*Client) DecryptData added in v1.2.0

func (cli *Client) DecryptData(encryptData EncryptData) (data []byte, err error)

func (*Client) DoGet

func (cli *Client) DoGet(url string, needVerify ...bool) (resp []byte, err error)

GET一个API

func (*Client) DoPost

func (cli *Client) DoPost(url, body string, needVerify ...bool) (resp []byte, httpCode int, err error)

POST一个API

func (*Client) GetPayResult added in v1.2.0

func (cli *Client) GetPayResult(body []byte) (resp PayResp, result PayResult, err error)

func (*Client) GetWechatCertificate

func (cli *Client) GetWechatCertificate() (err error)

获取微信支付平台证书 平台证书会周期性更换。建议商户定时通过API下载新的证书 可以弄个Cronjob线程周期执行这个方法

func (*Client) ImageUpload

func (cli *Client) ImageUpload(content []byte, filename string) (mediaId string, err error)

图片上传 https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/tool/chapter3_1.shtml

func (*Client) SecretFieldEncrypt

func (cli *Client) SecretFieldEncrypt(plaintext []byte) (ciphertext string, err error)

敏感信息加密 https://wechatpay-api.gitbook.io/wechatpay-api-v3/qian-ming-zhi-nan-1/min-gan-xin-xi-jia-mi

func (*Client) Sign

func (cli *Client) Sign(method, url, body, nonce string) (sign string, err error)

加签 https://wechatpay-api.gitbook.io/wechatpay-api-v3/qian-ming-zhi-nan-1/qian-ming-sheng-cheng

func (*Client) SignStr

func (cli *Client) SignStr(str string) (sign string, err error)

type CombinePayOrder

type CombinePayOrder struct {
	Type       string             `json:"-"`
	AppID      string             `json:"combine_appid,omitempty"` // 服务商appid
	MchID      string             `json:"combine_mchid,omitempty"` // 服务商mchid
	OutTradeNo string             `json:"combine_out_trade_no"`
	SceneInfo  *SceneInfo         `json:"scene_info,omitempty"`
	SubOrders  []*CombineSubOrder `json:"sub_orders"`
	PayInfo    struct {
		OpenID string `json:"openid,omitempty"`
	} `json:"combine_payer_info,omitempty"`
	TimeStart  *Time  `json:"time_start,omitempty"`
	TimeExpire *Time  `json:"time_expire,omitempty"`
	NotifyURL  string `json:"notify_url"`
}

type CombinePayResult added in v1.2.0

type CombinePayResult struct {
	MchID          string `json:"mchid,omitempty"`     // 服务商mchid
	SubMchID       string `json:"sub_mchid,omitempty"` // 子商户mchid
	TransactionID  string `json:"transaction_id"`
	OutTradeNo     string `json:"out_trade_no"`
	TradeType      string `json:"trade_type"`                 // 交易类型
	TradeState     string `json:"trade_state"`                // 交易类型
	TradeStateDesc string `json:"trade_state_desc,omitempty"` // 交易状态描述
	BankType       string `json:"bank_type,omitempty"`        // 银行类型
	Attach         string `json:"attach,omitempty"`
	SuccessTime    *Time  `json:"success_time,omitempty"`
	Amount         struct {
		Total         int64  `json:"total"`
		PayerTotal    int64  `json:"payer_total"`
		Currency      string `json:"currency,omitempty"`
		PayerCurrency string `json:"payer_currency"`
	} `json:"amount"`
}

type CombineSubOrder

type CombineSubOrder struct {
	MchID       string `json:"mchid"`
	SubMchID    string `json:"sub_mchid"`
	Description string `json:"description"`
	OutTradeNo  string `json:"out_trade_no"`
	Attach      string `json:"attach"`
	Amount      struct {
		Total    int64  `json:"total"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount"`
	SettleInfo *SettleInfo `json:"settle_info,omitempty"`
}

type EncryptData added in v1.2.0

type EncryptData struct {
	Algorithm      string `json:"algorithm"`
	Ciphertext     string `json:"ciphertext"`
	AssociatedData string `json:"associated_data"`
	OriginalType   string `json:"original_type,omitempty"`
	Nonce          string `json:"nonce"`
}

type GoodsDetail added in v1.2.0

type GoodsDetail struct {
	GoodsID        string `json:"goods_id"` // 公众号ID
	Quantity       int64  `json:"quantity"`
	UnitPrice      int64  `json:"unit_price"`
	DiscountAmount int64  `json:"discount_amount,omitempty"`
	GoodsRemark    string `json:"goods_remark,omitempty"`
}

type GoodsInfo

type GoodsInfo struct {
	ID        string `json:"merchant_goods_id"` // 小店商品id
	WechatID  string `json:"wechatpay_goods_id,omitempty"`
	GoodsName string `json:"goods_name,omitempty"`
	Quantity  int64  `json:"quantity"`
	UnitPrice int64  `json:"unit_price"`
}

type IdCardInfo

type IdCardInfo struct {
	IdCardCopy      string `json:"id_card_copy"`      // 身份证人像面照片
	IdCardNational  string `json:"id_card_national"`  // 身份证国徽面照片
	IdCardName      string `json:"id_card_name"`      // 身份证姓名
	IdCardNumber    string `json:"id_card_number"`    // 身份证号码
	CardPeriodBegin string `json:"card_period_begin"` // 身份证有效期开始时间
	CardPeriodEnd   string `json:"card_period_end"`   // 身份证有效期结束时间
}

type IdDocInfo

type IdDocInfo struct {
	IdDocCopy      string `json:"id_doc_copy"`      // 证件照片
	IdDocName      string `json:"id_doc_name"`      // 证件姓名
	IdDocNumber    string `json:"id_doc_number"`    // 证件号码
	DocPeriodBegin string `json:"doc_period_begin"` // 证件有效期开始时间
	DocPeriodEnd   string `json:"doc_period_end"`   // 证件有效期结束时间
}

type MiniProgramInfo

type MiniProgramInfo struct {
	MiniProgramAppid    string `json:"mini_program_appid,omitempty"`     // 服务商小程序APPID
	MiniProgramSubAppid string `json:"mini_program_sub_appid,omitempty"` // 商家小程序APPID
	MiniProgramPics     string `json:"mini_program_pics"`                // 小程序截图
}

type ModifySettlementReq

type ModifySettlementReq struct {
	SubMchid        string `json:"sub_mchid"`                // 特约商户号
	AccountType     string `json:"account_type"`             // 账户类型
	AccountBank     string `json:"account_bank"`             // 开户银行
	BankAddressCode string `json:"bank_address_code"`        // 开户银行省市编码
	BankName        string `json:"bank_name,omitempty"`      // 开户银行全称(含支行)
	BankBranchId    string `json:"bank_branch_id,omitempty"` // 开户银行联行号
	AccountNumber   string `json:"account_number"`           // 银行账号
}

type MpInfo

type MpInfo struct {
	MpAppid    string `json:"mp_appid,omitempty"`     // 服务商公众号APPID
	MpSubAppid string `json:"mp_sub_appid,omitempty"` // 商家公众号APPID
	MpPics     string `json:"mp_pics"`                // 公众号页面截图
}

type OrganizationInfo

type OrganizationInfo struct {
	OrganizationCopy string `json:"organization_copy"` // 组织机构代码证照片
	OrganizationCode string `json:"organization_code"` // 组织机构代码
	OrgPeriodBegin   string `json:"org_period_begin"`  // 组织机构代码证有效期开始日期
	OrgPeriodEnd     string `json:"org_period_end"`    // 组织机构代码证有效期结束日期
}

type PayDetail

type PayDetail struct {
	CostPrice *int64       `json:"cost_price,omitempty"`
	InvoiceID string       `json:"invoice_id,omitempty"`
	Goods     []*GoodsInfo `json:"goods_detail"`
}

type PayOrder

type PayOrder struct {
	Type string `json:"-"`
	// isv模式,除了sub app 均为必须
	SpAppID  string `json:"sp_appid,omitempty"`  // 服务商appid
	SpMchID  string `json:"sp_mchid,omitempty"`  // 服务商mchid
	SubAppID string `json:"sub_appid,omitempty"` // 子账户appid
	SubMchID string `json:"sub_mchid,omitempty"` // 子商户mchid
	// 非isv模式,必须
	AppID         string `json:"appid,omitempty"` // 公众号ID
	MchID         string `json:"mchid,omitempty"`
	Description   string `json:"description"`
	OutTradeNo    string `json:"out_trade_no"`
	TimeExpire    *Time  `json:"time_expire,omitempty"`
	Attach        string `json:"attach,omitempty"`
	NotifyURL     string `json:"notify_url"`
	GoodsTag      string `json:"goods_tag,omitempty"`
	ProfitSharing string `json:"profit_sharing,omitempty"` // 是否分账
	Amount        struct {
		Total    int64  `json:"total"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount"`
	Payer struct {
		OpenID    string `json:"openid,omitempty"`
		SpOpenID  string `json:"sp_openid,omitempty"`
		SubOpenID string `json:"sub_openid,omitempty"`
	} `json:"payer"`
	SettleInfo *SettleInfo `json:"settle_info,omitempty"`
	PayDetail  *PayDetail  `json:"detail,omitempty"`
	SceneInfo  *SceneInfo  `json:"scene_info,omitempty"`
}

type PayResp added in v1.2.0

type PayResp struct {
	ID           string      `json:"id"`
	CreateTime   Time        `json:"create_time"`
	EventType    string      `json:"event_type"`
	ResourceType string      `json:"resource_type"`
	Resource     EncryptData `json:"resource"`
	Summary      string      `json:"summary"`
}

type PayResult added in v1.2.0

type PayResult struct {
	Type string `json:"-"`
	// isv模式,除了sub app 均为必须
	SpAppID  string `json:"sp_appid,omitempty"`  // 服务商appid
	SpMchID  string `json:"sp_mchid,omitempty"`  // 服务商mchid
	SubAppID string `json:"sub_appid,omitempty"` // 子账户appid
	SubMchID string `json:"sub_mchid,omitempty"` // 子商户mchid
	// 合单支付模式
	CombineAppID      string              `json:"combine_appid,omitempty"` // 公众号ID
	CombineMchID      string              `json:"combine_mchid,omitempty"`
	CombineOutTradeNo string              `json:"combine_out_trade_no"`
	CombinePayResult  []*CombinePayResult `json:"sub_orders"`
	CombinePayInfo    struct {
		OpenID string `json:"openid,omitempty"`
	} `json:"combine_payer_info,omitempty"`
	// 非isv模式,必须
	AppID      string `json:"appid,omitempty"` // 公众号ID
	MchID      string `json:"mchid,omitempty"`
	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,omitempty"` // 交易状态描述
	BankType       string `json:"bank_type,omitempty"`        // 银行类型
	Attach         string `json:"attach,omitempty"`
	SuccessTime    *Time  `json:"success_time,omitempty"`
	Amount         struct {
		Total         int64  `json:"total"`
		PayerTotal    int64  `json:"payer_total"`
		Currency      string `json:"currency,omitempty"`
		PayerCurrency string `json:"payer_currency"`
	} `json:"amount"`
	Payer struct {
		OpenID    string `json:"openid,omitempty"`
		SpOpenID  string `json:"sp_openid,omitempty"`
		SubOpenID string `json:"sub_openid,omitempty"`
	} `json:"payer"`
	PromotionDetail *PromotionDetail `json:"promotion_detail,omitempty"`
	SceneInfo       struct {
		DeviceID string `json:"device_id"`
	} `json:"scene_info,omitempty"`
}

type PromotionDetail added in v1.2.0

type PromotionDetail struct {
	CouponID            string         `json:"coupon_id"`
	Name                string         `json:"name"`
	Scope               string         `json:"scope"` // GLOBAL:全场代金券 SINGLE:单品优惠
	Type                string         `json:"type"`
	Amount              int64          `json:"amount"`
	StockID             string         `json:"stock_id"`
	WechatpayContribute int64          `json:"wechatpay_contribute"`
	MerchantContribute  int64          `json:"merchant_contribute"`
	OtherContribute     int64          `json:"other_contribute"`
	Currency            string         `json:"currency,omitempty"`
	GoodsDetails        []*GoodsDetail `json:"goods_detail,omitempty"`
}

type QuerySettlementReply

type QuerySettlementReply struct {
	AccountType   string `json:"account_type"`   // 账户类型
	AccountBank   string `json:"account_bank"`   // 开户银行
	BankName      string `json:"bank_name"`      // 开户银行全称(含支行)
	BankBranchId  string `json:"bank_branch_id"` // 开户银行联行号
	AccountNumber string `json:"account_number"` // 银行账号
	VerifyResult  string `json:"verify_result"`  // 汇款验证结果
}

func QuerySettlement

func QuerySettlement(cli *Client, subMchid string) (reply *QuerySettlementReply, err error)

查询结算账户API

type SceneInfo

type SceneInfo struct {
	ClientIP  string     `json:"payer_client_ip"`
	DeviceID  string     `json:"device_id,omitempty"`
	StoreInfo *StoreInfo `json:"store_info,omitempty"`
}

type SettleInfo

type SettleInfo struct {
	ProfitSharing bool   `json:"profit_sharing"`           // 是否分账
	SubsidyAmount *int64 `json:"subsidy_amount,omitempty"` // 分账补差金额
}

用于电商收付通支付

type StoreInfo

type StoreInfo struct {
	ID       string `json:"id"` // 公众号ID
	Name     string `json:"name,omitempty"`
	AreaCode string `json:"area_code,omitempty"`
	Address  string `json:"address,omitempty"`
}

type Time added in v1.1.91

type Time time.Time

func (Time) MarshalJSON added in v1.1.91

func (jt Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON added in v1.1.91

func (jt *Time) UnmarshalJSON(data []byte) error

type UboInfo

type UboInfo struct {
	IdType         string `json:"id_type"`                    // 证件类型
	IdCardCopy     string `json:"id_card_copy,omitempty"`     // 身份证人像面照片
	IdCardNational string `json:"id_card_national,omitempty"` // 身份证国徽面照片
	IdDocCopy      string `json:"id_doc_copy,omitempty"`      // 证件照片
	Name           string `json:"name"`                       // 受益人姓名
	IdNumber       string `json:"id_number"`                  // 证件号码
	IdPeriodBegin  string `json:"id_period_begin"`            // 证件有效期开始时间
	IdPeriodEnd    string `json:"id_period_end"`              // 证件有效期结束时间
}

type WebInfo

type WebInfo struct {
	Domain           string `json:"domain"`                      // 互联网网站域名
	WebAuthorisation string `json:"web_authorisation,omitempty"` // 网站授权函
	WebAppid         string `json:"web_appid,omitempty"`         // 互联网网站对应的商家APPID
}

type WeworkInfo

type WeworkInfo struct {
	SubCorpId  string `json:"sub_corp_id"` // 商家企业微信CorpID
	WeworkPics string `json:"wework_pics"` // 企业微信页面截图
}

Jump to

Keyboard shortcuts

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