Unofficial alipay ruby gem
Unofficial Alipay ruby gem.
Note: Alipay::Client API does not have enough feedback in production yet, please fully test in your staging environment before production. You can find legacy API document here.
You should read https://doc.open.alipay.com before using this gem.
To install using Bundler. Add this line to your application's Gemfile:
gem 'alipay'Then run:
$ bundleOr you can manually install using RubyGems:
$ gem install alipayThis gem needs to be configured with your application's private key for Alipay and Alipay's public key. Here is a quick guide on generating RSA key for use with this gem to get you started.
…@alipay_client.page_execute_url(
method: 'alipay.trade.page.pay',
biz_content: JSON.generate({
out_trade_no: '20160401000000',
product_code: 'FAST_INSTANT_TRADE_PAY',
total_amount: '0.01',
subject: 'test'
}, ascii_only: true), # ascii_only is important!
timestamp: '2016-04-01 00:00:00'
)
# This method will then return a payment url
# => 'https://openapi.alipaydev.com/gateway.do?app_id=201600...'Read Alipay::Client or the Quick Start Guide for usage detail.
Bug report or pull request are welcome.
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)Please write unit test with your code if necessary.
MIT License
No open issues yet, or sync has not completed.