Project

tin_alipay

0.0
No commit activity in last 3 years
No release in over 3 years
The alipay directly payment web&mobile gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.1.8
 Project Readme

TinAlipay¶ ↑

This project rocks and uses MIT-LICENSE.

#this gem for alipay “create_direct_pay_by_user”

1: add gem to your gemfile.

gem ‘tin-alipay’, ‘2.4.3’

bundle

2: Config your alipay.

TinAlipay.pid = 'alipay_pid'                 #alipay_pid
TinAlipay.key = 'alipay_key'                 #alipay_key
TinAlipay.seller_email = '107191613@qq.com'  #alipay_email

3: To pay money you should get alipay url.

If you use PC url:

options = {
  :out_trade_no      => '1',
  :subject           => 'your subject',
  :price             => '0.01',
  :quantity          => 1,
  :return_url        => 'http://www.xxxxx.com/call_back' ,
  :notify_url        => 'http://www.xxxxx.com/notify_call_back'
}

#you can directly redirect_to this url

TinAlipay::Payment.create_direct_pay_pc_url(options)

If you use MOBILE url:

	options={
		:req_data => {
      :out_trade_no  => '1',
      :subject       => 'your subject',
      :total_fee     => '0.01',
      :notify_url    => "http://www.xxxxx.com/notify_call_back",
      :call_back_url => 'http://www.xxxxx.com/call_back'
      }}

#you can directly redirect_to this url

TinAlipay::Payment.create_direct_pay_mobile_url(options)

4: To verify return params of the pc&mobile.

PC:

TinAlipay::Notify.verify?(return_params)

MOBILE:

TinAlipay::Notify::Mobile.verify?(return_params)

#if you have some troble when use this gem,to email me.…..