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
@@ -1,77 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module Money
6
- module DepositApplyApi
7
-
8
- # 2.2 快捷充值签约(API)
9
- #
10
- # @param flow_id [ String ] 订单号
11
- # @param contracts [ String ] 用户协议号
12
- # @param bank_card [ String ] 银行卡卡号
13
- # @param true_name [ String ] 持卡人姓名
14
- # @param identity_id [ String ] 身份证号
15
- # @param phone [ String ] 用户手机(注意是银行卡预留手机号)
16
- # @param amount [ BigDecimal ] 交易金额
17
- # @param charge [ BigDecimal ] 手续费
18
- # @param terminal_info [ String ] 终端信息(手机IMEI地址、MAC地址、UUID)
19
- # @param member_ip [ String ] 用户IP
20
- # @param notify_url [ String ] 通知URL
21
- # @param cert_type [ String ] 证件类型 (暂时只支持身份证:01)
22
- # @param currency [ String ] 交易币种(默认人民币(仅支持人民币cny))
23
- # @param bus_way [ String ] 00:PC端;01:手机端;02:Pad端;03:其它
24
- # @param remark [ String ] 备注
25
- #
26
- # @return [ Hash ] 结果集
27
- # * :result [String] 业务结果:'S/F/P'
28
- # * :request_params [Hash] 请求参数
29
- # * :response [Object] 请求返回对象
30
- # * :error_code [String] 错误代号
31
- # * :error_msg [String] 错误信息
32
- # * :data: 具体业务返回信息
33
- # * :orderNO [String] 充值订单号
34
- # * :bindId [String] 绑卡ID
35
- # * :certificate [String] 招商银行标识(有此标识表示充值卡为招商银行,返回值为0,
36
- # 则表示需要调用招商卡密接口,若返回值为1,
37
- # 直接调用充值确认接口。若此字段不存在则表示非招行卡,可直接调用充值确认接口完成扣款)
38
- # * :resultCode [String] 结果代码
39
- # * :resultMsg [String] 结果描述
40
- #
41
- def deposit_apply_api(flow_id, contracts, bank_card, true_name, identity_id,
42
- phone, amount, charge, terminal_info, member_ip,
43
- notify_url, cert_type = '01', currency = 'cny', bus_way = '01', remark = '')
44
-
45
- service = 'reapal.trust.depositApplyAPI'
46
- post_path = '/reagw/service/depwit.htm'
47
-
48
- params = {
49
- orderNo: flow_id,
50
- contracts: contracts,
51
- bankCard: bank_card,
52
- userName: true_name,
53
- certType: cert_type,
54
- userIdentity: identity_id,
55
- userMobile: phone,
56
- currency: currency,
57
- amount: amount,
58
- charge: charge,
59
- busway: bus_way,
60
- terminalInfo: terminal_info,
61
- memberIp: member_ip,
62
- notifyUrl: notify_url,
63
- remark: remark,
64
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
65
- }
66
-
67
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_apply_api, ['0000'], '2.0')
68
-
69
- Reapal.logger.info res
70
-
71
- res
72
- end
73
-
74
- end # module
75
- end
76
- end
77
- end
@@ -1,57 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module Money
6
- module DepositConfirmApi
7
-
8
- # 2.3 快捷充值确认(API)
9
- #
10
- # @param flow_id [ String ] 商户订单号(非自动生成,与充值签约订单号一致)
11
- # @param contracts [ String ] 用户协议号
12
- # @param check_code [ String ] 短信验证码
13
- # @param terminal_info [ String ] 终端信息(手机IMEI地址、MAC地址、UUID)
14
- # @param member_ip [ String ] 用户IP
15
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
16
- # @param remark [ String ] 业务备注信息
17
- #
18
- # @return [ Hash ] 结果集
19
- # * :result [String] "S"/"F"/"P"
20
- # * :request_params [Hash] 请求参数
21
- # * :response [Object] 请求返回对象
22
- # * :error_code [String] 错误代号
23
- # * :error_msg [String] 错误信息
24
- # * :data: 具体业务返回信息
25
- # * :orderNo [String] 订单号
26
- # * :resultCode [String] 结果代码 0000:充值成功
27
- # * :resultMsg [String] 结果描述
28
- #
29
- def deposit_confirm_api(flow_id, contracts, check_code, terminal_info, member_ip, busway = '01', _remark = '')
30
- service = 'reapal.trust.depositConfirmAPI'
31
- post_path = '/reagw/service/depwit.htm'
32
-
33
- params = {
34
- orderNo: flow_id,
35
- contracts: contracts,
36
- checkCode: check_code,
37
- busway: busway,
38
- terminalInfo: terminal_info,
39
- memberIp: member_ip,
40
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
41
- }
42
-
43
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_confirm_api, ['0000'])
44
-
45
- if 'P' == res[:result] && ['0001', '0004', '3084'].include?(res[:data][:resultCode])
46
- res[:result] = 'F'
47
- end
48
-
49
- Reapal.logger.info res
50
-
51
- res
52
- end
53
-
54
- end # module
55
- end
56
- end
57
- end
@@ -1,52 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module Money
6
- module DepositSmsApi
7
-
8
- # 2.4 快捷充值重发短信(API)
9
- #
10
- # @param flow_id [ String ] 订单号(非自动生成,与充值签约订单号保持一致)
11
- # @param contracts [ String ] 用户协议号
12
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
13
- # @param terminal_info [ String ] 终端信息(手机IMEI地址、MAC地址、UUID)
14
- # @param member_ip [ String ] 用户IP
15
- # @param remark [ String ] 业务备注信息
16
- #
17
- # @return [ Hash ] 结果集
18
- # * :result [String] 业务结果:'S/F/P'
19
- # * :request_params [Hash] 请求参数
20
- # * :response [Object] 请求返回对象
21
- # * :error_code [String] 错误代号
22
- # * :error_msg [String] 错误信息
23
- # * :data: 具体业务返回信息
24
- # * :orderNo [String] 订单号
25
- # * :resultCode [String] 结果代码 0000:发送成功
26
- # * :resultMsg [String] 结果描述
27
- #
28
- def deposit_sms_api(flow_id, contracts, terminal_info, member_ip, busway = '01', remark = "")
29
- service = 'reapal.trust.depositSmsAPI'
30
- post_path = '/reagw/service/depwit.htm'
31
-
32
- params = {
33
- orderNo: flow_id,
34
- contracts: contracts,
35
- busway: busway,
36
- terminalInfo: terminal_info,
37
- memberIp: member_ip,
38
- remark: remark,
39
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
40
- }
41
-
42
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_sms_api, ['0000'])
43
-
44
- Reapal.logger.info res
45
-
46
- res
47
- end
48
-
49
- end # module
50
- end
51
- end
52
- end
@@ -1,80 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module Tender
6
- module TenderOneKeySingleTransfer
7
-
8
- # 3.19 一键债权转让
9
- #
10
- # @param flow_id [String] 业务订单号
11
- # @param tender_no [String] 转让方原投资标的号
12
- # @param trans_capital [BigDecimal] 转让人出让的本金
13
- # @param money [BigDecimal] 债权转让承接人应支付金额
14
- # @param trans_contracts [String] 债权转让方在存管系统签约的协议号
15
- # @param into_contracts [String] 债权承接方在存管系统签约的协议号
16
- # @param transfer_type [String] 债转类型,传1表示首次债转,即转让人(transContracts)为tenderNo指代标的原始投资人,传2表示第N次债转,转让人(transContracts)并非原标的投资人
17
- # @param invest_order [String] 若transferType为1时,即首次债转时必传
18
- # @param org_transfer_order [String] 若transferType 为2时,即N次债转时必传
19
- # @param busway [String] 00:PC端;01:手机端;02:Pad端;03:其它
20
- # @param fee [BigDecimal] 手续费 默认为空
21
- # @param fee_type [String] 手续费收取方向。 手续费收取方向 1 收取转让方,2 收取承接方 。手续费不为空时此字段必传,手续费为空时此字段不传
22
- # @param remark [String] 备注 默认为空
23
- #
24
- # @return [ Hash ] 结果集
25
- # * :result [String] 业务结果:'S/F/P'
26
- # * :request_params [Hash] 请求参数
27
- # * :response [Object] 请求返回对象
28
- # * :error_code [String] 错误代号
29
- # * :error_msg [String] 错误信息
30
- # * :data: 具体业务返回信息
31
- # * :orderNo [String] 业务订单号
32
- # * :resultCode [String] 结果代码
33
- #
34
- def tender_onekey_single_transfer(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
- busway='01',
44
- fee='',
45
- fee_type='',
46
- remark='')
47
- service = 'reapal.trust.onekeySignleTransfer'
48
- post_path = '/reagw/tender/rest.htm'
49
-
50
- params = {
51
- orderNo: flow_id,
52
- tenderNo: tender_no,
53
- transCapital: trans_capital,
54
- amount: money,
55
- transContracts: trans_contracts,
56
- intoContracts: into_contracts,
57
- fee: fee,
58
- feeType: fee_type,
59
- transferType: transfer_type,
60
- investOrder: invest_order,
61
- orgTransferOrder: org_transfer_order,
62
- busway: busway,
63
- remark: remark,
64
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
65
- }
66
-
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
- Reapal.logger.info res
73
-
74
- res
75
- end
76
-
77
- end # module TenderOneKeySingleTransfer
78
- end
79
- end
80
- end
@@ -1,65 +0,0 @@
1
- # coding: utf-8
2
- module Reapal
3
- module Api
4
- module User
5
- module BankCardAddSms
6
-
7
- # 1.10 一键绑卡申请(API)
8
- #
9
- # @param flow_id [ String ] 订单号
10
- # @param contracts [ String ] 用户协议号
11
- # @param bank_code [ String ] 银行代码
12
- # @param bank_account_no [ String ] 银行卡账号
13
- # @param account_province [ String ] 银行所在省
14
- # @param account_city [ String ] 银行所在市
15
- # @param branch [ String] 银行分行
16
- # @param subbranch [ String ] 银行支行
17
- # @param mobile_phone [ 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
- # * :flow_id [ String ] 订单号
27
- # * :result_code [ String ] 结果代码 0000:申请成功
28
- #
29
- def bank_card_add_sms(flow_id,
30
- contracts,
31
- bank_code,
32
- bank_account_no,
33
- account_province,
34
- account_city,
35
- branch,
36
- subbranch,
37
- mobile_phone)
38
-
39
- service = 'reapal.trust.bankCardAddSMS'
40
- post_path = '/reagw/bankcard/bankCardSMS.htm'
41
-
42
- params = {
43
- orderNo: flow_id,
44
- contracts: contracts,
45
- bankCode: bank_code,
46
- bankAccountNo: bank_account_no,
47
- accountProvince: account_province,
48
- accountCity: account_city,
49
- branch: branch,
50
- subbranch: subbranch,
51
- mobilePhone: mobile_phone,
52
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
53
- }
54
-
55
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.bind_card, ['0000'])
56
-
57
- Reapal.logger.info res
58
-
59
- res
60
- end
61
-
62
- end # module
63
- end
64
- end
65
- end
@@ -1,47 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module User
6
- module BankCardAddSmsAgain
7
-
8
- # 1.11 一键绑卡重发短信(API)
9
- #
10
- # @param flow_id [ String ] 交易订单号(非自动生成,与一键绑卡申请短信订单号保持一致)
11
- # @param contracts [ String ] 用户协议号
12
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
13
- # @param remark [ String ] 业务备注信息
14
- #
15
- # @return [ Hash ] 结果集
16
- # * :result [String] 业务结果:'S/F/P'
17
- # * :request_params [Hash] 请求参数
18
- # * :response [Object] 请求返回对象
19
- # * :error_code [String] 错误代号
20
- # * :error_msg [String] 错误信息
21
- # * :data: 具体业务返回信息
22
- # * :flow_id [ String ] 交易订单号
23
- # * :result_code [ String ] 结果代码 0000:绑卡成功
24
- #
25
- def bank_card_add_sms_again(flow_id, contracts, busway = '01', remark = "")
26
- service = 'reapal.trust.bankCardAddSMSAgain'
27
- post_path = '/reagw/bankcard/bankCardSMS.htm'
28
-
29
- params = {
30
- orderNo: flow_id,
31
- contracts: contracts,
32
- busway: busway,
33
- remark: remark,
34
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
35
- }
36
-
37
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.bind_card, ['0000'])
38
-
39
- Reapal.logger.info res
40
-
41
- res
42
- end
43
-
44
- end # module
45
- end
46
- end
47
- end
@@ -1,46 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module User
6
- module BankCardAddSmsConfirm
7
-
8
- # 1.11 一键绑卡确认(API)
9
- #
10
- # @param flow_id [ String ] 交易订单号(与一键绑卡申请订单号保持一致)
11
- # @param check_code [ String ] 短信验证码
12
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
13
- # @param remark [ String ] 业务备注信息
14
- #
15
- # @return [ Hash ] 结果集
16
- # * :result [String] "S"/"F"/"P"
17
- # * :request_params [Hash] 请求参数
18
- # * :response [Object] 请求返回对象
19
- # * :error_code [String] 错误代号
20
- # * :error_msg [String] 错误信息
21
- # * :data: 具体业务返回信息
22
- # * :flow_id [ String ] 交易订单号
23
- # * :result_code [ String ] 结果代码 0000:绑卡成功
24
- #
25
- def bank_card_add_sms_confirm(flow_id, check_code = '123456', busway = '01', remark = "")
26
- service = 'reapal.trust.bankCardAddSMSConfirm'
27
- post_path = '/reagw/bankcard/bankCardSMS.htm'
28
-
29
- params = {
30
- orderNo: flow_id,
31
- checkCode: check_code,
32
- busway: busway,
33
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
34
- }
35
-
36
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.bind_card, ['0000'])
37
-
38
- Reapal.logger.info res
39
-
40
- res
41
- end
42
-
43
- end # module
44
- end
45
- end
46
- end
@@ -1,81 +0,0 @@
1
- # coding: utf-8
2
-
3
- module Reapal
4
- module Api
5
- module User
6
- module OnekeyComContract
7
-
8
- # 1.4 企业一键签约(API)
9
- #
10
- # @param flow_id [ String ] 订单号
11
- # @param corp_name [ String ] 法人代表姓名
12
- # @param identity_id [ String ] 法人身份证号
13
- # @param com_name [ String ] 企业名称
14
- # @param com_license [ String ] 组织机构代码/社会征信号
15
- # @param lic_start_date [ Time ] 企业组织机构证起始日
16
- # @param lic_end_date [ Time ] 企业组织机构证截止日
17
- # @param phone [ String ] 手机号
18
- # @param return_url [ String ] 回调 URL
19
- # @param notify_url [ String ] 通知 URL
20
- # @param email [ String ] 企业邮箱
21
- # @param busway [ String ] 设备通道,默认手机端 00:PC端;01:手机端;02:Pad端;03:其它
22
- # @param remark [ String ] 备注
23
- #
24
- # @return [ Hash ] 结果集
25
- # * :result [String] 业务结果:'S/F/P'
26
- # * :request_params [Hash] 请求参数
27
- # * :response [Object] 请求返回对象
28
- # * :error_code [String] 错误代号
29
- # * :error_msg [String] 错误信息
30
- # * :data: 具体业务返回信息
31
- # * :orderNo [String] 订单号
32
- # * :contracts [String] 企业签约协议号
33
- # * :resultCode [String] 结果代码 0000:申请成功 0002:签约成功(审核通过)0003:签约失败(审核不通过)0006:再次申请成功(拒绝后)
34
- # * :corpName [String] 法人代表姓名
35
- # * :corpIdentity [String] 法人身份证号
36
- # * :comName [String] 企业名称
37
- # * :comLicense [String] 组织机构代码/社会征信号
38
- # * :licStartDate [String] 企业组织机构证起始日
39
- # * :licEndDate [String] 企业组织机构证截止日
40
- # * :mobile [String] 手机号
41
- # * :email [String] 企业邮箱
42
- # * :remark [String] 备注
43
- #
44
- def onekey_com_contract(flow_id, corp_name, identity_id, com_name, com_license,
45
- lic_start_date, lic_end_date, phone, return_url, notify_url,
46
- email, busway='01', remark='')
47
- service = 'reapal.trust.comContractAPI'
48
- post_path = '/reagw/agreement/agree.htm'
49
-
50
- params = {
51
- orderNo: flow_id,
52
- corpName: corp_name,
53
- corpIdentity: identity_id,
54
- comName: com_name,
55
- comLicense: com_license,
56
- licStartDate: lic_start_date.strftime("%Y%m%d"),
57
- licEndDate: lic_end_date.strftime("%Y%m%d"),
58
- mobile: phone,
59
- email: email,
60
- busway: busway,
61
- returnUrl: return_url,
62
- notifyUrl: notify_url,
63
- remark: '',
64
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
65
- }
66
-
67
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.com_contract_create, ['0002', '0006'])
68
-
69
- if 'P' == res[:result] && '0003' == res[:data][:resultCode]
70
- res[:result] = 'F'
71
- end
72
-
73
- Reapal.logger.info res
74
-
75
- res
76
- end
77
-
78
- end # module
79
- end
80
- end
81
- end