0.0
No commit activity in last 3 years
No release in over 3 years
银联商户会员的ruby SDK
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 5.0
~> 10.0

Runtime

~> 1.4.2
~> 0.2.0
 Project Readme

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)