rock_fintech 0.1.0 → 0.2.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: 9e3c052086ae7491be108d049a48c47e113d5f7d
4
- data.tar.gz: 93f6cca9105983cb34fc47fb52d471461b359a79
3
+ metadata.gz: dae9b1ee933ea6e45bbf4b29d522910b223ae7a5
4
+ data.tar.gz: 52bffc817fd9de839e8850cedbbd857dae40d358
5
5
  SHA512:
6
- metadata.gz: 61352c706ce4de7eb8f054a9b9e8a4b1f804be2c5eb2a43b7238040de7bf26cccf1446f74dde596845a79816d0db15cf4ab462ed5912c1c5dce78fe25f80f9c9
7
- data.tar.gz: 10dfecf9a1970d1f59561be29ca0f6987a5d8c49a12d5e0c96cdc97f86e51f9ed1035d6a651efd609f13654f0dfcebccc186f8ccf2a48f31fe8bc3b640a49f04
6
+ metadata.gz: 40a47e084df31987e9126891f7905d22570c59b54ceda390d5b72c1e72cef95f714b7e98d66dc446b062d36f35004b1f6e881338f40b0f3844b9bfbdbde30652
7
+ data.tar.gz: 3cff0a39b61a0f852482651c5caac6917422df93979644c947b65b3379f63de1d1571dd50a56e66daf5be29d695dad3a56060d0d635d02466942b8bba65fb078
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rock_fintech (0.1.0)
4
+ rock_fintech (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,10 +21,16 @@ module RockFintech
21
21
 
22
22
  if :operate == request_type
23
23
  # 向服务器发送操作,超时类的都应该当 pending 处理
24
- return res if response.http_pending?
24
+ if response.http_pending?
25
+ RockFintech.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
26
+ return res
27
+ end
25
28
  elsif :query == request_type
26
29
  # 查询类 api,http 没成功都返回 pending
27
- return res unless response.http_success?
30
+ unless response.http_success?
31
+ RockFintech.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
32
+ return res
33
+ end
28
34
  else
29
35
  raise '未知的请求类型,请选择设置:操作类(:operate)/查询类(:query)'
30
36
  end
@@ -32,11 +38,15 @@ module RockFintech
32
38
  # 确定的错误
33
39
  if fail_codes.include?(response.data[:code])
34
40
  res[:result] = 'F'
41
+ RockFintech.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
35
42
  return res
36
43
  end
37
44
 
38
45
  # 其余 api 错误不知道
39
- return res unless response.data[:code].nil?
46
+ unless response.data[:code].nil?
47
+ RockFintech.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
48
+ return res
49
+ end
40
50
 
41
51
  # 确定的成功返回码
42
52
  if success_codes.include?(response.data[:code])
@@ -5,6 +5,11 @@ module RockFintech
5
5
  module SignBorrowerP
6
6
  # 借款人放款手续费和还款手续费签约
7
7
  #
8
+ # @param payment_start_time [ Time ] 放款手续费签约开始时间
9
+ # @param repayment_start_time [ Time ] 还款签约开始时间
10
+ # @param payment_end_time [ Time ] 放款手续费签约结束时间
11
+ # @param repayment_end_time [ Time ] 还款签约结束时间
12
+ #
8
13
  # @return [ Hash ] 结果集
9
14
  # * :result [String] "S"/"F"/"P"
10
15
  # * :request_params [Hash] 请求参数
@@ -27,10 +32,10 @@ module RockFintech
27
32
  payment_amount: payment_amount,
28
33
  repayment_amount: repayment_amount,
29
34
  out_serial_no: out_serial_no,
30
- payment_start_time: payment_start_time,
31
- repayment_start_time: repayment_start_time,
32
- payment_end_time: payment_end_time,
33
- repayment_end_time: repayment_end_time,
35
+ payment_start_time: payment_start_time.to_i,
36
+ repayment_start_time: repayment_start_time.to_i,
37
+ payment_end_time: payment_end_time.to_i,
38
+ repayment_end_time: repayment_end_time.to_i,
34
39
  callback_url: callback_url,
35
40
  success_url: success_url,
36
41
  fail_url: fail_url,
@@ -5,6 +5,9 @@ module RockFintech
5
5
  module SignTransferP
6
6
  # 转让方转让手续费签约
7
7
  #
8
+ # @param start_time [ Time ] 开始时间
9
+ # @param end_time [ Time ] 结束时间
10
+ #
8
11
  # @return [ Hash ] 结果集
9
12
  # * :result [String] "S"/"F"/"P"
10
13
  # * :request_params [Hash] 请求参数
@@ -25,8 +28,8 @@ module RockFintech
25
28
  card_no: card_no,
26
29
  out_serial_no: out_serial_no,
27
30
  amount: amount,
28
- start_time: start_time,
29
- end_time: end_time,
31
+ start_time: start_time.to_i,
32
+ end_time: end_time.to_i,
30
33
  callback_url: callback_url,
31
34
  success_url: success_url,
32
35
  fail_url: fail_url,
@@ -20,7 +20,7 @@ module RockFintech
20
20
  mobile, amount, fee, callback_url, channel_flag, channel_code, union_bank_code,
21
21
  open_bank_code, bank_name_en, bank_name_cn, bank_province, bank_city,
22
22
  success_url, fail_url, devise='000001', remark='')
23
- service = 'recharge_p'
23
+ service = 'withdraw_p'
24
24
 
25
25
  params = {
26
26
  order_no: order_no,
@@ -3,11 +3,11 @@ module RockFintech
3
3
  module Form
4
4
  module Trade
5
5
  module BidApplyP
6
- # 绑卡网关接口
6
+ # 投资人投标申请
7
7
  #
8
- # @param interest_date [ Time ] 起息日 YYYYMMDD
9
- # @param end_date [ Time ] 产品到期日 YYYYMMDD
10
- # @param transact_date [ Time ] 交易时间 YYYYMMDD
8
+ # @param interest_date [ Time ] 起息日
9
+ # @param end_date [ Time ] 产品到期日
10
+ # @param transact_date [ Time ] 交易时间
11
11
  #
12
12
  # @return [ Hash ] 结果集
13
13
  # * :result [String] "S"/"F"/"P"
@@ -37,7 +37,7 @@ module RockFintech
37
37
  frozen_flag: frozen_flag,
38
38
  use_bonus: use_bonus,
39
39
  bonus_amount: bonus_amount,
40
- transact_date: transact_date.strftime('%Y%m%d'),
40
+ transact_date: '' == transact_date ? '' : transact_date.strftime('%Y%m%d'),
41
41
  third_custom: third_custom,
42
42
  success_url: success_url,
43
43
  fail_url: fail_url,
@@ -16,7 +16,7 @@ module RockFintech
16
16
  end
17
17
 
18
18
  def self.bid_apply_p
19
- @_bid_apply_p ||= []
19
+ @_bid_apply_p ||= ['RD001025']
20
20
  end
21
21
  end # module ErrorCode
22
22
  end # module http
@@ -36,7 +36,7 @@ module RockFintech
36
36
  end
37
37
 
38
38
  def http_success?
39
- http_response && http_response.is_a?(Net::HTTPSuccess)
39
+ http_response && /^2/ =~ http_response.code.to_s
40
40
  end
41
41
 
42
42
  def http_fail?
@@ -1,3 +1,3 @@
1
1
  module RockFintech
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chenpengyu