银联商户会员 ruby
gem 'netpayclient'
- mcrypt (用于ruby-mcrypt)
# 安装mcrypt (ubuntu)
sudo apt-get install mcrypt libmcrypt-dev
netpay = Netpayclient.build_key(path: 'path/to/MerPrK.key')
# or
netpay = Netpayclient.build_key(hash: {
MERID: '8435...4395',
prikeyS: '4234...423',
prikeyE: '472...48324',
})
# netpay = Netpayclient.build_key(...)
netpay.sign('834...645')
netpay.sign_order(merid, ordno, amount, curyid, transdate, transtype)
netpay.verify(plain, checkvalue)
netpay.verify_trans_response(merid, ordno, amount, curyid, transdate, transtype, ordstatus, check)