wxpay 0.1.0.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +54 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/wxpay/api/orderquery.rb +30 -0
- data/lib/wxpay/api/unifiedorder.rb +43 -0
- data/lib/wxpay/api.rb +9 -0
- data/lib/wxpay/openid.rb +24 -0
- data/lib/wxpay/order/pay.rb +66 -0
- data/lib/wxpay/order.rb +76 -0
- data/lib/wxpay/sign.rb +36 -0
- data/lib/wxpay/version.rb +3 -0
- data/lib/wxpay.rb +25 -0
- data/wxpay.gemspec +25 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d08ccd36a9d140b1db257fcae477f104f7e14a45
|
4
|
+
data.tar.gz: 39d73461f4caf4ea8b912d6dc6f24660cca07351
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 75c3d8b58ecf4ec153d1ecc5c8265fe90442ec84314ea1224c608c73962015f540cce7e305c8d2b5a483bbd9c1cdd2829aedd7b9a59a58d9d3277a998286a8ef
|
7
|
+
data.tar.gz: ac7e5c195ee0a657e88c7fa9b1417e381c6dbb2404da85290cf975f4f6c5644d7780ade9cc1667e99015a06157d12fa0dd4f559f4146fdaf19331dafc4769bed
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at feixiongli@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 lifeixiong
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Wxpay
|
2
|
+
|
3
|
+
A simple unofficial wechat pay gem, Support 'NATIVE', 'JSAPI', 'APP' payment mode.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'wxpay'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install wxpay
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Support there is a action named 'wxpay'
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
def wxpay
|
25
|
+
@order = Order.find params[:id]
|
26
|
+
@wxorder = Wxpay::Order.new body: @order.subject,
|
27
|
+
total_fee: @order.total_fee,
|
28
|
+
spbill_create_ip: request_ip,
|
29
|
+
notify_url: your_notify_url,
|
30
|
+
out_trade_no: @order.wxpay_trade_no,
|
31
|
+
trade_type: 'NATIVE', # Or 'APP', 'JSAPI'
|
32
|
+
openid: user_wechat_openid
|
33
|
+
resp = @wxorder.pay!
|
34
|
+
|
35
|
+
if resp[:status] == "success"
|
36
|
+
@code_url = resp[:code_url] # qrcode from wechat, you need to create qrcode image with this value
|
37
|
+
else
|
38
|
+
@error_message = resp[:err_msg]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
```
|
42
|
+
Notice: 'openid' is need for JSAPI pay, 'product_id' is need for NATIVE pay
|
43
|
+
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/feixionglee/wxpay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
48
|
+
|
49
|
+
|
50
|
+
## License
|
51
|
+
|
52
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
53
|
+
|
54
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "wxpay"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Wxpay
|
4
|
+
module Api
|
5
|
+
module Orderquery
|
6
|
+
def orderquery order, options={}
|
7
|
+
random_str = SecureRandom.hex(10)
|
8
|
+
param = {
|
9
|
+
appid: order.appid,
|
10
|
+
mch_id: order.merchant_id,
|
11
|
+
nonce_str: random_str,
|
12
|
+
out_trade_no: order.wxpay_trade_no
|
13
|
+
}
|
14
|
+
sort_str = Wxpay::Sign.create_sign_str param
|
15
|
+
sign = Wxpay::Sign.sign_package sort_str
|
16
|
+
|
17
|
+
_xm = Builder::XmlMarkup.new
|
18
|
+
request_str = _xm.xml {
|
19
|
+
_xm.appid Wxpay.app_id
|
20
|
+
_xm.mch_id Wxpay.merchant_id
|
21
|
+
_xm.nonce_str random_str
|
22
|
+
_xm.out_trade_no order.wxpay_trade_no
|
23
|
+
_xm.sign sign
|
24
|
+
}
|
25
|
+
|
26
|
+
Faraday.get 'https://api.mch.weixin.qq.com/pay/orderquery', request_str
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Wxpay
|
4
|
+
module Api
|
5
|
+
module Unifiedorder
|
6
|
+
def unifiedorder order, options={}
|
7
|
+
random_str = SecureRandom.hex(10)
|
8
|
+
|
9
|
+
defaults = {
|
10
|
+
appid: Wxpay.app_id,
|
11
|
+
mch_id: Wxpay.merchant_id,
|
12
|
+
nonce_str: random_str
|
13
|
+
}
|
14
|
+
|
15
|
+
param = defaults.merge(order.attributes).merge(options)
|
16
|
+
|
17
|
+
sort_str = Wxpay::Sign.create_sign_str param
|
18
|
+
sign = Wxpay::Sign.sign_package sort_str
|
19
|
+
|
20
|
+
_xm = Builder::XmlMarkup.new
|
21
|
+
request_str = _xm.xml {
|
22
|
+
param.each do |k, v|
|
23
|
+
_xm.tag! k.to_s, v
|
24
|
+
end
|
25
|
+
# _xm.appid WEIXIN_ID
|
26
|
+
# _xm.body param[:body]
|
27
|
+
# _xm.mch_id MERCHAT_ID
|
28
|
+
# _xm.nonce_str param[:nonce_str]
|
29
|
+
# _xm.notify_url param[:notify_url]
|
30
|
+
# _xm.openid param[:openid]
|
31
|
+
# _xm.out_trade_no param[:out_trade_no]
|
32
|
+
# _xm.product_id param[:product_id]
|
33
|
+
# _xm.spbill_create_ip param[:spbill_create_ip]
|
34
|
+
# _xm.total_fee param[:total_fee]
|
35
|
+
# _xm.trade_type param[:trade_type]
|
36
|
+
_xm.sign sign
|
37
|
+
}
|
38
|
+
|
39
|
+
Faraday.post 'https://api.mch.weixin.qq.com/pay/unifiedorder', request_str
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/wxpay/api.rb
ADDED
data/lib/wxpay/openid.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Wxpay
|
2
|
+
module Openid
|
3
|
+
AUTHORIZE_URL = 'https://open.weixin.qq.com/connect/oauth2/authorize'
|
4
|
+
ACCESS_TOKEN_URL = 'https://api.weixin.qq.com/sns/oauth2/access_token'
|
5
|
+
def get_openid
|
6
|
+
code = params[:code]
|
7
|
+
Rails.logger.info "code: #{code}"
|
8
|
+
# 如果code参数为空,则为认证第一步,重定向到微信认证
|
9
|
+
if code.nil?
|
10
|
+
url = URI.encode(request.url.gsub('www.tangpin.me', 'tangpin.me'), /\W/)
|
11
|
+
redirect_to "#{AUTHORIZE_URL}?appid=#{WEIXIN_ID}&redirect_uri=#{url}&response_type=code&scope=snsapi_base&state=tangpin#wechat_redirect"
|
12
|
+
return
|
13
|
+
end
|
14
|
+
|
15
|
+
#如果code参数不为空,则认证到第二步,通过code获取openid,并保存到session中
|
16
|
+
begin
|
17
|
+
url = "#{ACCESS_TOKEN_URL}?appid=#{WEIXIN_ID}&secret=#{WEIXIN_SECRET}&code=#{code}&grant_type=authorization_code"
|
18
|
+
session[:weixin_openid] = JSON.parse(URI.parse(url).read)["openid"]
|
19
|
+
rescue Exception => e
|
20
|
+
# ...
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
module Wxpay
|
4
|
+
class Order
|
5
|
+
module Pay
|
6
|
+
def pay!
|
7
|
+
case self.trade_type
|
8
|
+
when 'JSAPI'
|
9
|
+
self.jsapi_pay
|
10
|
+
when 'APP'
|
11
|
+
self.app_pay
|
12
|
+
when 'NATIVE'
|
13
|
+
self.native_pay
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
# 公众号支付
|
20
|
+
def jsapi_pay
|
21
|
+
resp = Wxpay::Api.unifiedorder self
|
22
|
+
xml = Nokogiri::XML resp.body
|
23
|
+
|
24
|
+
Wxpay.debug_info resp.body
|
25
|
+
|
26
|
+
if xml.at('code_url').present?
|
27
|
+
code_url = xml.at('code_url').text
|
28
|
+
return {status: 'success', code_url: code_url}
|
29
|
+
else
|
30
|
+
return {status: 'failure', err_msg: xml.at('err_code_des').text}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# 扫码支付
|
35
|
+
def native_pay
|
36
|
+
resp = Wxpay::Api.unifiedorder self
|
37
|
+
xml = Nokogiri::XML resp.body
|
38
|
+
|
39
|
+
Wxpay.debug_info resp.body
|
40
|
+
|
41
|
+
if xml.at('return_code').text == 'SUCCESS' && xml.at('result_code').text == 'SUCCESS'
|
42
|
+
return {status: 'success', code_url: xml.at('code_url').text}
|
43
|
+
elsif xml.at('return_code').text == 'SUCCESS'
|
44
|
+
return {status: 'failure', err_msg: xml.at('err_code_des').text}
|
45
|
+
else
|
46
|
+
return {status: 'failure', err_msg: xml.at('return_msg').text}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# App支付
|
51
|
+
def app_pay
|
52
|
+
resp = Wxpay::Api.unifiedorder self
|
53
|
+
xml = Nokogiri::XML resp.body
|
54
|
+
|
55
|
+
Wxpay.debug_info resp.body
|
56
|
+
|
57
|
+
if xml.at('code_url').present?
|
58
|
+
code_url = xml.at('code_url').text
|
59
|
+
return {status: 'success', code_url: code_url}
|
60
|
+
else
|
61
|
+
return {status: 'error', err_msg: xml.at('return_msg').text}
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/wxpay/order.rb
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'wxpay/order/pay'
|
2
|
+
|
3
|
+
module Wxpay
|
4
|
+
class Order
|
5
|
+
include Pay
|
6
|
+
|
7
|
+
### 详见微信支付文档
|
8
|
+
AVAILABLE_ATTRIBUTES = [
|
9
|
+
:body, # 商品描述
|
10
|
+
:total_fee, # 订单总金额,单位为分
|
11
|
+
:out_trade_no, # 商户订单号
|
12
|
+
:trade_type, # 交易类型
|
13
|
+
:spbill_create_ip, # 终端IP, APP和网页支付提交用户端ip,Native支付填调用微信支付API的机器IP。
|
14
|
+
:notify_url, # 通知地址
|
15
|
+
###### 以下非必选参数
|
16
|
+
:openid, # 用户标识, trade_type=JSAPI, 此参数必传,用户在商户appid下的唯一标识。
|
17
|
+
:product_id, # 商品ID, trade_type=NATIVE, 此参数必传。
|
18
|
+
:fee_type, # 货币类型, 默认人民币(CNY)
|
19
|
+
:detail, # 商品详情
|
20
|
+
:device_info, # 设备号
|
21
|
+
:limit_pay, # 指定支付方式, e.g. no_credit--指定不能使用信用卡支付
|
22
|
+
:time_start, # 交易起始时间, 格式为yyyyMMddHHmmss
|
23
|
+
:time_expire, # 订单失效时间, 格式为yyyyMMddHHmmss
|
24
|
+
:goods_tag, # 商品标记,代金券或立减优惠功能的参数
|
25
|
+
:attach # 附加数据
|
26
|
+
]
|
27
|
+
|
28
|
+
attr_accessor :attributes
|
29
|
+
|
30
|
+
attr_reader *AVAILABLE_ATTRIBUTES
|
31
|
+
|
32
|
+
def initialize options={}
|
33
|
+
@attributes = options.slice *AVAILABLE_ATTRIBUTES
|
34
|
+
|
35
|
+
puts @attributes.inspect
|
36
|
+
|
37
|
+
@attributes.each do |name, value|
|
38
|
+
instance_variable_set("@#{name}", value)
|
39
|
+
end
|
40
|
+
|
41
|
+
unless @body.present? &&
|
42
|
+
@total_fee.present? &&
|
43
|
+
@out_trade_no.present? &&
|
44
|
+
@trade_type.present? &&
|
45
|
+
@spbill_create_ip.present? &&
|
46
|
+
@notify_url.present?
|
47
|
+
|
48
|
+
raise OrderIllegal, "missing params: #{options}"
|
49
|
+
end
|
50
|
+
|
51
|
+
unless ['NATIVE', 'APP', 'JSAPI'].include?(@trade_type)
|
52
|
+
raise OrderIllegal, "trade_type must be one of ['NATIVE', 'APP', 'JSAPI']"
|
53
|
+
end
|
54
|
+
|
55
|
+
if @trade_type == 'JSAPI' && @openid.blank?
|
56
|
+
raise OrderIllegal, "openid is needed"
|
57
|
+
end
|
58
|
+
|
59
|
+
if @trade_type == 'NATIVE' && @product_id.blank?
|
60
|
+
raise OrderIllegal, "product_id is needed"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# App支付有单独的 app_id 和 merchant_id
|
65
|
+
def app_id
|
66
|
+
self.trade_type == 'APP' ? Wxpay.app_app_id : Wxpay.app_id
|
67
|
+
end
|
68
|
+
|
69
|
+
def merchant_id
|
70
|
+
self.trade_type == 'APP' ? Wxpay.app_merchant_id : Wxpay.merchant_id
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class OrderIllegal < RuntimeError
|
75
|
+
end
|
76
|
+
end
|
data/lib/wxpay/sign.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Wxpay
|
2
|
+
module Sign
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def sign_package params_str, options={}
|
6
|
+
if params_str =~ /trade_type=APP/ || options[:trade_type] == 'APP'
|
7
|
+
key = Wxpay.app_api_key
|
8
|
+
else
|
9
|
+
key = Wxpay.api_key
|
10
|
+
end
|
11
|
+
Rails.logger.info "sign_package:::::: #{params_str}"
|
12
|
+
Digest::MD5.hexdigest(params_str+"&key=#{key}").upcase
|
13
|
+
end
|
14
|
+
|
15
|
+
def sign_pay params_str
|
16
|
+
Rails.logger.info "sign_pay:::::: #{params_str}"
|
17
|
+
Digest::SHA1.hexdigest params_str
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_sign_str options={}, sort=true
|
21
|
+
unsigned_str = ''
|
22
|
+
if sort
|
23
|
+
unsigned_params = options.sort
|
24
|
+
end
|
25
|
+
unsigned_params.each do |key,value|
|
26
|
+
unsigned_str += (key.to_s + '=' + value.to_s + '&')
|
27
|
+
end
|
28
|
+
unsigned_str = unsigned_str[0, unsigned_str.length - 1]
|
29
|
+
end
|
30
|
+
|
31
|
+
def verify params
|
32
|
+
sign_str = create_sign_str(params.except('sign'))
|
33
|
+
params['sign'] == sign_package(sign_str)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/wxpay.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require "wxpay/version"
|
2
|
+
|
3
|
+
require "wxpay/sign"
|
4
|
+
require "wxpay/api"
|
5
|
+
require "wxpay/order"
|
6
|
+
|
7
|
+
module Wxpay
|
8
|
+
class << self
|
9
|
+
attr_accessor :app_id, :app_secret, :merchant_id, :api_key, # JSAPI and NATIVE
|
10
|
+
:app_app_id, :app_app_secret, :app_merchant_id, :app_api_key, # APP
|
11
|
+
:debug
|
12
|
+
|
13
|
+
def debug?
|
14
|
+
!!debug
|
15
|
+
end
|
16
|
+
|
17
|
+
def debug_info message
|
18
|
+
if self.debug?
|
19
|
+
warn '++++WXPAY--DEBUG--INFO++++'
|
20
|
+
warn message
|
21
|
+
warn '--------------------------'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/wxpay.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'wxpay/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "wxpay"
|
8
|
+
spec.version = Wxpay::VERSION
|
9
|
+
spec.authors = ["lifeixiong"]
|
10
|
+
spec.email = ["feixiongli@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{An unofficial wechat pay gem.}
|
13
|
+
spec.description = %q{An unofficial wechat pay gem.}
|
14
|
+
spec.homepage = "https://github.com/feixionglee/wxpay"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_dependency "nokogiri", "~> 1.6"
|
24
|
+
spec.add_dependency "faraday", "~> 0.9.1"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wxpay
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- lifeixiong
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.9.1
|
69
|
+
description: An unofficial wechat pay gem.
|
70
|
+
email:
|
71
|
+
- feixiongli@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- CODE_OF_CONDUCT.md
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/console
|
83
|
+
- bin/setup
|
84
|
+
- lib/wxpay.rb
|
85
|
+
- lib/wxpay/api.rb
|
86
|
+
- lib/wxpay/api/orderquery.rb
|
87
|
+
- lib/wxpay/api/unifiedorder.rb
|
88
|
+
- lib/wxpay/openid.rb
|
89
|
+
- lib/wxpay/order.rb
|
90
|
+
- lib/wxpay/order/pay.rb
|
91
|
+
- lib/wxpay/sign.rb
|
92
|
+
- lib/wxpay/version.rb
|
93
|
+
- wxpay.gemspec
|
94
|
+
homepage: https://github.com/feixionglee/wxpay
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.3.1
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.5.1
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: An unofficial wechat pay gem.
|
118
|
+
test_files: []
|