rock_fintech 0.7.0 → 0.8.0

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: e4ac83e25979452d343c1cf36d55b0efff9240e6
4
- data.tar.gz: 6d3c6a8e9a9782ecd60ba201f5c38bb5288486a0
3
+ metadata.gz: 5d2b0b4b8458411c47cdd65f0c89f669ec135dd7
4
+ data.tar.gz: f2008db08cbfff204f6823876375d67ba18376b4
5
5
  SHA512:
6
- metadata.gz: 4c080ccf54019aadf48ec660ef45ef5c6a5e1a471eef07d74a46bb42cfe1edea9d3130f682d225384aaa7822ecea65564d21866b74aedf95b61c7f4862898edb
7
- data.tar.gz: d661a68a43c4151915961b6517a1828fe3876b1ef94aa577c026708ac3118363405cda84b51061db9c992c3520df569d89550f431dd5bdddcec559dcf9a0bfe1
6
+ metadata.gz: 71aca6e9e287eab2e633aa2e15da02f6575c0cc79279cabd6ab5d6e4d86974e1f82dba9bd29c955d31838e6a0d05d6e0404589031a77e9e6822cc9fdbc8e39e6
7
+ data.tar.gz: 2499233a4e6d9bd321a613e27a4ea383850da1d88f8c1e590e59435598a6da75d58801829dda7642d829dcb82063f68aba6b231763a93cb9cbc8d8a49cc2757f
data/.gitignore CHANGED
@@ -53,3 +53,4 @@ build-iPhoneSimulator/
53
53
 
54
54
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
55
55
  .rvmrc
56
+ spec/tmp_spec.rb
@@ -60,7 +60,7 @@ module RockFintech
60
60
  custom: remark,
61
61
  }
62
62
 
63
- res = operate_post(:operate, service, params, Http::ErrorCode.account_transaction_query, ["RD000000"] )
63
+ res = operate_post(:query, service, params, Http::ErrorCode.account_transaction_query, ["RD000000"] )
64
64
 
65
65
  res
66
66
  end
@@ -18,7 +18,7 @@ module RockFintech
18
18
  response = request.post
19
19
 
20
20
  res = RockFintech::Utils.api_result(params, response)
21
-
21
+
22
22
  if :operate == request_type
23
23
  # 向服务器发送操作,超时类的都应该当 pending 处理
24
24
  if response.http_pending?
@@ -57,7 +57,7 @@ module RockFintech
57
57
  batch_date, notify_url, items, remark='')
58
58
 
59
59
 
60
- service = 'batch_payment_b'
60
+ service = 'batch_repayment_b'
61
61
 
62
62
  params = {
63
63
  batch_count: batch_count,
@@ -63,15 +63,7 @@ module RockFintech
63
63
  end
64
64
 
65
65
  def flow_id
66
- if @params[:out_serial_no]
67
- @params[:out_serial_no]
68
- elsif @params[:serial_no]
69
- @params[:serial_no]
70
- elsif @params[:order_no]
71
- @params[:order_no]
72
- else
73
- nil
74
- end
66
+ @params[:out_serial_no] || @params[:serial_no] || @params[:order_no] || @params[:batch_no]
75
67
  end
76
68
 
77
69
  def identifier
@@ -11,7 +11,7 @@ module RockFintech
11
11
  self.data_valid = true
12
12
 
13
13
  params.each do |key, value|
14
- instance_variable_set("@#{key}", value)
14
+ self.instance_variable_set("@#{key}", value)
15
15
  end
16
16
 
17
17
  self.data = {} if self.data.nil? # 默认一定要有
@@ -20,6 +20,7 @@ module RockFintech
20
20
  self.data[:code] = 'sign_valid_fail'
21
21
  self.data[:msg] = '数据签名错误'
22
22
  end
23
+
23
24
  end
24
25
 
25
26
  def [] key
@@ -23,14 +23,17 @@ module RockFintech
23
23
  elsif v.kind_of?(Array)
24
24
  if v[0].kind_of?(Hash) # 如果是 hash 数组对元素接着 serialize
25
25
  v.each_with_index{ |ele, index|
26
- v[index] = ele.to_json #serialize(ele)
26
+ ele.delete('sign')
27
+ ele.delete(:sign)
28
+ ele = Hash[ele.sort]
29
+ v[index] = ele.map{|k,v| "#{k}=#{v}"}.join('&')
27
30
  }
31
+ data[k] = v.join('&')
28
32
  else # 如果是普通元素数组
29
33
  data[k] = v.join('&')
30
34
  end
31
35
  end
32
36
  }
33
-
34
37
  data.map{|k,v| "#{k}=#{v}"}.join('&')
35
38
  end # serialize
36
39
 
@@ -1,3 +1,3 @@
1
1
  module RockFintech
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_fintech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chenpengyu