Documentation ¶
Index ¶
- func MapURLEncode(m map[string]string) string
- func ParseCertificateFromFile(path string) (cert *x509.Certificate, err error)
- func ParserPfxToCert(path string, password string) (private *rsa.PrivateKey, cert *x509.Certificate, err error)
- func Sign(params map[string]string, private *rsa.PrivateKey) (string, error)
- func SignVerify(params map[string]string) (bool, error)
- func SortUnionMap(m map[string]string) string
- type UnionCert
- type UnionPay
- func (c *UnionPay) AppConsume(txnamt int, orderNo, attach string) (map[string]string, error)
- func (c *UnionPay) BackNotifyReceive(writer http.ResponseWriter, request *http.Request) (map[string]string, error)
- func (c *UnionPay) ConsumeUndo(txnamt int, orderNo, queryID, attach string) (map[string]string, error)
- func (c *UnionPay) ParseNotify(data string) (map[string]string, error)
- func (c *UnionPay) ParseRespone(bytes []byte) map[string]string
- func (c *UnionPay) Post(m map[string]string) (map[string]string, error)
- func (c *UnionPay) Query(orderNo string) (map[string]string, error)
- func (c *UnionPay) Refund(txnamt int, orderNo, queryID, attach string) (map[string]string, error)
- func (c *UnionPay) ResultCheck(m map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapURLEncode ¶
MapURLEncode Map to string and url encode.
func ParseCertificateFromFile ¶
func ParseCertificateFromFile(path string) (cert *x509.Certificate, err error)
ParseCertificateFromFile 根据文件名解析出证书 openssl pkcs12 -in xxxx.pfx -clcerts -nokeys -out key.cert
func ParserPfxToCert ¶
func ParserPfxToCert(path string, password string) (private *rsa.PrivateKey, cert *x509.Certificate, err error)
ParserPfxToCert 根据银联获取到的PFX文件和密码来解析出里面包含的私钥(rsa)和证书(x509)
func SignVerify ¶
SignVerify verify the signature.
func SortUnionMap ¶
SortUnionMap unionpay requset map sort.
Types ¶
type UnionCert ¶
type UnionCert struct { Private *rsa.PrivateKey Cert *x509.Certificate CertID string }
UnionCert cert info
type UnionPay ¶
type UnionPay struct { Mode string MerID string URL string FrontURL string BackURL string PfxPath string PfxPwd string UnionCert UnionCert // contains filtered or unexported fields }
UnionPay unionpay
func (*UnionPay) AppConsume ¶
AppConsume 消费获取Tn
func (*UnionPay) BackNotifyReceive ¶
func (*UnionPay) ConsumeUndo ¶
func (c *UnionPay) ConsumeUndo(txnamt int, orderNo, queryID, attach string) (map[string]string, error)
ConsumeUndo 消费撤销交易
func (*UnionPay) ParseNotify ¶
ParseNotify parse and url decode notification.
func (*UnionPay) ParseRespone ¶
ParseRespone parse respone.
Click to show internal directories.
Click to hide internal directories.