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,44 @@
1
+ # coding: utf-8
2
+
3
+ module Reapal
4
+ module Api
5
+ module Tender
6
+ module TenderClose
7
+
8
+ # 3.18 标的关闭
9
+ #
10
+ # @param tender_no [String] 标的号
11
+ # @param busway [String] 设备通道, '00':PC端;'01':手机端(默认);'02':Pad端;'03':其它
12
+ # @param remark [String] 备注
13
+ #
14
+ # @return [ Hash ] 结果集
15
+ # * :result [String] 业务结果:'S/F/P'
16
+ # * :request_params [Hash] 请求参数
17
+ # * :response [Object] 请求返回对象
18
+ # * :error_code [String] 错误代号
19
+ # * :error_msg [String] 错误信息
20
+ # * :data: 具体业务返回信息
21
+ # * :resultCode [String] 结果代码 0000:关闭成功
22
+ #
23
+ def tender_close(tender_no, busway="01", remark='')
24
+ service = 'reapal.trust.tenderClose'
25
+ post_path = '/reagw/tender/rest.htm'
26
+
27
+ params = {
28
+ tenderNo: tender_no,
29
+ busway: busway,
30
+ remark: remark,
31
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
32
+ }
33
+
34
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_close, ['0000'])
35
+
36
+ Reapal.logger.info res
37
+
38
+ res
39
+ end
40
+
41
+ end # module
42
+ end
43
+ end
44
+ end
@@ -5,24 +5,24 @@ module Reapal
5
5
  module Tender
6
6
  module TenderFinish
7
7
 
8
- # 3.8 满标 API
8
+ # 3.7 满标
9
9
  #
10
- # @param flow_id [String] 完成订单号
11
- # @param tender_no [String] 商户系统标的号
12
- # @param debit_contracts [String] 借款方协议号
13
- # @param debit_details [JSON] 借款方分账
10
+ # @param flow_id [ String ] 完成订单号
11
+ # @param tender_no [ String ] 商户系统标的号
12
+ # @param debit_contracts [ String ] 借款方协议号
13
+ # @param invest_details [ Array ] 投资方分账
14
14
  # * :seriaNo [String] 商户流水号
15
- # * :payeeContracts [String] 收款方协议号
15
+ # * :investContracts [String] 投资方协议号
16
16
  # * :amount [BigDecimal] 金额
17
17
  # * :remark [String] 备注
18
- # @param invest_details [JSON] 投资方分账
18
+ # @param fee_details [ Array ] 手续费分账
19
19
  # * :seriaNo [String] 商户流水号
20
- # * :investContracts [String] 投资方协议号
21
20
  # * :payeeContracts [String] 收款方协议号
21
+ # * :feeType [String] 01 收借款人手续费【包括平台和担保方,共享发标时的手续费】 02 受托支付
22
22
  # * :amount [BigDecimal] 金额
23
23
  # * :remark [String] 备注
24
- # @param busway [String] 设备通道, '00':PC端;'01':手机端(默认);'02':Pad端;'03':其它
25
- # @param remark [String] 备注
24
+ # @param busway [ String ] 设备通道, '00':PC端;'01':手机端(默认);'02':Pad端;'03':其它
25
+ # @param remark [ String ] 备注
26
26
  #
27
27
  # @return [ Hash ] 结果集
28
28
  # * :result [String] 业务结果:'S/F/P'
@@ -34,8 +34,9 @@ module Reapal
34
34
  # * :orderNo [String] 完成订单号
35
35
  # * :resultCode [String] 结果代码
36
36
  #
37
- def tender_finish(flow_id, tender_no, debit_contracts, debit_details,
38
- invest_details, busway='01', remark='')
37
+ def tender_finish(flow_id, tender_no, debit_contracts,
38
+ invest_details, fee_details=[],
39
+ busway='01', remark='')
39
40
  service = 'reapal.trust.tenderFinish'
40
41
  post_path = '/reagw/tender/rest.htm'
41
42
 
@@ -43,7 +44,7 @@ module Reapal
43
44
  orderNo: flow_id,
44
45
  tenderNo: tender_no,
45
46
  debitContracts: debit_contracts,
46
- debitDetails: debit_details,
47
+ feeDetails: fee_details,
47
48
  investDetails: invest_details,
48
49
  busway: busway,
49
50
  remark: remark,
@@ -5,14 +5,14 @@ module Reapal
5
5
  module Tender
6
6
  module TenderOneKeyInvest
7
7
 
8
- # 3.6 一键投标
8
+ # 3.5 一键投标
9
9
  #
10
10
  # @param flow_id [ String ] 投标订单号
11
11
  # @param tender_no [ String ] 投标的标号
12
12
  # @param amount [ BigDecimal ] 自费金额
13
13
  # @param coupon_amt [ BigDecimal ] 红包/抵用券 ,该参数可不传,或 > 0
14
14
  # @param invest_contracts [ String ] 投资方协议号
15
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
15
+ # @param busway [ String ] 设备通道,默认手机端 00:PC端;01:手机端;02:Pad端;03:其它
16
16
  # @param remark [ String ] 备注
17
17
  #
18
18
  # @return [ Hash ] 结果集
@@ -43,7 +43,7 @@ module Reapal
43
43
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
44
44
  }
45
45
 
46
- res = 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'], '3.0')
47
47
 
48
48
  if 'S' == res[:result] && '0001' == res[:data][:resultCode]
49
49
  res[:result] = 'F'
@@ -0,0 +1,50 @@
1
+ # coding: utf-8
2
+
3
+ module Reapal
4
+ module Api
5
+ module Tender
6
+ module TenderOnekeyInvestHistory
7
+
8
+ # 3.15 投资关系迁移 (要求标的为已满标放款状态)
9
+ #
10
+ # @param tender_no [ String ] 商户系统标的号
11
+ # @param invest_details [ Array ] 投资方列表
12
+ # * :orderNo [String] 投标订单号
13
+ # * :investContracts [String] 投资方协议号
14
+ # * :amount [BigDecimal] 金额
15
+ # * :applyTime [Time] 投标时间 YYYY-MM-DD HH:mm:ss
16
+ # * :remark [String] 备注
17
+ # @param remark [ String ] 业务备注,默认为空
18
+ #
19
+ # @return [ Hash ] 结果集
20
+ # * :result [String] 业务结果:'S/F/P'
21
+ # * :request_params [Hash] 请求参数
22
+ # * :response [Object] 请求返回对象
23
+ # * :error_code [String] 错误代号
24
+ # * :error_msg [String] 错误信息
25
+ # * :data: 具体业务返回信息
26
+ # * :tenderNo [String] 完成订单号
27
+ # * :resultCode [String] 结果代码 0000:表示迁移成功
28
+ #
29
+ def tender_onekey_invest_history(tender_no, invest_details, remark='')
30
+ service = 'reapal.trust.onekeyInvestHistory'
31
+ post_path = '/reagw/tender/rest.htm'
32
+
33
+ params = {
34
+ tenderNo: tender_no,
35
+ investDetails: invest_details,
36
+ remark: remark,
37
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
38
+ }
39
+
40
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_onekey_invest, ['0000'], '3.0')
41
+
42
+ Reapal.logger.info res
43
+
44
+ res
45
+ end
46
+
47
+ end # module
48
+ end
49
+ end
50
+ end
@@ -5,26 +5,31 @@ module Reapal
5
5
  module Tender
6
6
  module TenderOneKeyRefund
7
7
 
8
- # 3.13 一键还款
8
+ # 3.8 一键还款
9
9
  #
10
10
  # @param flow_id [ String ] 还款订单号
11
11
  # @param tender_no [ String ] 商户系统标的的标号
12
- # @param debit_contracts [String] 借款方协议号
13
- # @param debit_details [JSON] 借款方还款
14
- # *seria_no [String] 还款流水号
15
- # *payee_contracts [String] 收款方协议号
16
- # *amount [String] 金额
12
+ # @param periods [ Integer ] 还款期数
13
+ # @param debit_contracts [ String ] 借款方协议号
14
+ # @param debit_details [ Array ] 借款方还款
15
+ # *serialNo [String] 还款流水号
16
+ # *payeeContracts [String] 收款方协议号
17
+ # *tradeAmount [BigDecimal] 还款总金额 = 还款本金+还款利息+还款手续费+还款罚息
18
+ # *feeAmount [BigDecimal] 还款手续费
19
+ # *defAmount [BigDecimal] 还款罚息
20
+ # *amount [BigDecimal] 还款金额
21
+ # *intAmt [BigDecimal] 还款利息
17
22
  # *remark [String] 备注
18
- # @param invest_details [JSON] 投资方分账
19
- # *seria_no [String] 还款分账流水号
20
- # *invest_contracts [String] 投资方协议号
21
- # *payee_contracts [String] 收款方协议号
22
- # *amount [String] 金额
23
+ # @param fee_details [ Array ] 手续费明细
24
+ # *serialNo [String] 还款分账流水号
25
+ # *payeeContracts [ String ] 收款方协议号
26
+ # *feeType [String] 手续费类型 01 平台收借款方手续费,不能大于标的备案的手续费 02 罚息
27
+ # *amount [BigDecimal] 金额
23
28
  # *remark [String] 备注
24
- # @param defray_details [JSON] 担保方分账
25
- # *seria_no [String] 还款流水号
26
- # *payee_contracts [String] 付款方协议号
27
- # *amount [String] 金额
29
+ # @param defray_details [ Array ] 担保方明细
30
+ # *serialNo [String] 还款流水号
31
+ # *payerContracts [String] 担保方协议号
32
+ # *amount [BigDecimal] 金额
28
33
  # *remark [String] 备注
29
34
  # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
30
35
  # @param remark [ String ] 备注
@@ -41,9 +46,10 @@ module Reapal
41
46
  #
42
47
  def tender_onekey_refund(flow_id,
43
48
  tender_no,
49
+ periods,
44
50
  debit_contracts,
45
51
  debit_details,
46
- invest_details=[],
52
+ fee_details=[],
47
53
  defray_details=[],
48
54
  busway='01',
49
55
  remark='')
@@ -55,8 +61,9 @@ module Reapal
55
61
  tenderNo: tender_no,
56
62
  debitContracts: debit_contracts,
57
63
  debitDetails: debit_details,
58
- investDetails: invest_details,
64
+ feeDetails: fee_details,
59
65
  defrayDetails: defray_details,
66
+ periods: periods,
60
67
  busway: busway,
61
68
  remark: remark,
62
69
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
@@ -5,7 +5,7 @@ module Reapal
5
5
  module Tender
6
6
  module TenderRepaymentComplete
7
7
 
8
- # 3.15 还款计划更新(API)
8
+ # 3.10 还款计划更新(API)
9
9
  #
10
10
  # @param flow_id [String] 执行还款计划订单号
11
11
  # @param tender_no [String] 商户系统标的号
@@ -5,7 +5,7 @@ module Reapal
5
5
  module Tender
6
6
  module TenderRepaymentProject
7
7
 
8
- # 3.14 还款计划
8
+ # 3.9 还款计划
9
9
  #
10
10
  # @param flow_id [String] 还款计划订单号
11
11
  # @param tender_no [String] 商户系统标的号
@@ -5,7 +5,7 @@ module Reapal
5
5
  module User
6
6
  module BalanceQuery
7
7
 
8
- # 1.6 查询余额(API)
8
+ # 1.2 查询余额(API)
9
9
  #
10
10
  # @param contracts [ String ] 用户协议号
11
11
  #
@@ -5,10 +5,9 @@ module Reapal
5
5
  module User
6
6
  module BindCardQuery
7
7
 
8
- # 1.15 绑卡查询(API)
8
+ # 1.10 绑卡查询(API)
9
9
  #
10
10
  # @param contracts [ String ] 用户协议号
11
- # @param type [ String ] 业务类型 A: 充值和提现; D: 充值; W: 提现 (现只支持提现绑卡查询)
12
11
  #
13
12
  # @return [ Hash ] 结果集
14
13
  # * :result [String] 业务结果:'S/F/P'
@@ -18,7 +17,7 @@ module Reapal
18
17
  # * :error_msg [String] 错误信息
19
18
  # * :data: 具体业务返回信息
20
19
  # * :contracts [String] 用户协议号
21
- # * :bank_cards [Array] 银行卡信息数组
20
+ # * :bankCards [Array] 银行卡信息数组
22
21
  # * :bank_name 银行名称
23
22
  # * :bank_code 银行代码
24
23
  # * :bank_card 银行卡后四位
@@ -30,13 +29,13 @@ module Reapal
30
29
  # * :branch 开户行分行
31
30
  # * :subbranch 开户行支行
32
31
  #
33
- def bind_card_query(contracts, type='W')
32
+ def bind_card_query(contracts)
34
33
  service = 'reapal.trust.bindQuery'
35
34
  post_path = '/reagw/user/restApi.htm'
36
35
 
37
36
  params = {
38
37
  contracts: contracts,
39
- type: type,
38
+ type: 'W', # 业务类型:默认提现 A: 充值和提现; D: 充值; W: 提现 (现只支持提现绑卡查询)
40
39
  queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
41
40
  }
42
41
 
@@ -45,7 +44,7 @@ module Reapal
45
44
  if 'S' == res[:result] || ('P' == res[:result] && res[:data][:resultCode].nil?)
46
45
  res[:result] = 'S'
47
46
 
48
- res[:data][:bank_cards] = parse_cards_info(res[:data][:bankCards])
47
+ res[:data][:bankCards] = parse_cards_info(res[:data][:bankCards])
49
48
  end
50
49
 
51
50
  Reapal.logger.info res
@@ -5,9 +5,9 @@ module Reapal
5
5
  module User
6
6
  module ContractQuery
7
7
 
8
- # 1.5 签约查询,支持个人和企业(API)
8
+ # 1.1.4 签约查询,支持个人和企业(API)
9
9
  #
10
- # @param onekey_com_contract_flow_id [ String ] 签约订单号
10
+ # @param contract_flow_id [ String ] 签约订单号
11
11
  #
12
12
  # @return [ Hash ] 结果集
13
13
  # * :result [String] 业务结果:'S/F/P'
@@ -24,16 +24,19 @@ module Reapal
24
24
  # * :comLicense [String] 组织机构代码/社会征信号
25
25
  # * :licStartDate [String] 企业组织机构证起始日
26
26
  # * :licEndDate [String] 企业组织机构证截止日
27
- # * :mobile [String] 手机号
27
+ # * :bankAccountNo [String] 银行卡后四位
28
+ # * :bankCode [String] 银行编码
29
+ # * :userType [String] 注册类别 01:出借人 02:借款人 03:担保人 04:受托方
30
+ # * :bankMobile [String] 手机号
28
31
  # * :email [String] 企业邮箱
29
32
  # * :remark [String] 备注
30
33
  #
31
- def contract_query(onekey_com_contract_flow_id)
34
+ def contract_query(contract_flow_id)
32
35
  service = 'reapal.trust.contractQuery'
33
36
  post_path = '/reagw/agreement/agreeApi.htm'
34
37
 
35
38
  params = {
36
- orderNo: onekey_com_contract_flow_id,
39
+ orderNo: contract_flow_id,
37
40
  queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
38
41
  }
39
42
 
@@ -5,9 +5,9 @@ module Reapal
5
5
  module User
6
6
  module MobileQuery
7
7
 
8
- # 1.8 手机号查询
8
+ # 1.4 手机号查询
9
9
  #
10
- # @param contracts [ String ] 用户协议号
10
+ # @param contract [ String ] 用户协议号
11
11
  #
12
12
  # @return [ Hash ] 结果集
13
13
  # * :result [String] 业务结果:'S/F/P'
@@ -19,12 +19,12 @@ module Reapal
19
19
  # * :contracts [String] 用户协议号
20
20
  # * :mobile [String] 用户手机号
21
21
  #
22
- def mobile_query(contracts)
22
+ def mobile_query(contract)
23
23
  service = 'reapal.trust.mobileQuery'
24
24
  post_path = '/reagw/user/restApi.htm'
25
25
 
26
26
  params = {
27
- contracts: contracts,
27
+ contracts: contract,
28
28
  queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
29
29
  }
30
30
 
@@ -4,7 +4,7 @@ module Reapal
4
4
  module User
5
5
  module ModifyBindBankCard
6
6
 
7
- # 1.14 修改绑卡(API)
7
+ # 1.9 修改绑卡(API)
8
8
  #
9
9
  # @param flow_id [ String ] 订单号
10
10
  # @param contracts [ String ] 用户协议号
@@ -5,9 +5,22 @@ module Reapal
5
5
  module User
6
6
  module OnekeyBatchContract
7
7
 
8
- # 1.1 个人一键签约(API)新版本,迁移老数据
8
+ # 5.2 历史用户迁移(四要素)
9
9
  #
10
10
  # @param flow_id [ String ] 订单号
11
+ # @param true_name [ String ] 真实姓名
12
+ # @param identity_id [ String ] 身份证号
13
+ # @param phone [ String ] 手机号
14
+ # @param is_to_sms [ String ] 是否发送初始交易密码短信,T:发送 F:不发送
15
+ # @param bank_code [ String ] 银行代码
16
+ # @param card_id [ String ] 银行卡账号(全卡号)
17
+ # @param card_province [ String ] 银行所在省
18
+ # @param card_city [ String ] 银行所在城市
19
+ # @param card_branch [ String ] 银行分行
20
+ # @param card_sub_branch [ String ] 银行支行
21
+ # @param user_type [ String ] 注册类别 01:出借人 02:借款人 03:担保人 04:受托方
22
+ # @param busway [ String ] 设备通道,默认手机端 00:PC端;01:手机端;02:Pad端;03:其它
23
+ # @param remark [ String ] 备注
11
24
  #
12
25
  # @return [ Hash ] 结果集
13
26
  # * :result [String] "S"/"F"/"P"
@@ -20,8 +33,9 @@ module Reapal
20
33
  # * :userMobile [String] 手机号
21
34
  #
22
35
  def onekey_batch_contract(flow_id, true_name, identity_id, phone, is_to_sms,
23
- bank_code, card_id, card_province, card_city, card_branch, card_sub_branch,
24
- bus_way='01')
36
+ bank_code, card_id, card_province, card_city,
37
+ card_branch, card_sub_branch, user_type,
38
+ busway='01', remark='')
25
39
  service = 'reapal.trust.onekeyBatchContract'
26
40
  post_path = '/reagw/agreement/agree.htm'
27
41
 
@@ -30,8 +44,8 @@ module Reapal
30
44
  userName: true_name,
31
45
  userIdentity: identity_id,
32
46
  userMobile: phone,
33
- busway: bus_way,
34
- remark: '',
47
+ busway: busway,
48
+ remark: remark,
35
49
  isToSms: is_to_sms,
36
50
  bankCode: bank_code,
37
51
  bankAccountNo: card_id,
@@ -39,6 +53,7 @@ module Reapal
39
53
  accountCity: card_city,
40
54
  branch: card_branch,
41
55
  subbranch: card_sub_branch,
56
+ userType: user_type,
42
57
  applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
43
58
  }
44
59