0.0
No commit activity in last 3 years
No release in over 3 years
This gem can help you integrate Alipay Dual-function Payment.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

项目宣布死亡

因为支付宝的“双接口”服务现在已经下线了,所以这个 gem 也没有意义了。但是个人开发者依然可以使用“担保交易”,相应的 gem 可以采用 chloerei/alipay

alipay_dualfun 双功能收款

A ruby gem: http://rubygems.org/gems/alipay_dualfun

Install

Add this line to your application's Gemfile:

gem 'alipay_dualfun'

or development version

gem 'alipay_dualfun', :github => 'happypeter/alipay_dualfun'

And then execute:

$ bundle

Thanks

Generate payment url

options = {
  :partner           => 'PID',
  :seller_email      => 'SELLER_EMAIL',
  :key               => 'SECRET',
  :out_trade_no      => 'YOUR_ORDER_ID',         # 20130801000001
  :subject           => 'YOUR_ORDER_SUBJECCT', 
  :price             => '10.00',
  :quantity          => 12,
  :return_url        => 'YOUR_ORDER_RETURN_URL', # 可选项
  :notify_url        => 'YOUR_ORDER_NOTIFY_URL'  # 可选项
}

Alipay.trade_create_by_buyer_url(options)     # 标准双接口
# => 'https://mapi.alipay.com/gateway.do?out_trade_no=...'

NOTE: 以上除了标注可选项的内容之外,其他选项都是 Gem 要求的必填项,缺一不可。用户还可以根据自身特定需求添加可选项,具体可以参考支付宝官方资料包中的 pdf 文件。

Send Goods

options = {
  :partner           => 'PID',
  :trade_no          => 'TRADE_NO',
  :logistics_name    => 'haoqicat course'
}

Alipay::Service.send_goods_confirm_by_platform(options)
# => '<!xml version="1.0" encoding="utf-8"?><alipay><is_success>T</is_success></alipay>'

NOTE: trade_no is NOT out_treade_no