struggle 1.3.5 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52f81e252f3def70828e8708ed8f4e8194329399
4
- data.tar.gz: dd808ac5b8346ab774a89f05ecc9bca048c69d5e
3
+ metadata.gz: 68f728a5c07b423ef59b480f033b77e46bc6997e
4
+ data.tar.gz: 1332ba0c0e124ed7553387e2273a185a17b55db9
5
5
  SHA512:
6
- metadata.gz: 0b38931206dadb4175f61784ce52544cb6bec4f2d9c7599e3504159b282449a3f3dbef8c6250c347cb9e4c96896c874bab53d3a2b380b2fe8d6b5ac87785cec2
7
- data.tar.gz: 6bb745ec1ffd5ae6c5074247dd821e831d76b98befa54677abe997a1645f3fda525f5179f917a8bf7ef8874e4e5529f8245195ec98c33a3ac71144abb4191dbe
6
+ metadata.gz: f91492c32042a41b477184150ab4b51fee5839bd859db1133e17046dde5c94ad7750c536643541c9d9a5fb93fb76ae3a42f3d381bf5a7765f4d233c363c3dfea
7
+ data.tar.gz: ec3dfbfdbdba4db96141b053e42f794de1988833e7f24308f54452acc953068778f8cf0b363a425f28d17e4223975eeaafa7f755d7a2cd38aec8e3cfaf75e8cc
@@ -18,12 +18,23 @@ module Struggle
18
18
  # v_moneytype:支付货币类型
19
19
  def self.pay(v_mid, key, v_url, remark2, v_oid, v_amount, v_moneytype = "CNY")
20
20
  v_md5info = Digest::MD5.hexdigest(v_amount.to_s + v_moneytype + v_oid + v_mid + v_url + key).upcase
21
- response = Func.post(URL_UTF8, {'v_mid' => v_mid, 'v_oid' => v_oid, 'v_amount' => v_amount, 'v_moneytype' => v_moneytype, 'v_url' => v_url, 'v_md5info' => v_md5info, 'remark2' => remark2})
22
- html = Iconv.iconv('utf-8', 'gbk', response.body).first
23
- html.scan(/[href|src]=("[^"]*.[css|js|gif|jpg]")/).each do |h|
24
- html = html.gsub(h[0], URL+eval(h[0]).gsub('..', ''))
21
+ html = '<html><head></head><body>'
22
+ html += '<form method="post" name="cb_form" action="' + URL_UTF8 + '">'
23
+ parameter = {
24
+ 'v_oid' => v_oid,
25
+ 'v_amount' => v_amount,
26
+ 'v_moneytype' => v_moneytype,
27
+ 'v_mid' => v_mid,
28
+ 'v_url' => v_url,
29
+ 'key' => key,
30
+ 'v_md5info' => v_md5info,
31
+ 'remark2' => remark2
32
+ }
33
+ parameter.each do |key, val|
34
+ html += "<input type='hidden' name='#{key}' value='#{val}' />"
25
35
  end
26
- html
36
+ html += '</form><script type="text/javascript">document.cb_form.submit();</script>'
37
+ html += '</body></html>'
27
38
  end
28
39
 
29
40
  # 功能:自动验证结果
data/struggle.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'struggle'
3
- s.version = '1.3.5'
4
- s.date = '2015-07-14'
3
+ s.version = '1.4.0'
4
+ s.date = '2015-07-15'
5
5
  s.summary = "struggle!"
6
6
  s.description = "vcode,fileupload,pager,func,logistic,pay_gateway,tmagick,html_extend;"
7
7
  s.authors = ["lean"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: struggle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lean
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iconv