打算重复造个轮子,解决在 Ruby/Rails 项目中集成国内支付网关的问题。
我的最新 Gem: china_pay
目前只实现了简单的即时到账接口,使用方法: https://github.com/daqing/china_pay/blob/master/README.md
最重要的是,一行代码搞定:
redirect_to ChinaPay::Alipay::Merchant.new('2088123456', 'SECURE_KEY')
.create_order('KC201301300001D', 'iPhone 5', '感谢您的购买 !')
.seller_email('[email protected]').total_fee(0.01)
.direct_pay
.after_payment_redirect_url('http://company.com/payments/success')
.notification_callback_url('http://company.com/payments/notify')
.gateway_api_url
Enjoy!