fakesite-alipay
A fakesite plugin that provides a stub method for alipay. It's useful to bypass payment flow in develpment environment.
Installation
Add this line to your application's Gemfile:
gem 'fakesite-alipay', group: :development
And then execute:
$ bundle
Route
Make sure that you have added fakesite route in your config/route.rb
mount Fakesite::Engine => "/fakesite" if Rails.env.development?
Usage
Add registration to config/initializers/fakesite.rb
if Rails.env.development?
WebMock.allow_net_connect!
Fakesite.register :alipay, Fakesite::Alipay::Base, {:pid => 'PID', :key => 'KEY'}
end
PID
and KEY
could be fake, but they have to be equal to the settings of library (eg. Gem alipay
) that you use to request Alipay.
License
The gem is available as open source under the terms of the MIT License.
Contact
The project's website is located at https://github.com/emn178/fakesite-alipay
Author: emn178@gmail.com