Documentation
¶
Index ¶
- Constants
- func CreateForm(key, contentType string, w *multipart.Writer) (io.Writer, error)
- func CreateFormFile(fieldName, filename, contentType string, w *multipart.Writer) (io.Writer, error)
- func GetCertificateSerialNumber(certificate x509.Certificate) string
- func IsCertExpired(certificate x509.Certificate, now time.Time) bool
- func IsCertValid(certificate x509.Certificate, now time.Time) bool
- func LoadCertificate(certificateStr string) (certificate *x509.Certificate, err error)
- func LoadCertificateWithPath(path string) (certificate *x509.Certificate, err error)
- func LoadPrivateKey(privateKeyStr string) (privateKey *rsa.PrivateKey, err error)
- func LoadPrivateKeyWithPath(path string) (privateKey *rsa.PrivateKey, err error)
- func LoadPublicKey(publicKeyStr string) (publicKey *rsa.PublicKey, err error)
- func LoadPublicKeyWithPath(path string) (publicKey *rsa.PublicKey, err error)
- func NewRequest(authorization string, url string, method string, body io.Reader) (*http.Request, error)
- func SimpleRequest(client *http.Client, url string, method string, authorization string, ...) (*http.Response, error)
- func WithBaseHeader(req *http.Request, authorization string) *http.Request
- type ApiCert
- type BasicInformation
- type Client
- type ClientOption
- type DialSettings
- type ErrResponseBody
- type ErrorOption
- type PayClient
- func (c *PayClient) AddProfitSharingReceiver(data custom.ReqAddProfitSharingReceiver) (*custom.RespAddProfitSharingReceiver, error)
- func (c *PayClient) ApplyFundBill(billDate, accountType, tarType string) (*custom.RespApplyTransactionBill, error)
- func (c *PayClient) ApplyProfitSharingBill(billDate, subMchid, tarType string) (*custom.RespApplyTransactionBill, error)
- func (c *PayClient) ApplyTransactionBill(billDate, subMchid, billType, tarType string) (*custom.RespApplyTransactionBill, error)
- func (c *PayClient) Authorization(httpMethod string, urlString string, body []byte) (string, error)
- func (c *PayClient) ContractQuery(contractId, AppId string) (*custom.RespContractQuery, error)
- func (c *PayClient) CreateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
- func (c *PayClient) Decrypt(algorithm string, cipherText string, associatedData string, nonce string) ([]byte, error)
- func (c *PayClient) DeleteProfitSharingReceiver(data custom.ReqDeleteProfitSharingReceiver) (*custom.RespDeleteProfitSharingReceiver, error)
- func (c *PayClient) DeleteViolationNotifications() error
- func (c *PayClient) DissolveEduPaPayContract(contractId string) error
- func (c *PayClient) DissolveEduSchoolPayContract(contractId string) error
- func (c *PayClient) DissolveFaceUserContract(organizationId, outUserId string) error
- func (c *PayClient) DownloadBill(downloadUrl string) ([]byte, error)
- func (c *PayClient) EduPaPayContractQueryById(contractId string, query url.Values) (*custom.RespEduPaPayContractQuery, error)
- func (c *PayClient) EduPaPayContractQueryByOpenId(openid string, query url.Values) (*custom.RespEduPaPayContractQueryList, error)
- func (c *PayClient) EduPaPayPresign(data custom.ReqEduPaPayPresign) (*custom.RespEduPaPayPresign, error)
- func (c *PayClient) EduPaPayQueryOrderByOutTradeNo(outTradeNo string, query url.Values) (*custom.RespEduPaPayQueryOrder, error)
- func (c *PayClient) EduPaPayQueryOrderByTransactionId(transactionId string, query url.Values) (*custom.RespEduPaPayQueryOrder, error)
- func (c *PayClient) EduPaPayTransactions(data custom.ReqEduPaPayTransactions) error
- func (c *PayClient) EduSchoolPayContractQueryById(contractId string) (*custom.RespEduSchoolPayContractQuery, error)
- func (c *PayClient) EduSchoolPayContractQueryByOpenId(openId string, query url.Values) (*custom.RespEduSchoolPayContractQueryPage, error)
- func (c *PayClient) EduSchoolPayPreSign(data custom.ReqEduSchoolPayPreSign) (*custom.RespEduSchoolPayPreSign, error)
- func (c *PayClient) EduSchoolPayQueryOrderByOutTradeNo(outTradeNo string, query url.Values) (*custom.RespEduSchoolPayTransactions, error)
- func (c *PayClient) EduSchoolPayQueryOrderByTransactionId(transactionId string, query url.Values) (*custom.RespEduSchoolPayTransactions, error)
- func (c *PayClient) EduSchoolPayTransactions(data custom.ReqEduSchoolPayTransactions) (*custom.RespEduSchoolPayTransactions, error)
- func (c *PayClient) FaceMessageDecryption(data custom.FaceMessageCiphertext) (*custom.FaceMessagePlaintext, error)
- func (c *PayClient) GetAndSetCertificate() ([]custom.CertificateData, error)
- func (c *PayClient) GetAuthInfo(data custom.ReqGetAuthInfo) (*custom.RespGetAuthInfo, error)
- func (c *PayClient) GetCertificate() ([]custom.CertificateData, error)
- func (c *PayClient) GetRepaymentUrl(data custom.ReqGetRepaymentUrl) (*custom.RespGetRepaymentUrl, error)
- func (c *PayClient) GetStatusRepairOrderByApplymentId(applymentId string) (*custom.RespGetStatusRepairOrder, error)
- func (c *PayClient) GetStatusRepairOrderByBusinessCode(businessCode string) (*custom.RespGetStatusRepairOrder, error)
- func (c *PayClient) IncomingSubmitApplication(data custom.ReqIncomingSubmitApplication) (*custom.RespIncomingSubmitApplication, error)
- func (c *PayClient) InitiateProfitSharing(data custom.ReqInitiateProfitSharing) (*custom.RespInitiateProfitSharing, error)
- func (c *PayClient) InitiateProfitSharingReturnOrders(data custom.ReqInitiateProfitSharingReturnOrders) (*custom.RespInitiateProfitSharingReturnOrders, error)
- func (c *PayClient) JSAPIOrders(data custom.ReqJSAPIOrders) (*custom.RespJSAPIOrders, error)
- func (c *PayClient) JSAPIOrdersForPartner(data custom.ReqJSAPIOrdersForPartner) (*custom.RespJSAPIOrders, error)
- func (c *PayClient) ModifySettlement(subMchid string, data custom.ReqModifySettlement) error
- func (c *PayClient) ObtainAuthToken(data custom.ReqObtainAuthToken) (*custom.RespObtainAuthToken, error)
- func (c *PayClient) OfflineFaceTransactions(data custom.ReqOfflinefaceTransactions) (*custom.RespOfflinefaceTransactions, error)
- func (c *PayClient) PayCredential(data custom.ReqPayCredential) (*custom.RespPayCredential, error)deprecated
- func (c *PayClient) PaymentCloseOrder(outTradeNo, mchID string, subMchId ...string) error
- func (c *PayClient) PaymentQueryOrderByOutTradeNo(outTradeNo, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
- func (c *PayClient) PaymentQueryOrderByTransactionId(transactionId, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
- func (c *PayClient) PaymentRefund(data custom.ReqPaymentRefund) (*custom.RespPaymentRefund, error)
- func (c *PayClient) PaymentRefundForPartner(data custom.ReqPaymentRefundForPartner) (*custom.RespPaymentRefund, error)
- func (c *PayClient) PreSignature(data custom.ReqPresignToken) (*custom.RespPresignToken, error)
- func (c *PayClient) QueryComplaintsList(beginDate, endDate string, limit, offset int, mchId ...string) (*custom.RespComplaintsList, error)
- func (c *PayClient) QueryFaceUserInfo(organizationId, outUserId string, isDecrypt ...bool) (*custom.RespQueryFaceUserInfo, error)
- func (c *PayClient) QueryMaximumSplitRatio(subMchid string) (*custom.RespQueryMaximumSplitRatio, error)
- func (c *PayClient) QueryOfflineFaceOrders(outTradeNo, spMchid, subMchid, businessProductId string) (*custom.RespOfflinefaceTransactions, error)
- func (c *PayClient) QueryOrganizationInfoById(organizationId string) (*custom.RespOrganizationInfo, error)
- func (c *PayClient) QueryOrganizationInfoByName(organizationName string) (*custom.RespOrganizationInfo, error)
- func (c *PayClient) QueryProfitSharingResult(subMchid, transactionId, outOrderNo string) (*custom.RespQueryProfitSharingResult, error)
- func (c *PayClient) QueryProfitSharingReturnOrders(subMchid, outReturnNo, outOrderNo string) (*custom.RespQueryProfitSharingReturnOrders, error)
- func (c *PayClient) QueryRemainingFrozenAmount(transactionId string) (*custom.RespQueryRemainingFrozenAmount, error)
- func (c *PayClient) QueryRepurchaseUsersList(organizationId, offset, limit string) (*custom.RespQueryRepurchaseUsersList, error)
- func (c *PayClient) QueryRetake(collectionId string) (*custom.FaceCollections, error)
- func (c *PayClient) QuerySettlementAccount(subMchid string) (*custom.SettlementAccount, error)
- func (c *PayClient) QueryViolationNotifications() (*custom.GeneralViolationNotifications, error)
- func (c *PayClient) RsaDecryptByPrivateKey(ciphertext string) (string, error)
- func (c *PayClient) RsaEncryptByPrivateKey(origData []byte) (string, error)
- func (c *PayClient) RsaEncryptByWxPayPubCertKey(plaintext string) (string, error)
- func (c *PayClient) RsaEncryptByWxPayPubKey(plaintext string) (string, error)
- func (c *PayClient) SendEduPaPayNotifications(contractId string, data custom.ReqSendEduPaPayNotifications) error
- func (c *PayClient) SetClientPlatformCert(certificateStr []string) error
- func (c *PayClient) Sign(message []byte) (string, error)
- func (c *PayClient) SmartGuideAssign(guideId string, data custom.ReqSmartGuideAssign) error
- func (c *PayClient) SmartGuideQuery(storeId, subMchid, userId, mobile, workId, limit, offset string) (*custom.RespSmartGuideQuery, error)
- func (c *PayClient) SmartGuideRegister(data custom.ReqSmartGuideRegister) (*custom.RespSmartGuideRegister, error)
- func (c *PayClient) SmartGuideUpdate(guideId string, data custom.ReqSmartGuideUpdate) error
- func (c *PayClient) Token(httpMethod string, rawUrl string, body []byte) (string, error)
- func (c *PayClient) UnfreezeRemainingFunds(data custom.ReqUnfreezeRemainingFunds) (*custom.RespUnfreezeRemainingFunds, error)
- func (c *PayClient) UpdateFaceUserInfo(data custom.ReqUpdateUserInfo) error
- func (c *PayClient) UpdateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
- func (c *PayClient) UploadImage(filePath string) (*custom.RespUploadImage, error)
- func (c *PayClient) VerifyResponse(httpStatus int, header *http.Header, body []byte) error
- type PlatformCert
- type PlatformPubKey
Constants ¶
const CertificationType = "WECHATPAY2-SHA256-RSA2048"
Variables ¶
This section is empty.
Functions ¶
func CreateForm ¶
CreateForm CreateForm
func CreateFormFile ¶
func CreateFormFile(fieldName, filename, contentType string, w *multipart.Writer) (io.Writer, error)
CreateFormFile CreateFormFile
func GetCertificateSerialNumber ¶
func GetCertificateSerialNumber(certificate x509.Certificate) string
GetCertificateSerialNumber 从证书中获取证书序列号
func IsCertExpired ¶
func IsCertExpired(certificate x509.Certificate, now time.Time) bool
IsCertExpired 判定证书在特定时间是否过期
func IsCertValid ¶
func IsCertValid(certificate x509.Certificate, now time.Time) bool
IsCertValid 判定证书在特定时间是否有效
func LoadCertificate ¶
func LoadCertificate(certificateStr string) (certificate *x509.Certificate, err error)
LoadCertificate 通过证书的文本内容加载证书
func LoadCertificateWithPath ¶
func LoadCertificateWithPath(path string) (certificate *x509.Certificate, err error)
LoadCertificateWithPath 通过证书的文件路径加载证书
func LoadPrivateKey ¶
func LoadPrivateKey(privateKeyStr string) (privateKey *rsa.PrivateKey, err error)
LoadPrivateKey 通过私钥的文本内容加载私钥
func LoadPrivateKeyWithPath ¶
func LoadPrivateKeyWithPath(path string) (privateKey *rsa.PrivateKey, err error)
LoadPrivateKeyWithPath 通过私钥的文件路径加载私钥
func LoadPublicKey ¶
LoadPublicKey 通过公钥的文本内容加载公钥
func LoadPublicKeyWithPath ¶
LoadPublicKeyWithPath 通过公钥的文件路径加载公钥
func NewRequest ¶
func NewRequest(authorization string, url string, method string, body io.Reader) (*http.Request, error)
NewRequest NewRequest
Types ¶
type ApiCert ¶
type ApiCert struct {
ApiSerialNo string // 商户API证书序列号
ApiPrivateKey *rsa.PrivateKey // 商户API私钥
ApiCertificate *x509.Certificate // 商户API证书
}
ApiCert 商户证书参数
type BasicInformation ¶
BasicInformation 基础参数
type Client ¶
type Client interface {
// Authorization 获取签名Authorization,由认证类型和签名信息组成
Authorization(httpMethod string, urlString string, body []byte) (string, error)
// GetCertificate 获取微信支付平台证书
GetCertificate() ([]custom.CertificateData, error)
// GetAndSetCertificate 获取并设置微信支付平台证书
GetAndSetCertificate() ([]custom.CertificateData, error)
// SetClientPlatformCert 设置微信支付平台证书
SetClientPlatformCert(certificateStr []string) error
// RsaEncryptByPrivateKey 使用商户私钥加密敏感数据
RsaEncryptByPrivateKey(origData []byte) (string, error)
// RsaDecryptByPrivateKey 使用商户私钥解密敏感数据
RsaDecryptByPrivateKey(ciphertext string) (string, error)
// RsaEncryptByWxPayPubCertKey 使用微信支付平台证书公钥RSA加密
RsaEncryptByWxPayPubCertKey(plaintext string) (string, error)
// RsaEncryptByWxPayPubKey 使用微信支付平台公钥RSA加密
RsaEncryptByWxPayPubKey(plaintext string) (string, error)
// Decrypt 通知密文数据使用V3Key解密 (AES_256_GCM)
Decrypt(algorithm string, cipherText string, associatedData string, nonce string) ([]byte, error)
// UploadImage 上传图片(获取MediaId)
UploadImage(filePath string) (*custom.RespUploadImage, error)
DownloadBill(downloadUrl string) ([]byte, error)
//IncomingSubmitApplication 提交进件申请单
IncomingSubmitApplication(data custom.ReqIncomingSubmitApplication) (*custom.RespIncomingSubmitApplication, error)
//ModifySettlement 修改结算账号
ModifySettlement(subMchid string, data custom.ReqModifySettlement) error
// QuerySettlementAccount 查询结算账户
QuerySettlementAccount(subMchid string) (*custom.SettlementAccount, error)
// GetStatusRepairOrderByBusinessCode 通过业务申请编号查询申请状态
GetStatusRepairOrderByBusinessCode(businessCode string) (*custom.RespGetStatusRepairOrder, error)
// GetStatusRepairOrderByApplymentId 通过申请单号查询申请状态
GetStatusRepairOrderByApplymentId(applymentId string) (*custom.RespGetStatusRepairOrder, error)
//InitiateProfitSharing 发起分账请求(注意,默认会做敏感数据加密) 兼容服务商、直连商户
InitiateProfitSharing(data custom.ReqInitiateProfitSharing) (*custom.RespInitiateProfitSharing, error)
//QueryProfitSharingResult 查询分账结果
QueryProfitSharingResult(subMchid, transactionId, outOrderNo string) (*custom.RespQueryProfitSharingResult, error)
//InitiateProfitSharingReturnOrders 请求分账回退
InitiateProfitSharingReturnOrders(data custom.ReqInitiateProfitSharingReturnOrders) (*custom.RespInitiateProfitSharingReturnOrders, error)
//QueryProfitSharingReturnOrders 查询分账回退结果
QueryProfitSharingReturnOrders(subMchid, outReturnNo, outOrderNo string) (*custom.RespQueryProfitSharingReturnOrders, error)
//UnfreezeRemainingFunds 解冻剩余资金
UnfreezeRemainingFunds(data custom.ReqUnfreezeRemainingFunds) (*custom.RespUnfreezeRemainingFunds, error)
//QueryRemainingFrozenAmount 查询订单待分金额
QueryRemainingFrozenAmount(transactionId string) (*custom.RespQueryRemainingFrozenAmount, error)
//QueryMaximumSplitRatio 查询子商户最大分账比例
QueryMaximumSplitRatio(subMchid string) (*custom.RespQueryMaximumSplitRatio, error)
//AddProfitSharingReceiver 添加分账接收方(注意,默认会做敏感数据加密) 兼容服务商、直连商户
AddProfitSharingReceiver(data custom.ReqAddProfitSharingReceiver) (*custom.RespAddProfitSharingReceiver, error)
//DeleteProfitSharingReceiver 删除分账接收方
DeleteProfitSharingReceiver(data custom.ReqDeleteProfitSharingReceiver) (*custom.RespDeleteProfitSharingReceiver, error)
//ApplyProfitSharingBill 申请分账账单
ApplyProfitSharingBill(billDate, subMchid, tarType string) (*custom.RespApplyTransactionBill, error)
//PaymentQueryOrderByTransactionId 查询订单-通过微信订单号(兼容服务商模式、直连商户模式)
PaymentQueryOrderByTransactionId(transactionId, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
//PaymentQueryOrderByOutTradeNo 查询订单-通过商户订单号(兼容服务商模式、直连商户模式)
PaymentQueryOrderByOutTradeNo(outTradeNo, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
//PaymentCloseOrder 关闭订单(兼容服务商模式、直连商户模式)
PaymentCloseOrder(outTradeNo, mchID string, subMchId ...string) error
//PaymentRefund 直连商户退款
PaymentRefund(data custom.ReqPaymentRefund) (*custom.RespPaymentRefund, error)
//PaymentRefundForPartner 服务商退款
PaymentRefundForPartner(data custom.ReqPaymentRefundForPartner) (*custom.RespPaymentRefund, error)
//ApplyTransactionBill //申请交易账单
ApplyTransactionBill(billDate, subMchid, billType, tarType string) (*custom.RespApplyTransactionBill, error)
//ApplyFundBill //申请资金账单
ApplyFundBill(billDate, accountType, tarType string) (*custom.RespApplyTransactionBill, error)
//JSAPIOrders 直连商户JSAPI下单
JSAPIOrders(data custom.ReqJSAPIOrders) (*custom.RespJSAPIOrders, error)
//JSAPIOrdersForPartner 服务商JSAPI下单
JSAPIOrdersForPartner(data custom.ReqJSAPIOrdersForPartner) (*custom.RespJSAPIOrders, error)
// EduPaPayPresign 教培续费通预签约
EduPaPayPresign(data custom.ReqEduPaPayPresign) (*custom.RespEduPaPayPresign, error)
// EduPaPayContractQueryById 通过协议号查询教培续费通签约
EduPaPayContractQueryById(contractId string, query url.Values) (*custom.RespEduPaPayContractQuery, error)
// EduPaPayContractQueryByOpenId 通用户标识查询教培续费通签约
EduPaPayContractQueryByOpenId(openid string, query url.Values) (*custom.RespEduPaPayContractQueryList, error)
// DissolveEduPaPayContract 教培续费通解约
DissolveEduPaPayContract(contractId string) error
// SendEduPaPayNotifications 发送预扣款通知
SendEduPaPayNotifications(contractId string, data custom.ReqSendEduPaPayNotifications) error
// EduPaPayTransactions 教培通扣款受理
EduPaPayTransactions(data custom.ReqEduPaPayTransactions) error
// EduPaPayQueryOrderByTransactionId 教培通微信订单号查单
EduPaPayQueryOrderByTransactionId(transactionId string, query url.Values) (*custom.RespEduPaPayQueryOrder, error)
// EduPaPayQueryOrderByOutTradeNo 教培通商户订单号查单
EduPaPayQueryOrderByOutTradeNo(outTradeNo string, query url.Values) (*custom.RespEduPaPayQueryOrder, error)
// QueryOrganizationInfoById 获取机构信息(根据机构ID)
QueryOrganizationInfoById(organizationId string) (*custom.RespOrganizationInfo, error)
// QueryOrganizationInfoByName 获取机构信息(根据机构名称)
QueryOrganizationInfoByName(organizationName string) (*custom.RespOrganizationInfo, error)
// ObtainAuthToken 获取授权凭证
ObtainAuthToken(data custom.ReqObtainAuthToken) (*custom.RespObtainAuthToken, error)
// Deprecated: PayCredential 旧版扣款接口,已废弃
PayCredential(data custom.ReqPayCredential) (*custom.RespPayCredential, error)
// QueryFaceUserInfo 查询刷脸用户信息
QueryFaceUserInfo(organizationId, outUserId string, isDecrypt ...bool) (*custom.RespQueryFaceUserInfo, error)
// UpdateFaceUserInfo 修改刷脸用户信息
UpdateFaceUserInfo(data custom.ReqUpdateUserInfo) error
// DissolveFaceUserContract 解除刷脸用户签约关系
DissolveFaceUserContract(organizationId, outUserId string) error
// PreSignature 预签约
PreSignature(data custom.ReqPresignToken) (*custom.RespPresignToken, error)
// OfflineFaceTransactions 申请扣款
OfflineFaceTransactions(data custom.ReqOfflinefaceTransactions) (*custom.RespOfflinefaceTransactions, error)
// ContractQuery 签约查询
ContractQuery(contractId, AppId string) (*custom.RespContractQuery, error)
// FaceMessageDecryption 人脸报文(签约解约)消息解密
FaceMessageDecryption(data custom.FaceMessageCiphertext) (*custom.FaceMessagePlaintext, error)
// QueryRepurchaseUsersList 查询重采用户列表
QueryRepurchaseUsersList(organizationId, offset, limit string) (*custom.RespQueryRepurchaseUsersList, error)
// QueryRetake 查询重采
QueryRetake(collectionId string) (*custom.FaceCollections, error)
// QueryOfflineFaceOrders 离线人脸团餐专属查单
QueryOfflineFaceOrders(outTradeNo, spMchid, subMchid, businessProductId string) (*custom.RespOfflinefaceTransactions, error)
// GetAuthInfo 获取AuthInfo
GetAuthInfo(data custom.ReqGetAuthInfo) (*custom.RespGetAuthInfo, error)
// GetRepaymentUrl 获取还款链接
GetRepaymentUrl(data custom.ReqGetRepaymentUrl) (*custom.RespGetRepaymentUrl, error)
//SmartGuideRegister 服务人员注册
SmartGuideRegister(data custom.ReqSmartGuideRegister) (*custom.RespSmartGuideRegister, error)
//SmartGuideAssign 服务人员分配
SmartGuideAssign(guideId string, data custom.ReqSmartGuideAssign) error
//SmartGuideQuery 服务人员查询
SmartGuideQuery(storeId, subMchid, userId, mobile, workId, limit, offset string) (*custom.RespSmartGuideQuery, error)
//SmartGuideUpdate 服务人员信息更新
SmartGuideUpdate(guideId string, data custom.ReqSmartGuideUpdate) error
// EduSchoolPayPreSign 校园轻松付预签约
EduSchoolPayPreSign(data custom.ReqEduSchoolPayPreSign) (*custom.RespEduSchoolPayPreSign, error)
// EduSchoolPayContractQueryById 校园轻松付通过协议号查询签约
EduSchoolPayContractQueryById(contractId string) (*custom.RespEduSchoolPayContractQuery, error)
// DissolveEduSchoolPayContract 校园轻松付解约
DissolveEduSchoolPayContract(contractId string) error
// EduSchoolPayContractQueryByOpenId 校园轻松付查询用户签约列表
EduSchoolPayContractQueryByOpenId(openId string, query url.Values) (*custom.RespEduSchoolPayContractQueryPage, error)
// EduSchoolPayTransactions 校园轻松付扣款
EduSchoolPayTransactions(data custom.ReqEduSchoolPayTransactions) (*custom.RespEduSchoolPayTransactions, error)
// EduSchoolPayQueryOrderByTransactionId 校园轻松付微信支付订单号查单
EduSchoolPayQueryOrderByTransactionId(transactionId string, query url.Values) (*custom.RespEduSchoolPayTransactions, error)
// EduSchoolPayQueryOrderByOutTradeNo 校园轻松付商户订单号查单
EduSchoolPayQueryOrderByOutTradeNo(outTradeNo string, query url.Values) (*custom.RespEduSchoolPayTransactions, error)
//QueryViolationNotifications 查询商户违规通知回调地址
QueryViolationNotifications() (*custom.GeneralViolationNotifications, error)
//CreateViolationNotifications 创建商户违规通知回调地址
CreateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
//UpdateViolationNotifications 修改商户违规通知回调地址
UpdateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
//DeleteViolationNotifications 删除商户违规通知回调地址
DeleteViolationNotifications() error
// QueryComplaintsList 查询投诉单列表(兼容服务商模式、直连商户模式)
QueryComplaintsList(beginDate, endDate string, limit, offset int, mchId ...string) (*custom.RespComplaintsList, error)
}
Client is Client
type ClientOption ¶
type ClientOption interface {
Join(settings *DialSettings) error
}
ClientOption 微信支付 API v3 HTTPClient core.Client 初始化参数
type DialSettings ¶
type DialSettings struct {
MchId string // 商户号
ApiV3Key string // apiV3密钥
ApiSerialNo string // API证书序列号
ApiPrivateKey *rsa.PrivateKey // API证书私钥
ApiCertificate *x509.Certificate // API证书(非必须,可获取证书序列号和商户API公钥)
DefaultSerialNo string // 默认平台证书序列号
PlatformCertMap map[string]*x509.Certificate // 平台证书集合
WechatPayPublicKeyID string // 平台公钥ID
WechatPayPublicKey *rsa.PublicKey // 平台公钥
HttpClient *http.Client // http客户端
}
DialSettings DialSettings
type ErrResponseBody ¶
type ErrResponseBody struct {
HttpStatus int `json:"http_status"`
Code string `json:"code"`
Message string `json:"message"`
ReqId string `json:"req_id"`
Detail json.RawMessage `json:"detail"`
}
ErrResponseBody ErrResponseBody
func (*ErrResponseBody) Error ¶
func (r *ErrResponseBody) Error() string
type PayClient ¶
type PayClient struct {
MchId string // 商户号
ApiV3Key string // ApiV3Key密钥,用于解密回调通知的密文数据,平台证书密文
ApiSerialNo string // API证书序列号
ApiPrivateKey *rsa.PrivateKey // API证书私钥
ApiCertificate *x509.Certificate // API证书(非必须,可获取证书序列号和商户API公钥)
DefaultPlatformSerialNo string // 默认平台证书序列号
PlatformCertMap map[string]*x509.Certificate // 平台证书集合
WechatPayPublicKeyID string // 平台公钥ID
WechatPayPublicKey *rsa.PublicKey // 平台公钥
HttpClient *http.Client // http客户端
}
PayClient PayClient
func (*PayClient) AddProfitSharingReceiver ¶
func (c *PayClient) AddProfitSharingReceiver(data custom.ReqAddProfitSharingReceiver) (*custom.RespAddProfitSharingReceiver, error)
AddProfitSharingReceiver 添加分账接收方(注意,默认会做敏感数据加密)
func (*PayClient) ApplyFundBill ¶
func (c *PayClient) ApplyFundBill(billDate, accountType, tarType string) (*custom.RespApplyTransactionBill, error)
ApplyFundBill 申请资金账单
func (*PayClient) ApplyProfitSharingBill ¶
func (c *PayClient) ApplyProfitSharingBill(billDate, subMchid, tarType string) (*custom.RespApplyTransactionBill, error)
ApplyProfitSharingBill 申请分账账单
func (*PayClient) ApplyTransactionBill ¶
func (c *PayClient) ApplyTransactionBill(billDate, subMchid, billType, tarType string) (*custom.RespApplyTransactionBill, error)
ApplyTransactionBill 申请交易账单
func (*PayClient) Authorization ¶
Authorization 获取WechatPayV3的header信息Authorization
func (*PayClient) ContractQuery ¶
func (c *PayClient) ContractQuery(contractId, AppId string) (*custom.RespContractQuery, error)
ContractQuery ContractQuery
func (*PayClient) CreateViolationNotifications ¶
func (c *PayClient) CreateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
CreateViolationNotifications 创建商户违规通知回调地址
func (*PayClient) Decrypt ¶
func (c *PayClient) Decrypt(algorithm string, cipherText string, associatedData string, nonce string) ([]byte, error)
Decrypt Decrypt解密
func (*PayClient) DeleteProfitSharingReceiver ¶
func (c *PayClient) DeleteProfitSharingReceiver(data custom.ReqDeleteProfitSharingReceiver) (*custom.RespDeleteProfitSharingReceiver, error)
DeleteProfitSharingReceiver 删除分账接受方
func (*PayClient) DeleteViolationNotifications ¶
DeleteViolationNotifications 删除商户违规通知回调地址
func (*PayClient) DissolveEduPaPayContract ¶
func (*PayClient) DissolveEduSchoolPayContract ¶
func (*PayClient) DissolveFaceUserContract ¶
DissolveFaceUserContract 解约
func (*PayClient) DownloadBill ¶
DownloadBill 下载账单
func (*PayClient) EduPaPayContractQueryById ¶
func (c *PayClient) EduPaPayContractQueryById(contractId string, query url.Values) (*custom.RespEduPaPayContractQuery, error)
EduPaPayContractQueryById EduPaPayContractQueryById
func (*PayClient) EduPaPayContractQueryByOpenId ¶
func (c *PayClient) EduPaPayContractQueryByOpenId(openid string, query url.Values) (*custom.RespEduPaPayContractQueryList, error)
EduPaPayContractQueryByOpenId EduPaPayContractQueryByOpenId
func (*PayClient) EduPaPayPresign ¶
func (c *PayClient) EduPaPayPresign(data custom.ReqEduPaPayPresign) (*custom.RespEduPaPayPresign, error)
EduPaPayPresign EduPaPayPresign
func (*PayClient) EduPaPayQueryOrderByOutTradeNo ¶
func (*PayClient) EduPaPayQueryOrderByTransactionId ¶
func (*PayClient) EduPaPayTransactions ¶
func (c *PayClient) EduPaPayTransactions(data custom.ReqEduPaPayTransactions) error
func (*PayClient) EduSchoolPayContractQueryById ¶
func (c *PayClient) EduSchoolPayContractQueryById(contractId string) (*custom.RespEduSchoolPayContractQuery, error)
func (*PayClient) EduSchoolPayContractQueryByOpenId ¶
func (*PayClient) EduSchoolPayPreSign ¶
func (c *PayClient) EduSchoolPayPreSign(data custom.ReqEduSchoolPayPreSign) (*custom.RespEduSchoolPayPreSign, error)
func (*PayClient) EduSchoolPayQueryOrderByOutTradeNo ¶
func (*PayClient) EduSchoolPayQueryOrderByTransactionId ¶
func (*PayClient) EduSchoolPayTransactions ¶
func (c *PayClient) EduSchoolPayTransactions(data custom.ReqEduSchoolPayTransactions) (*custom.RespEduSchoolPayTransactions, error)
func (*PayClient) FaceMessageDecryption ¶
func (c *PayClient) FaceMessageDecryption(data custom.FaceMessageCiphertext) (*custom.FaceMessagePlaintext, error)
FaceMessageDecryption FaceMessageDecryption
func (*PayClient) GetAndSetCertificate ¶
func (c *PayClient) GetAndSetCertificate() ([]custom.CertificateData, error)
GetAndSetCertificate 获取并设置微信平台证书(一步到位,从微信获取最新的平台证书,并设置到当前客户端)
func (*PayClient) GetAuthInfo ¶
func (c *PayClient) GetAuthInfo(data custom.ReqGetAuthInfo) (*custom.RespGetAuthInfo, error)
GetAuthInfo GetAuthInfo
func (*PayClient) GetCertificate ¶
func (c *PayClient) GetCertificate() ([]custom.CertificateData, error)
GetCertificate 获取微信平台证书(仅从微信获取最新的平台证书)
func (*PayClient) GetRepaymentUrl ¶
func (c *PayClient) GetRepaymentUrl(data custom.ReqGetRepaymentUrl) (*custom.RespGetRepaymentUrl, error)
GetRepaymentUrl GetRepaymentUrl
func (*PayClient) GetStatusRepairOrderByApplymentId ¶
func (c *PayClient) GetStatusRepairOrderByApplymentId(applymentId string) (*custom.RespGetStatusRepairOrder, error)
GetStatusRepairOrderByApplymentId 通过申请单号查询申请状态
func (*PayClient) GetStatusRepairOrderByBusinessCode ¶
func (c *PayClient) GetStatusRepairOrderByBusinessCode(businessCode string) (*custom.RespGetStatusRepairOrder, error)
GetStatusRepairOrderByBusinessCode 通过业务申请编号查询申请状态
func (*PayClient) IncomingSubmitApplication ¶
func (c *PayClient) IncomingSubmitApplication(data custom.ReqIncomingSubmitApplication) (*custom.RespIncomingSubmitApplication, error)
IncomingSubmitApplication 提交进件申请单
func (*PayClient) InitiateProfitSharing ¶
func (c *PayClient) InitiateProfitSharing(data custom.ReqInitiateProfitSharing) (*custom.RespInitiateProfitSharing, error)
InitiateProfitSharing 请求分账(注意,默认会做敏感数据加密)
func (*PayClient) InitiateProfitSharingReturnOrders ¶
func (c *PayClient) InitiateProfitSharingReturnOrders(data custom.ReqInitiateProfitSharingReturnOrders) (*custom.RespInitiateProfitSharingReturnOrders, error)
InitiateProfitSharingReturnOrders is InitiateProfitSharingReturnOrders
func (*PayClient) JSAPIOrders ¶
func (c *PayClient) JSAPIOrders(data custom.ReqJSAPIOrders) (*custom.RespJSAPIOrders, error)
JSAPIOrders 直连商户JSAPI下单
func (*PayClient) JSAPIOrdersForPartner ¶
func (c *PayClient) JSAPIOrdersForPartner(data custom.ReqJSAPIOrdersForPartner) (*custom.RespJSAPIOrders, error)
JSAPIOrdersForPartner 服务商JSAPI下单
func (*PayClient) ModifySettlement ¶
func (c *PayClient) ModifySettlement(subMchid string, data custom.ReqModifySettlement) error
ModifySettlement 修改结算账号
func (*PayClient) ObtainAuthToken ¶
func (c *PayClient) ObtainAuthToken(data custom.ReqObtainAuthToken) (*custom.RespObtainAuthToken, error)
ObtainAuthToken ObtainAuthToken
func (*PayClient) OfflineFaceTransactions ¶
func (c *PayClient) OfflineFaceTransactions(data custom.ReqOfflinefaceTransactions) (*custom.RespOfflinefaceTransactions, error)
OfflineFaceTransactions OfflineFaceTransactions
func (*PayClient) PayCredential
deprecated
func (c *PayClient) PayCredential(data custom.ReqPayCredential) (*custom.RespPayCredential, error)
Deprecated: PayCredential 旧版扣款接口,已废弃
func (*PayClient) PaymentCloseOrder ¶
PaymentCloseOrder 关闭订单
func (*PayClient) PaymentQueryOrderByOutTradeNo ¶
func (c *PayClient) PaymentQueryOrderByOutTradeNo(outTradeNo, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
PaymentQueryOrderByOutTradeNo 查询订单-通过商户订单号
func (*PayClient) PaymentQueryOrderByTransactionId ¶
func (c *PayClient) PaymentQueryOrderByTransactionId(transactionId, mchID string, subMchId ...string) (*custom.ReqPaymentQueryOrder, error)
PaymentQueryOrderByTransactionId 查询订单-通过微信订单号
func (*PayClient) PaymentRefund ¶
func (c *PayClient) PaymentRefund(data custom.ReqPaymentRefund) (*custom.RespPaymentRefund, error)
PaymentRefund 直连商户申请退款
func (*PayClient) PaymentRefundForPartner ¶
func (c *PayClient) PaymentRefundForPartner(data custom.ReqPaymentRefundForPartner) (*custom.RespPaymentRefund, error)
PaymentRefundForPartner 服务商申请退款
func (*PayClient) PreSignature ¶
func (c *PayClient) PreSignature(data custom.ReqPresignToken) (*custom.RespPresignToken, error)
PreSignature PreSignature
func (*PayClient) QueryComplaintsList ¶
func (*PayClient) QueryFaceUserInfo ¶
func (c *PayClient) QueryFaceUserInfo(organizationId, outUserId string, isDecrypt ...bool) (*custom.RespQueryFaceUserInfo, error)
QueryFaceUserInfo QueryFaceUserInfo
func (*PayClient) QueryMaximumSplitRatio ¶
func (c *PayClient) QueryMaximumSplitRatio(subMchid string) (*custom.RespQueryMaximumSplitRatio, error)
QueryMaximumSplitRatio 查询最大分账比例
func (*PayClient) QueryOfflineFaceOrders ¶
func (c *PayClient) QueryOfflineFaceOrders(outTradeNo, spMchid, subMchid, businessProductId string) (*custom.RespOfflinefaceTransactions, error)
QueryOfflineFaceOrders QueryOfflineFaceOrders
func (*PayClient) QueryOrganizationInfoById ¶
func (c *PayClient) QueryOrganizationInfoById(organizationId string) (*custom.RespOrganizationInfo, error)
QueryOrganizationInfoById is QueryOrganizationInfoById
func (*PayClient) QueryOrganizationInfoByName ¶
func (c *PayClient) QueryOrganizationInfoByName(organizationName string) (*custom.RespOrganizationInfo, error)
QueryOrganizationInfoByName is QueryOrganizationInfoByName
func (*PayClient) QueryProfitSharingResult ¶
func (c *PayClient) QueryProfitSharingResult(subMchid, transactionId, outOrderNo string) (*custom.RespQueryProfitSharingResult, error)
QueryProfitSharingResult 查询分账结果
func (*PayClient) QueryProfitSharingReturnOrders ¶
func (c *PayClient) QueryProfitSharingReturnOrders(subMchid, outReturnNo, outOrderNo string) (*custom.RespQueryProfitSharingReturnOrders, error)
QueryProfitSharingReturnOrders IS QueryProfitSharingReturnOrders
func (*PayClient) QueryRemainingFrozenAmount ¶
func (c *PayClient) QueryRemainingFrozenAmount(transactionId string) (*custom.RespQueryRemainingFrozenAmount, error)
QueryRemainingFrozenAmount 查询剩余冻结金额
func (*PayClient) QueryRepurchaseUsersList ¶
func (c *PayClient) QueryRepurchaseUsersList(organizationId, offset, limit string) (*custom.RespQueryRepurchaseUsersList, error)
QueryRepurchaseUsersList QueryRepurchaseUsersList
func (*PayClient) QueryRetake ¶
func (c *PayClient) QueryRetake(collectionId string) (*custom.FaceCollections, error)
QueryRetake QueryRetake
func (*PayClient) QuerySettlementAccount ¶
func (c *PayClient) QuerySettlementAccount(subMchid string) (*custom.SettlementAccount, error)
QuerySettlementAccount 查询结算账户
func (*PayClient) QueryViolationNotifications ¶
func (c *PayClient) QueryViolationNotifications() (*custom.GeneralViolationNotifications, error)
QueryViolationNotifications 查询商户违规通知回调地址
func (*PayClient) RsaDecryptByPrivateKey ¶
RsaDecryptByPrivateKey 使用商户私钥RSA解密
func (*PayClient) RsaEncryptByPrivateKey ¶
RsaEncryptByPrivateKey 使用商户私钥RSA加密
func (*PayClient) RsaEncryptByWxPayPubCertKey ¶
RsaEncryptByWxPayPubCertKey 使用微信支付平台证书公钥RSA加密
func (*PayClient) RsaEncryptByWxPayPubKey ¶
RsaEncryptByWxPayPubKey 使用微信支付平台公钥RSA加密
func (*PayClient) SendEduPaPayNotifications ¶
func (c *PayClient) SendEduPaPayNotifications(contractId string, data custom.ReqSendEduPaPayNotifications) error
func (*PayClient) SetClientPlatformCert ¶
SetClientPlatformCert 设置客户端微信平台证书(通过证书字符串设置当前客户端的平台证书)
func (*PayClient) SmartGuideAssign ¶
func (c *PayClient) SmartGuideAssign(guideId string, data custom.ReqSmartGuideAssign) error
func (*PayClient) SmartGuideQuery ¶
func (c *PayClient) SmartGuideQuery(storeId, subMchid, userId, mobile, workId, limit, offset string) (*custom.RespSmartGuideQuery, error)
func (*PayClient) SmartGuideRegister ¶
func (c *PayClient) SmartGuideRegister(data custom.ReqSmartGuideRegister) (*custom.RespSmartGuideRegister, error)
func (*PayClient) SmartGuideUpdate ¶
func (c *PayClient) SmartGuideUpdate(guideId string, data custom.ReqSmartGuideUpdate) error
func (*PayClient) Token ¶
Token 获取签名信息 请求方法为GET时,报文主体为空;当请求方法为POST或PUT时,请使用真实发送的JSON报文;图片上传API,请使用meta对应的JSON报文
func (*PayClient) UnfreezeRemainingFunds ¶
func (c *PayClient) UnfreezeRemainingFunds(data custom.ReqUnfreezeRemainingFunds) (*custom.RespUnfreezeRemainingFunds, error)
UnfreezeRemainingFunds 解冻剩余资金
func (*PayClient) UpdateFaceUserInfo ¶
func (c *PayClient) UpdateFaceUserInfo(data custom.ReqUpdateUserInfo) error
UpdateFaceUserInfo 更新人脸用户信息
func (*PayClient) UpdateViolationNotifications ¶
func (c *PayClient) UpdateViolationNotifications(data custom.GeneralViolationNotifications) (*custom.GeneralViolationNotifications, error)
UpdateViolationNotifications 修改商户违规通知回调地址
func (*PayClient) UploadImage ¶
func (c *PayClient) UploadImage(filePath string) (*custom.RespUploadImage, error)
UploadImage UploadImage
type PlatformCert ¶
type PlatformCert struct {
DefaultSerialNo string // 默认平台证书序列号
CertList []custom.CertificateDataList
}
PlatformCert 微信平台证书参数
type PlatformPubKey ¶
PlatformPubKey 微信平台公钥参数