Skip to content

mouse-lin/pay_fu

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 3 commits ahead of transist:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pay_fu

a rails payment engine that supports both alipay and paypal.

Setup

  1. add to Gemfile
gem "pay_fu"
  1. install gem
bundle install
  1. generate config file, route and migration file
rails generate pay_fu:install
  1. update config file config/pay_fu.yml

  2. run migration

rake db:migrate
  1. in controller file, after user clicking checkout, redirect him to paypal gateway page.
include PayFu::PaypalHelper
def action
  ...
  redirect_to_paypal_gateway(:item_name => "subject", :amount => 123)
  return
end
  1. similar for alipay
include PayFu::AlipayHelper
def action
  ...
  redirect_to_alipay_gateway(:subject => "donatecn", :body => "donatecn", :amount => @donate.amount, :out_trade_no => "123", :notify_url => pay_fu.alipay_transactions_notify_url)
  return
end

About

a rails payment engine that supports both alipay and paypal.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 95.0%
  • JavaScript 5.0%