reapal 0.3.0 → 0.9.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: 234567f57cee288220964fc4bf120ae802400e36
4
- data.tar.gz: 6362601c991f78ca39ee6d3ab0f80048fe1de8f8
3
+ metadata.gz: 754d2c42eb23d1e78d4d431f8a4ec6031433f43e
4
+ data.tar.gz: 6e31f13581fb4809ea9f2eba0004e5464cc19620
5
5
  SHA512:
6
- metadata.gz: 75214217a309e67040291e008ed14f0dc5770fcc308b7a14b16d4913c2c3bf48fc65c3467d67dc955bbefb91051cbc4555536f5a29799fdf14bbc148770d7d62
7
- data.tar.gz: 22dc9b134b5ef4a0fab39886be7b84cedc57ce5ef4987072caadc390b99a5b004accc714e1d8695048c521953781129ddb26404c449ee4016a2a2c7306095c4d
6
+ metadata.gz: 356e3ff37c0794855d8f5116498ecd9f04a3b84c983bae3a32cd71011bbac976ae36089dc20ada2d5e2fd82d9be5b20fbadfb94229cec0730472150aed2d889e
7
+ data.tar.gz: 723fc6770d66d8c5f954d2705381ced32018d99aa600c284ef5307db1e0c4ca2d2e387e35271f883d244f2f05d9a766d636e5fbd9c0e1583972557620d082d1a
File without changes
File without changes
@@ -43,7 +43,7 @@ module Reapal
43
43
  if 'S' == res[:result] && '0001' == res[:data][:resultCode]
44
44
  res[:result] = 'F'
45
45
  end
46
-
46
+
47
47
  res
48
48
  end
49
49
 
@@ -5,7 +5,7 @@ module Reapal
5
5
  module Money
6
6
  module SubAccountQuery
7
7
 
8
- # 2.8 企业分账查询(API)
8
+ # 2.12 企业分账查询(API)
9
9
  #
10
10
  # @param sub_account_flow_id [ String ] 分账订单号
11
11
  # @param serial_no [ String ] 分账流水号(传空串表示该订单批量查询)
@@ -33,7 +33,7 @@ module Reapal
33
33
  params = {
34
34
  orderNo: sub_account_flow_id,
35
35
  serialNo: serial_no,
36
- queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
36
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
37
37
  }
38
38
 
39
39
  operate_post(:query, service, params, post_path, Http::ErrorCode.sub_account_query, ['0000'])
@@ -6,11 +6,10 @@ module Reapal
6
6
 
7
7
  # 4.1 流水号查询(API)
8
8
  #
9
- # @param serial_no [ String ] 业务流水号(对应满标、还款、债权转让分账明细的流水号)
9
+ # @param serial_no [ String ] 业务流水号(对应满标、还款分账明细的流水号)
10
10
  # @param service_type [Symbol] 查询类型,取值如下
11
11
  # * :tender_finish 满标查询
12
12
  # * :tender_refund 还款查询
13
- # * :tender_transfer 债权转让查询查询
14
13
  #
15
14
  # @return [ Hash ] 结果集
16
15
  # * :result [String] 业务结果:'S/F/P'
@@ -28,8 +27,6 @@ module Reapal
28
27
  'reapal.trust.tenderFinishSQuery'
29
28
  when :tender_refund
30
29
  'reapal.trust.tenderRefundSQuery'
31
- when :tender_transfer
32
- 'reapal.trust.tenderTransferSQuery'
33
30
  else
34
31
  nil
35
32
  end
@@ -40,7 +37,7 @@ module Reapal
40
37
  return res
41
38
  end
42
39
 
43
- post_path = '/reagw/agreement/agreeApi.htm'
40
+ post_path = '/reagw/tender/rest.htm'
44
41
 
45
42
  params = {
46
43
  serialNo: serial_no,
@@ -24,12 +24,12 @@ module Reapal
24
24
  # * :services [String] 授权业务。 02一键投标 ,03 为一键还款 04 一键债转
25
25
  # * :resultCode [String] 结果代码
26
26
  #
27
- def tender_auth_cancel(flow_id, contracts, services, tender_no, busway="01", remark='')
27
+ def tender_auth_cancel(flow_id, contracts, services, tender_no='', busway="01", remark='')
28
28
  service = 'reapal.trust.authCancel'
29
29
  post_path = '/reagw/user/restApi.htm'
30
30
 
31
31
  params = {
32
- cancelOrderNo: flow_id,
32
+ cancleOrderNo: flow_id,
33
33
  contracts: contracts,
34
34
  services: services,
35
35
  busway: busway,
@@ -17,7 +17,6 @@ module Reapal
17
17
  # * :error_code [String] 错误代号
18
18
  # * :error_msg [String] 错误信息
19
19
  # * :data: 具体业务返回信息
20
- # * :orderNo [String] 操作订单号
21
20
  # * :contracts [String] 用户协议号
22
21
  # * :servicesDetail [JSON] 授权明细
23
22
  # * :services [String] 授权服务。 02一键投标 ,03 为一键还款 04 一键债转
@@ -50,7 +50,12 @@ module Reapal
50
50
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
51
51
  }
52
52
 
53
- operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_finish, ['0000'])
53
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_finish, ['0000'])
54
+ if 'S' == res[:result] && '0001' == res[:data][:resultCode]
55
+ res[:result] = 'F'
56
+ end
57
+
58
+ res
54
59
  end
55
60
 
56
61
  end # module TenderFinish
@@ -43,7 +43,13 @@ module Reapal
43
43
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
44
44
  }
45
45
 
46
- operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_invest, ['0000'])
46
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_invest, ['0000'])
47
+
48
+ if 'S' == res[:result] && '0001' == res[:data][:resultCode]
49
+ res[:result] = 'F'
50
+ end
51
+
52
+ res
47
53
  end
48
54
 
49
55
  end # module TenderOneKeyInvest
@@ -43,8 +43,8 @@ module Reapal
43
43
  tender_no,
44
44
  debit_contracts,
45
45
  debit_details,
46
- invest_details='',
47
- defray_details='',
46
+ invest_details=[],
47
+ defray_details=[],
48
48
  busway='01',
49
49
  remark='')
50
50
  service = 'reapal.trust.onekeyRefund'
@@ -62,7 +62,12 @@ module Reapal
62
62
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
63
63
  }
64
64
 
65
- operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_refund, ['0000'])
65
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_refund, ['0000'])
66
+ if 'S' == res[:result] && '0001' == res[:data][:resultCode]
67
+ res[:result] = 'F'
68
+ end
69
+
70
+ res
66
71
  end
67
72
 
68
73
  end # module TenderOneKeyRefund
@@ -13,7 +13,7 @@ module Reapal
13
13
  # @param money [BigDecimal] 债权转让承接人应支付金额
14
14
  # @param trans_contracts [String] 债权转让方在存管系统签约的协议号
15
15
  # @param into_contracts [String] 债权承接方在存管系统签约的协议号
16
- # @param transfer_type [String] 债转类型
16
+ # @param transfer_type [String] 债转类型,传1表示首次债转,即转让人(transContracts)为tenderNo指代标的原始投资人,传2表示第N次债转,转让人(transContracts)并非原标的投资人
17
17
  # @param invest_order [String] 若transferType为1时,即首次债转时必传
18
18
  # @param org_transfer_order [String] 若transferType 为2时,即N次债转时必传
19
19
  # @param busway [String] 00:PC端;01:手机端;02:Pad端;03:其它
@@ -64,7 +64,12 @@ module Reapal
64
64
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
65
65
  }
66
66
 
67
- operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_single_transfer, ['0000'])
67
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_single_transfer, ['0000'])
68
+ if 'S' == res[:result] && '0001' == res[:data][:resultCode]
69
+ res[:result] = 'F'
70
+ end
71
+
72
+ res
68
73
  end
69
74
 
70
75
  end # module TenderOneKeySingleTransfer
@@ -9,7 +9,7 @@ module Reapal
9
9
  #
10
10
  # @param flow_id [String] 执行还款计划订单号
11
11
  # @param tender_no [String] 商户系统标的号
12
- # @param periods [String] 还款期数
12
+ # @param periods [Integer] 还款期数
13
13
  # @param comp_principal [BigDecimal] 执行还款本金
14
14
  # @param comp_interest [BigDecimal] 执行还款利息
15
15
  # @param comp_poundage [BigDecimal] 执行还款手续费
@@ -36,7 +36,7 @@ module Reapal
36
36
  params = {
37
37
  orderNo: flow_id,
38
38
  tenderNo: tender_no,
39
- projectDetails: project_details.to_json,
39
+ projectDetails: project_details,
40
40
  busway: busway,
41
41
  remark: remark,
42
42
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
@@ -25,12 +25,12 @@ module Reapal
25
25
  # * :type 业务类型 A: 充值和提现; D: 充值; W: 提现
26
26
  # * :is_safety 绑卡类别 0: 普通卡; 1:安全卡
27
27
  # * :is_required_field 分支行信息 0: 省市分支行信息(系统默认信息); 1:用户自己所填信息
28
- # * :account_province 开户行所在省
28
+ # * :account_province 开户行所在省
29
29
  # * :account_city 开户行所在市
30
30
  # * :branch 开户行分行
31
31
  # * :subbranch 开户行支行
32
32
  #
33
- def bind_card_query(contracts, type = "W")
33
+ def bind_card_query(contracts, type='W')
34
34
  service = 'reapal.trust.bindQuery'
35
35
  post_path = '/reagw/user/restApi.htm'
36
36
 
@@ -42,14 +42,23 @@ module Reapal
42
42
 
43
43
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.bind_card, ['0000'])
44
44
 
45
- if 'S' == res[:result]
46
- # TODO: (tony) 返回的银行字符串解析成数据,便于使用方
47
- # res[:data][:bank_cards] = parse_cards_info(res[:data][:bank_cards])
45
+ if 'S' == res[:result] || ('P' == res[:result] && res[:data][:resultCode].nil?)
46
+ res[:result] = 'S'
47
+
48
+ res[:data][:bank_cards] = parse_cards_info(res[:data][:bankCards])
48
49
  end
49
50
 
50
51
  res
51
52
  end
52
53
 
54
+ private
55
+
56
+ def parse_cards_info(bank_cards)
57
+ cards_info = bank_cards.first.split("|")
58
+
59
+ cards_info
60
+ end
61
+
53
62
  end # module
54
63
  end
55
64
  end
@@ -2,7 +2,7 @@
2
2
  module Reapal
3
3
  module Api
4
4
  module User
5
- module ModifyBankCardAddSms
5
+ module ModifyBindBankCard
6
6
 
7
7
  # 1.14 修改绑卡(API)
8
8
  #
@@ -24,14 +24,13 @@ module Reapal
24
24
  # * :flow_id [ String ] 订单号
25
25
  # * :result_code [ String ] 结果代码 0000:申请成功
26
26
  #
27
- def modify_bank_card_add_sms(flow_id,
28
- contracts,
29
- bank_account_no,
30
- account_province,
31
- account_city,
32
- branch,
33
- subbranch)
34
-
27
+ def modify_bind_bank_card(flow_id,
28
+ contracts,
29
+ bank_account_no,
30
+ account_province,
31
+ account_city,
32
+ branch,
33
+ subbranch)
35
34
  service = 'reapal.trust.modifyBindBankCard'
36
35
  post_path = '/reagw/bankcard/modifyBindBankApi.htm'
37
36
 
@@ -5,7 +5,7 @@ module Reapal
5
5
  module User
6
6
  module OnekeyComContract
7
7
 
8
- # 1. 企业一键签约(API)
8
+ # 1.4 企业一键签约(API)
9
9
  #
10
10
  # @param flow_id [ String ] 订单号
11
11
  # @param corp_name [ String ] 法人代表姓名
@@ -42,7 +42,7 @@ module Reapal
42
42
  #
43
43
  def onekey_com_contract(flow_id, corp_name, identity_id, com_name, com_license,
44
44
  lic_start_date, lic_end_date, phone, return_url, notify_url,
45
- email='', busway='01', remark='')
45
+ email, busway='01', remark='')
46
46
  service = 'reapal.trust.comContractAPI'
47
47
  post_path = '/reagw/agreement/agree.htm'
48
48
 
@@ -22,7 +22,7 @@ module Reapal
22
22
  # * :encryptkey
23
23
  # * :data
24
24
  #
25
- def withdraw_apply_form(flow_id, bind_id, contract, return_url, notify_url, terminal_type='mobile')
25
+ def certificate_form(flow_id, bind_id, contract, return_url, notify_url, terminal_type='mobile')
26
26
  service = 'reapal.trust.certificate'
27
27
  post_path = '/reagw/service/depwit.htm'
28
28
 
@@ -5,14 +5,28 @@ module Reapal
5
5
  module ErrorCode
6
6
 
7
7
  def self.deposit_common
8
- @_deposit_common ||= %w(0001 0004)
9
- end
10
-
11
- def self.deposit
12
8
  @_deposit ||= %w(0000 0001 0003 0004 0005 0201 0202 0203 0204 0205
13
9
  0206 0207 0208 0209 1701 1702 1703 1704 1705 1706
14
10
  1707 1708 1709 1710 1711 1712 1713 1714 1801 1802
15
- 1803 1804 1805 1901)
11
+ 1803 1804 1805 1901 1001 1002 1003 1004 1005 1006
12
+ 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
13
+ 1017 1018 1019 1020 1021 1023 1024 1025 1026 1027
14
+ 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
15
+ 1038 1039 1040 1041 1042 1043 1044 1047 1048 1049
16
+ 1050 1051 1088 1115 1806 2001 2002 2003 2004 2005
17
+ 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
18
+ 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025
19
+ 2027 2028 2029 2030 2031 2032 2033 3001 3002 3003
20
+ 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013
21
+ 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023
22
+ 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033
23
+ 3034 3035 3036 3037 3038 3039 3040 3041 3051 3052
24
+ 3053 3054 3056 3057 3058 3059 3060 3061 3062 3063
25
+ 3064 3065 3066 3067 3068 3069 3073 3074 3075 3077
26
+ 3078 3079 3080 3081 3083 3084 3086 3088 3094 3095
27
+ 3096 3097 3098 3099 3100 3135 3136 4001 4002 4003
28
+ 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013
29
+ 4014 4015 4016 4017 4018 4019 6001 6002)
16
30
  end
17
31
 
18
32
  def self.deposit_apply_api
@@ -39,6 +53,15 @@ module Reapal
39
53
  0333 0324 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336
40
54
  0337 0338 0339 0340)
41
55
  end
56
+
57
+ def self.sub_account
58
+ @_sub_account ||= %w(0001 1601 1602 1603 1604 1605 1606 1607)
59
+ end
60
+
61
+ def self.sub_account_query
62
+ @_sub_account_query ||= %w(1608 1609 1610 1611)
63
+ end
64
+
42
65
  end # module ErrorCode
43
66
  end
44
67
  end
@@ -38,11 +38,13 @@ module Reapal
38
38
  end
39
39
 
40
40
  def self.tender_auth_query
41
- @_tender_auth_query ||= [] | tender_common
41
+ @_tender_auth_query ||= %w(1100 1101 1102 1103 1104 1105 1106 1107 1108 1109) | tender_common
42
42
  end
43
43
 
44
44
  def self.tender_auth_cancel
45
- @_tender_auth_cancel ||= [] | tender_common
45
+ @_tender_auth_cancel ||= %w(1301 1302 1303 1304 1305 1306 1307 1308 1309
46
+ 1310 1311 1312 1313 1314 1315 1316 1317 1318
47
+ 1319 1320 1321 1322 1323 1324 1325) | tender_common
46
48
  end
47
49
 
48
50
  def self.tender_finish
@@ -14,7 +14,7 @@ module Reapal
14
14
  '0119', '0120', '0121', '0122', '0123', '0124', '0125', '0126', '0127',
15
15
  '0128', '0129', '0130', '0131', '0132', '0150', '0151', '0152', '0153',
16
16
  '0154', '0155', '0156', '0157', '0158', '0159', '0160', '0161', '0162',
17
- '0163', '0164', '0165', '0166', '0167']
17
+ '0163', '0164', '0165', '0166', '0167', '0525']
18
18
  end
19
19
 
20
20
  def self.contract_query
@@ -26,20 +26,12 @@ module Reapal
26
26
  end
27
27
 
28
28
  def self.bind_card
29
- @_bind_card ||= %w(9060 9065 9083 9084 9085 0017 0210 0302 0303 0328
29
+ @_bind_card ||= %w(9060 9064 9065 9083 9084 9085 0017 0210 0302 0303 0328
30
30
  0329 0330 0332 0333 0335 0339 0340 0341 0342 0343
31
31
  0344 0345 0346 0347 0348 0350 0351 0352 0358 0359
32
32
  0360 0362 0363)
33
33
  end
34
34
 
35
- def self.sub_account
36
- @_sub_account ||= %w(0001 1601 1602 1603 1604 1605 1606 1607)
37
- end
38
-
39
- def self.sub_account_query
40
- @_sub_account_query ||= %w(1608 1609 1610 1611)
41
- end
42
-
43
35
  end # module ErrorCode
44
36
  end
45
37
  end
@@ -1,3 +1,3 @@
1
1
  module Reapal
2
- VERSION = "0.3.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reapal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tony
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -140,9 +140,9 @@ files:
140
140
  - lib/reapal/api/tender/tender_auth_cancel.rb
141
141
  - lib/reapal/api/tender/tender_auth_query.rb
142
142
  - lib/reapal/api/tender/tender_finish.rb
143
- - lib/reapal/api/tender/tender_onkey_invest.rb
144
- - lib/reapal/api/tender/tender_onkey_refund.rb
145
- - lib/reapal/api/tender/tender_onkey_single_transfer.rb
143
+ - lib/reapal/api/tender/tender_onekey_invest.rb
144
+ - lib/reapal/api/tender/tender_onekey_refund.rb
145
+ - lib/reapal/api/tender/tender_onekey_single_transfer.rb
146
146
  - lib/reapal/api/tender/tender_repayment_complete.rb
147
147
  - lib/reapal/api/tender/tender_repayment_project.rb
148
148
  - lib/reapal/api/user/balance_query.rb