reapal 0.9.13 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/reapal/api/api_helper.rb +1 -1
  3. data/lib/reapal/api/money/deposit_query.rb +1 -1
  4. data/lib/reapal/api/money/member_payment_query.rb +46 -0
  5. data/lib/reapal/api/money/sub_account.rb +5 -5
  6. data/lib/reapal/api/money/sub_account_query.rb +1 -1
  7. data/lib/reapal/api/money/withdraw_query.rb +1 -1
  8. data/lib/reapal/api/order/query_by_single_flow_id.rb +1 -0
  9. data/lib/reapal/api/tender/history_tender_info_modify.rb +63 -0
  10. data/lib/reapal/api/tender/refund_guarant_payment_query.rb +42 -0
  11. data/lib/reapal/api/tender/tender_all_cancel.rb +1 -1
  12. data/lib/reapal/api/tender/tender_apply.rb +12 -4
  13. data/lib/reapal/api/tender/tender_apply_modify.rb +77 -0
  14. data/lib/reapal/api/tender/tender_auth_cancel.rb +3 -5
  15. data/lib/reapal/api/tender/tender_auth_query.rb +12 -9
  16. data/lib/reapal/api/tender/tender_close.rb +44 -0
  17. data/lib/reapal/api/tender/tender_finish.rb +14 -13
  18. data/lib/reapal/api/tender/tender_onekey_invest.rb +3 -3
  19. data/lib/reapal/api/tender/tender_onekey_invest_history.rb +50 -0
  20. data/lib/reapal/api/tender/tender_onekey_refund.rb +24 -17
  21. data/lib/reapal/api/tender/tender_repayment_complete.rb +1 -1
  22. data/lib/reapal/api/tender/tender_repayment_project.rb +1 -1
  23. data/lib/reapal/api/user/balance_query.rb +1 -1
  24. data/lib/reapal/api/user/bind_card_query.rb +5 -6
  25. data/lib/reapal/api/user/contract_query.rb +8 -5
  26. data/lib/reapal/api/user/mobile_query.rb +4 -4
  27. data/lib/reapal/api/user/modify_bind_bank_card.rb +1 -1
  28. data/lib/reapal/api/user/onekey_batch_contract.rb +20 -5
  29. data/lib/reapal/api/user/set_history_user_type.rb +44 -0
  30. data/lib/reapal/api/user/undo_bind_bank_card.rb +1 -1
  31. data/lib/reapal/form/{certificate_form.rb → bind_bank_card_form.rb} +9 -10
  32. data/lib/reapal/form/business_auth_form.rb +12 -9
  33. data/lib/reapal/form/close_account_form.rb +42 -0
  34. data/lib/reapal/form/com_contract_form.rb +64 -0
  35. data/lib/reapal/form/deposit_apply_form.rb +2 -3
  36. data/lib/reapal/form/find_trade_password_form.rb +1 -1
  37. data/lib/reapal/form/member_payment_form.rb +51 -0
  38. data/lib/reapal/form/mobile_modify_form.rb +1 -1
  39. data/lib/reapal/form/refund_guarant_payment_form.rb +50 -0
  40. data/lib/reapal/form/shortcut_recharge_form.rb +43 -0
  41. data/lib/reapal/form/signle_tender_transfer_form.rb +76 -0
  42. data/lib/reapal/form/tender_apply_confirm_form.rb +42 -0
  43. data/lib/reapal/form/tender_invest_form.rb +49 -0
  44. data/lib/reapal/form/tender_refund_form.rb +81 -0
  45. data/lib/reapal/form/user_contract_form.rb +46 -0
  46. data/lib/reapal/form/withdraw_apply_form.rb +1 -1
  47. data/lib/reapal/http/communicate.rb +1 -1
  48. data/lib/reapal/http/error_code/tender.rb +16 -0
  49. data/lib/reapal/http/error_code/user.rb +4 -0
  50. data/lib/reapal/version.rb +1 -1
  51. metadata +20 -12
  52. data/lib/reapal/api/money/deposit_apply_api.rb +0 -77
  53. data/lib/reapal/api/money/deposit_confirm_api.rb +0 -57
  54. data/lib/reapal/api/money/deposit_sms_api.rb +0 -52
  55. data/lib/reapal/api/tender/tender_onekey_single_transfer.rb +0 -80
  56. data/lib/reapal/api/user/bank_card_add_sms.rb +0 -65
  57. data/lib/reapal/api/user/bank_card_add_sms_again.rb +0 -47
  58. data/lib/reapal/api/user/bank_card_add_sms_confirm.rb +0 -46
  59. data/lib/reapal/api/user/onekey_com_contract.rb +0 -81
  60. data/lib/reapal/api/user/onekey_contract.rb +0 -52
@@ -0,0 +1,76 @@
1
+ # coding: utf-8
2
+
3
+ module Reapal
4
+ module Form
5
+ module SignleTenderTransferForm
6
+
7
+ # 3.11 债权转让
8
+ #
9
+ # @param flow_id [String] 业务订单号
10
+ # @param tender_no [String] 转让方原投资标的号
11
+ # @param trans_capital [BigDecimal] 转让人出让的本金
12
+ # @param money [BigDecimal] 债权转让承接人应支付金额
13
+ # @param trans_contracts [String] 债权转让方在存管系统签约的协议号
14
+ # @param into_contracts [String] 债权承接方在存管系统签约的协议号
15
+ # @param transfer_type [String] 债转类型,传1表示首次债转,即转让人(transContracts)为tenderNo指代标的原始投资人,传2表示第N次债转,转让人(transContracts)并非原标的投资人
16
+ # @param invest_order [String] 原投资订单号,若transferType为1时,即首次债转时必传
17
+ # @param org_transfer_order [String] 原债转订单号,若transferType 为2时,即N次债转时必传
18
+ # @param return_url [String] 回调 url
19
+ # @param notify_url [String] 通知 url
20
+ # @param busway [String] 00:PC端;01:手机端;02:Pad端;03:其它
21
+ # @param fee [BigDecimal] 手续费 默认为空
22
+ # @param fee_type [String] 手续费收取方向。 手续费收取方向 1 收取转让方,2 收取承接方 。手续费不为空时此字段必传,手续费为空时此字段不传
23
+ # @param remark [String] 备注 默认为空
24
+ #
25
+ # @return [ Hash ] 结果集
26
+ # * :form_method
27
+ # * :method
28
+ # * :url
29
+ # * :form_data
30
+ # * :merchant_id
31
+ # * :encryptkey
32
+ # * :data
33
+ #
34
+ def single_tender_transfer_form(flow_id,
35
+ tender_no,
36
+ trans_capital,
37
+ money,
38
+ trans_contracts,
39
+ into_contracts,
40
+ transfer_type,
41
+ invest_order,
42
+ org_transfer_order,
43
+ return_url,
44
+ notify_url,
45
+ busway = '01',
46
+ fee = '',
47
+ fee_type = '',
48
+ remark = '')
49
+ service = 'reapal.trust.signleTenderTransfer'
50
+ post_path = '/reagw/tender/rest.htm'
51
+
52
+ params = {
53
+ orderNo: flow_id,
54
+ tenderNo: tender_no,
55
+ transCapital: trans_capital,
56
+ amount: money,
57
+ transContracts: trans_contracts,
58
+ intoContracts: into_contracts,
59
+ fee: fee,
60
+ feeType: fee_type,
61
+ transferType: transfer_type,
62
+ investOrder: invest_order,
63
+ orgTransferOrder: org_transfer_order,
64
+ returnUrl: return_url,
65
+ notifyUrl: notify_url,
66
+ busway: busway,
67
+ remark: remark,
68
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
69
+ }
70
+
71
+ get_form_data(service, params, post_path)
72
+ end
73
+
74
+ end # module
75
+ end
76
+ end
@@ -0,0 +1,42 @@
1
+ module Reapal
2
+ module Form
3
+ module TenderApplyConfirmForm
4
+
5
+ # 3.2 发标确认
6
+ #
7
+ # @param flow_id [ String ] 订单号
8
+ # @param tender_no [ String ] 标的号
9
+ # @param return_url [String] 回调 url
10
+ # @param notify_url [String] 通知 url
11
+ # @param bus_way [ String ] 00:PC端;01:手机端;02:Pad端;03:其它
12
+ # @param remark [ String ] 备注
13
+ #
14
+ # @return [ Hash ] 结果集
15
+ # * :form_method
16
+ # * :method
17
+ # * :url
18
+ # * :form_data
19
+ # * :merchant_id
20
+ # * :encryptkey
21
+ # * :data
22
+ #
23
+ def tender_apply_confirm_form(flow_id, tender_no, return_url, notify_url, bus_way='01', remark=nil)
24
+ service = 'reapal.trust.tenderApplyConfirm'
25
+ post_path = '/reagw/tender/rest.htm'
26
+
27
+ params = {
28
+ orderNo: flow_id,
29
+ tenderNo: tender_no,
30
+ returnUrl: return_url,
31
+ notifyUrl: notify_url,
32
+ busway: bus_way,
33
+ remark: remark,
34
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
35
+ }
36
+
37
+ get_form_data(service, params, post_path)
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,49 @@
1
+ module Reapal
2
+ module Form
3
+ module TenderInvestForm
4
+
5
+ # 3.4 投标
6
+ #
7
+ # @param flow_id [ String ] 订单号
8
+ # @param tender_no [ String ] 标的号
9
+ # @param amount [ Number ] 金额
10
+ # @param invest_contract [ String ] 投资方协议号
11
+ # @param return_url [String] 回调 url
12
+ # @param notify_url [String] 通知 url
13
+ # @param coupon_amt [ Number ] 红包抵用券
14
+ # @param remark [ String ] 备注
15
+ #
16
+ # @return [ Hash ] 结果集
17
+ # * :form_method
18
+ # * :method
19
+ # * :url
20
+ # * :form_data
21
+ # * :merchant_id
22
+ # * :encryptkey
23
+ # * :data
24
+ #
25
+ def tender_invest_form(flow_id, tender_no,
26
+ amount, invest_contract,
27
+ return_url, notify_url,
28
+ coupon_amt=nil, remark='')
29
+ service = 'reapal.trust.tenderInvest'
30
+ post_path = '/reagw/tender/rest.htm'
31
+
32
+ params = {
33
+ orderNo: flow_id,
34
+ tenderNo: tender_no,
35
+ amount: amount,
36
+ investContracts: invest_contract,
37
+ returnUrl: return_url,
38
+ notifyUrl: notify_url,
39
+ busway: '00',
40
+ remark: remark,
41
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
42
+ }
43
+
44
+ get_form_data(service, params, post_path)
45
+ end
46
+
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,81 @@
1
+ # coding: utf-8
2
+
3
+ module Reapal
4
+ module Form
5
+ module TenderRefundForm
6
+
7
+ # 还款
8
+ #
9
+ # @param flow_id [ String ] 还款订单号
10
+ # @param tender_no [ String ] 商户系统标的的标号
11
+ # @param debit_contracts [ String ] 借款方协议号
12
+ # @param debit_details [ Array ] 借款方还款明细
13
+ # * :seriaNo [String] 还款流水号
14
+ # * :payeeContracts [String] 收款方协议号
15
+ # * :tradeAmount [Number] 还款总金额
16
+ # * :feeAmount [Number] 还款手续费
17
+ # * :defAmount [Number] 还款罚息
18
+ # * :amount [Number] 还款本金
19
+ # * :intAmt [Number] 还款利息
20
+ # * :remark [String] 备注
21
+ # @param periods [ Integer ] 还款期数
22
+ # @param return_url [ String ] 回调 url
23
+ # @param notify_url [ String ] 通知 url
24
+ # @param fee_details [ Array ] 手续费分账明细
25
+ # * :seriaNo [String] 还款分账流水号
26
+ # * :payeeContracts [String] 收款方协议号,只能是平台
27
+ # * :feeType [String] 手续费类型 01 平台收借款方手续费,不能大于标的备案的手续费 02 罚息,每种类型只能有一条记录
28
+ # * :amount [String] 金额
29
+ # * :remark [String] 备注
30
+ # @param defray_details [ Array ] 担保方分账明细
31
+ # * :seriaNo [String] 还款流水号
32
+ # * :payeeContracts [String] 担保方协议号
33
+ # * :amount [String] 金额
34
+ # * :remark [String] 备注
35
+ # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
36
+ # @param remark [ String ] 备注
37
+ #
38
+ # @return [ Hash ] 结果集
39
+ # * :form_method
40
+ # * :method
41
+ # * :url
42
+ # * :form_data
43
+ # * :merchant_id
44
+ # * :encryptkey
45
+ # * :data
46
+ #
47
+ def tender_refund_form(flow_id,
48
+ tender_no,
49
+ debit_contracts,
50
+ debit_details,
51
+ periods,
52
+ return_url,
53
+ notify_url,
54
+ fee_details = [],
55
+ defray_details = [],
56
+ busway = '01',
57
+ remark = '')
58
+ service = 'reapal.trust.tenderRefund'
59
+ post_path = '/reagw/tender/rest.htm'
60
+
61
+ params = {
62
+ orderNo: flow_id,
63
+ tenderNo: tender_no,
64
+ debitContracts: debit_contracts,
65
+ debitDetails: debit_details,
66
+ feeDetails: fee_details,
67
+ defrayDetails: defray_details,
68
+ periods: periods,
69
+ returnUrl: return_url,
70
+ notifyUrl: notify_url,
71
+ busway: busway,
72
+ remark: remark,
73
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
74
+ }
75
+
76
+ get_form_data(service, params, post_path)
77
+ end
78
+
79
+ end # module
80
+ end
81
+ end
@@ -0,0 +1,46 @@
1
+ module Reapal
2
+ module Form
3
+ module UserContractForm
4
+
5
+ # 1.1 个人签约
6
+ #
7
+ # @param flow_id [ String ] 订单号
8
+ # @param true_name [ String ] 真实姓名
9
+ # @param identity_id [ String ] 身份证号
10
+ # @param user_type [ String ] 01:出借人 02:借款人 03:担保人 04:受托方
11
+ # @param return_url [String] 回调 url
12
+ # @param notify_url [String] 通知 url
13
+ # @param bus_way [ String ] 00:PC端;01:手机端;02:Pad端;03:其它
14
+ # @param remark [ String ] 备注
15
+ #
16
+ # @return [ Hash ] 结果集
17
+ # * :form_method
18
+ # * :method
19
+ # * :url
20
+ # * :form_data
21
+ # * :merchant_id
22
+ # * :encryptkey
23
+ # * :data
24
+ #
25
+ def user_contract_form(flow_id, true_name, identity_id, user_type, return_url, notify_url, bus_way='01', remark='')
26
+ service = 'reapal.trust.userContract'
27
+ post_path = '/reagw/agreement/agree.htm'
28
+
29
+ params = {
30
+ orderNo: flow_id,
31
+ userName: true_name,
32
+ userIdentity: identity_id,
33
+ userType: user_type,
34
+ returnUrl: return_url,
35
+ notifyUrl: notify_url,
36
+ busway: bus_way,
37
+ remark: remark,
38
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
39
+ }
40
+
41
+ get_form_data(service, params, post_path)
42
+ end
43
+
44
+ end
45
+ end
46
+ end
@@ -4,7 +4,7 @@ module Reapal
4
4
  module Form
5
5
  module WithdrawApplyForm
6
6
 
7
- # 2.7 提现申请
7
+ # 2.4 提现申请
8
8
  #
9
9
  # @param contract [String] 用户协议
10
10
  # @param flow_id [String] 订单号
@@ -3,7 +3,7 @@ module Reapal
3
3
  module Http
4
4
 
5
5
  SIGN_TYPE = '0' # 0 表示 md5
6
- VERSION = '1.0' # 版本号
6
+ VERSION = '3.0' # 版本号
7
7
 
8
8
  def self.post(service, params, config, post_path, version=VERSION)
9
9
  version = VERSION if version.nil?
@@ -66,6 +66,22 @@ module Reapal
66
66
  1009 1010 1011 1012 1013 0001) | tender_common
67
67
  end
68
68
 
69
+ def self.tender_apply_modify
70
+ @_tender_apply_modify ||= [] | tender_common
71
+ end
72
+
73
+ def self.refund_guarant_payment_query
74
+ @_refund_guarant_payment_query ||= [] | tender_common
75
+ end
76
+
77
+ def self.tender_close
78
+ @_tender_close ||= [] | tender_common
79
+ end
80
+
81
+ def self.history_tender_info_modify
82
+ @_history_tender_info_modify ||= [] | tender_common
83
+ end
84
+
69
85
  end # module ErrorCode
70
86
  end
71
87
  end
@@ -35,6 +35,10 @@ module Reapal
35
35
  0362 0363) | contract_common
36
36
  end
37
37
 
38
+ def self.member_payment_query
39
+ @_member_payment_query ||= contract_common
40
+ end
41
+
38
42
  end # module ErrorCode
39
43
  end
40
44
  end
@@ -1,3 +1,3 @@
1
1
  module Reapal
2
- VERSION = "0.9.13"
2
+ VERSION = "0.10.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.9.13
4
+ version: 0.10.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-12-15 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,48 +125,56 @@ files:
125
125
  - bin/setup
126
126
  - lib/reapal.rb
127
127
  - lib/reapal/api/api_helper.rb
128
- - lib/reapal/api/money/deposit_apply_api.rb
129
- - lib/reapal/api/money/deposit_confirm_api.rb
130
128
  - lib/reapal/api/money/deposit_query.rb
131
- - lib/reapal/api/money/deposit_sms_api.rb
129
+ - lib/reapal/api/money/member_payment_query.rb
132
130
  - lib/reapal/api/money/sub_account.rb
133
131
  - lib/reapal/api/money/sub_account_query.rb
134
132
  - lib/reapal/api/money/withdraw_query.rb
135
133
  - lib/reapal/api/order/query_by_flow_id.rb
136
134
  - lib/reapal/api/order/query_by_single_flow_id.rb
137
135
  - lib/reapal/api/order/tender_serial_no_query.rb
136
+ - lib/reapal/api/tender/history_tender_info_modify.rb
137
+ - lib/reapal/api/tender/refund_guarant_payment_query.rb
138
138
  - lib/reapal/api/tender/tender_all_cancel.rb
139
139
  - lib/reapal/api/tender/tender_apply.rb
140
+ - lib/reapal/api/tender/tender_apply_modify.rb
140
141
  - lib/reapal/api/tender/tender_auth_cancel.rb
141
142
  - lib/reapal/api/tender/tender_auth_query.rb
143
+ - lib/reapal/api/tender/tender_close.rb
142
144
  - lib/reapal/api/tender/tender_finish.rb
143
145
  - lib/reapal/api/tender/tender_onekey_invest.rb
146
+ - lib/reapal/api/tender/tender_onekey_invest_history.rb
144
147
  - lib/reapal/api/tender/tender_onekey_refund.rb
145
- - lib/reapal/api/tender/tender_onekey_single_transfer.rb
146
148
  - lib/reapal/api/tender/tender_repayment_complete.rb
147
149
  - lib/reapal/api/tender/tender_repayment_project.rb
148
150
  - lib/reapal/api/user/balance_query.rb
149
- - lib/reapal/api/user/bank_card_add_sms.rb
150
- - lib/reapal/api/user/bank_card_add_sms_again.rb
151
- - lib/reapal/api/user/bank_card_add_sms_confirm.rb
152
151
  - lib/reapal/api/user/bind_card_query.rb
153
152
  - lib/reapal/api/user/contract_query.rb
154
153
  - lib/reapal/api/user/mobile_query.rb
155
154
  - lib/reapal/api/user/modify_bind_bank_card.rb
156
155
  - lib/reapal/api/user/onekey_batch_contract.rb
157
- - lib/reapal/api/user/onekey_com_contract.rb
158
- - lib/reapal/api/user/onekey_contract.rb
156
+ - lib/reapal/api/user/set_history_user_type.rb
159
157
  - lib/reapal/api/user/undo_bind_bank_card.rb
160
158
  - lib/reapal/client.rb
161
159
  - lib/reapal/encrypt/aes.rb
162
160
  - lib/reapal/encrypt/rsa.rb
163
161
  - lib/reapal/extensions.rb
162
+ - lib/reapal/form/bind_bank_card_form.rb
164
163
  - lib/reapal/form/business_auth_form.rb
165
- - lib/reapal/form/certificate_form.rb
164
+ - lib/reapal/form/close_account_form.rb
165
+ - lib/reapal/form/com_contract_form.rb
166
166
  - lib/reapal/form/deposit_apply_form.rb
167
167
  - lib/reapal/form/find_trade_password_form.rb
168
168
  - lib/reapal/form/form_helper.rb
169
+ - lib/reapal/form/member_payment_form.rb
169
170
  - lib/reapal/form/mobile_modify_form.rb
171
+ - lib/reapal/form/refund_guarant_payment_form.rb
172
+ - lib/reapal/form/shortcut_recharge_form.rb
173
+ - lib/reapal/form/signle_tender_transfer_form.rb
174
+ - lib/reapal/form/tender_apply_confirm_form.rb
175
+ - lib/reapal/form/tender_invest_form.rb
176
+ - lib/reapal/form/tender_refund_form.rb
177
+ - lib/reapal/form/user_contract_form.rb
170
178
  - lib/reapal/form/withdraw_apply_form.rb
171
179
  - lib/reapal/http/communicate.rb
172
180
  - lib/reapal/http/decode.rb