alipay 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbf13c5cf133ea25199a7ed7e051c1f6546d5e04
4
- data.tar.gz: a4fc849d912fd9090a679b88f602d186940acb3c
3
+ metadata.gz: 1d0263d712442ba533d3fb7cca219555ba9da7b6
4
+ data.tar.gz: 84207578dd886906c9c6c682e637a56d0f247081
5
5
  SHA512:
6
- metadata.gz: 1209e5d64b493f3cd0e3fcc8a511bfef6f9146eff3b0df5f139bb0451b5af707c8fc0d5376574f31da6b3aa765792c426cfd70512dbf61be09f67953c5764040
7
- data.tar.gz: e19ff49a78fb10d7d5c394b7deff1295405dea96425b58e422347931a8ab112c980d1e839d55d74a262718cdb41c33a075494fbb68fbfd8eca0a542fd53b370f
6
+ metadata.gz: a198e204920d8b1c04ff4d4aa970524702478adeac9fcf61b4f0074c75eca23fab9c80b3009cb6324367d62cc3a06363bc74c9de7be7efb64c098da9b66b8fce
7
+ data.tar.gz: 49556906be591bef1d1b9a54ba61a91e6ea0712d96beca27fd988937221a48b7139681cccf8564ebc8f291bbb5444d88aa505525173175321b09539209d82c73
@@ -1,3 +1,7 @@
1
+ ## v0.3.1 (2015-01-15)
2
+
3
+ - Fix xml encoding #18
4
+
1
5
  ## v0.3.0 (2014-12-10)
2
6
 
3
7
  - Add `close_trade` service. by @linjunpop #16
@@ -17,7 +17,7 @@ module Alipay
17
17
 
18
18
  Alipay::Service.check_required_options(req_data_options, REQ_DATA_REQUIRED_OPTIONS)
19
19
 
20
- xml = req_data_options.map {|k, v| "<#{k}>#{v}</#{k}>" }.join
20
+ xml = req_data_options.map {|k, v| "<#{k}>#{v.encode(:xml => :text)}</#{k}>" }.join
21
21
  req_data_xml = "<direct_trade_create_req>#{xml}</direct_trade_create_req>"
22
22
 
23
23
  # About req_id: http://club.alipay.com/read-htm-tid-10078020-fpage-2.html
@@ -5,10 +5,7 @@ require 'base64'
5
5
  module Alipay
6
6
  module Sign
7
7
  def self.generate(params)
8
- query = params.sort.map do |key, value|
9
- "#{key}=#{value}"
10
- end.join('&')
11
-
8
+ query = params.sort.map { |item| item.join('=') }.join('&')
12
9
  Digest::MD5.hexdigest("#{query}#{Alipay.key}")
13
10
  end
14
11
 
@@ -13,7 +13,7 @@ module Alipay
13
13
  def self.generate_batch_no
14
14
  t = Time.now
15
15
  batch_no = t.strftime('%Y%m%d%H%M%S') + t.nsec.to_s
16
- batch_no.ljust(24, Random.new.rand(1..9).to_s)
16
+ batch_no.ljust(24, rand(10).to_s)
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module Alipay
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -26,7 +26,7 @@ class Alipay::Service::WapTest < Test::Unit::TestCase
26
26
  assert_equal token, Alipay::Service::Wap.trade_create_direct_token(
27
27
  :req_data => {
28
28
  :out_trade_no => '1',
29
- :subject => 'subject',
29
+ :subject => '<a&b>',
30
30
  :total_fee => '0.01',
31
31
  :call_back_url => 'http://www.yoursite.com/call_back'
32
32
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alipay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-10 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler