[go: up one dir, main page]

Skip to content

weirongxu/netpayclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netpayclient for ruby

银联商户会员 ruby

安装

gem 'netpayclient'

系统依赖

# 安装mcrypt (ubuntu)
sudo apt-get install mcrypt libmcrypt-dev

使用 & API

Netpayclient.build_key(path: nil, hash: {})

netpay = Netpayclient.build_key(path: 'path/to/MerPrK.key')
# or
netpay = Netpayclient.build_key(hash: {
  MERID: '8435...4395',
  prikeyS: '4234...423',
  prikeyE: '472...48324',
})

签名 sign

# netpay = Netpayclient.build_key(...)
netpay.sign('834...645')

订单签名 sign_order

netpay.sign_order(merid, ordno, amount, curyid, transdate, transtype)

应答数据的签名验证 verify

netpay.verify(plain, checkvalue)

应答数据的签名验证包装 verify_trans_response

netpay.verify_trans_response(merid, ordno, amount, curyid, transdate, transtype, ordstatus, check)

About

银联(netpay)商户会员 ruby client

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published