Coder Social home page Coder Social logo

alipay_d's Introduction

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'
TinAlipay.key = 'alipay_key'
TinAlipay.seller_email = '[email protected]'

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…

alipay_d's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.