Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppTrans ¶
type AppTrans struct {
Config *UnionpayConfig
}
AppTrans is client for submit order and get back the TN(transaction number) from china unionpay
func NewAppTrans ¶
func NewAppTrans(cfg *UnionpayConfig) (*AppTrans, error)
NewApppTrans initial the AppTrans with specific configuration
func (*AppTrans) Sign ¶
Sign the data to comform with specs, more info refer to https://open.unionpay.com/ajweb/help/faq/detail?id=38
type UnionpayConfig ¶
type UnionpayConfig struct {
SignKeyPath string //加密密钥路径(openssl pkcs12 -in PM_700000000000001_acp.pfx -clcerts -nokeys -out key.cert)
SignCertPath string //加密证书路径(openssl pkcs12 -in PM_700000000000001_acp.pfx -nocerts -nodes -out key.pem)
VerifyCertPath string //验证证书路径
CallbackUrl string //回调地址
MerId string //商户号
AppTransUrl string //App方式交易提交地址
}
Click to show internal directories.
Click to hide internal directories.