reapal 0.9.13 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reapal/api/api_helper.rb +1 -1
- data/lib/reapal/api/money/deposit_query.rb +1 -1
- data/lib/reapal/api/money/member_payment_query.rb +46 -0
- data/lib/reapal/api/money/sub_account.rb +5 -5
- data/lib/reapal/api/money/sub_account_query.rb +1 -1
- data/lib/reapal/api/money/withdraw_query.rb +1 -1
- data/lib/reapal/api/order/query_by_single_flow_id.rb +1 -0
- data/lib/reapal/api/tender/history_tender_info_modify.rb +63 -0
- data/lib/reapal/api/tender/refund_guarant_payment_query.rb +42 -0
- data/lib/reapal/api/tender/tender_all_cancel.rb +1 -1
- data/lib/reapal/api/tender/tender_apply.rb +12 -4
- data/lib/reapal/api/tender/tender_apply_modify.rb +77 -0
- data/lib/reapal/api/tender/tender_auth_cancel.rb +3 -5
- data/lib/reapal/api/tender/tender_auth_query.rb +12 -9
- data/lib/reapal/api/tender/tender_close.rb +44 -0
- data/lib/reapal/api/tender/tender_finish.rb +14 -13
- data/lib/reapal/api/tender/tender_onekey_invest.rb +3 -3
- data/lib/reapal/api/tender/tender_onekey_invest_history.rb +50 -0
- data/lib/reapal/api/tender/tender_onekey_refund.rb +24 -17
- data/lib/reapal/api/tender/tender_repayment_complete.rb +1 -1
- data/lib/reapal/api/tender/tender_repayment_project.rb +1 -1
- data/lib/reapal/api/user/balance_query.rb +1 -1
- data/lib/reapal/api/user/bind_card_query.rb +5 -6
- data/lib/reapal/api/user/contract_query.rb +8 -5
- data/lib/reapal/api/user/mobile_query.rb +4 -4
- data/lib/reapal/api/user/modify_bind_bank_card.rb +1 -1
- data/lib/reapal/api/user/onekey_batch_contract.rb +20 -5
- data/lib/reapal/api/user/set_history_user_type.rb +44 -0
- data/lib/reapal/api/user/undo_bind_bank_card.rb +1 -1
- data/lib/reapal/form/{certificate_form.rb → bind_bank_card_form.rb} +9 -10
- data/lib/reapal/form/business_auth_form.rb +12 -9
- data/lib/reapal/form/close_account_form.rb +42 -0
- data/lib/reapal/form/com_contract_form.rb +64 -0
- data/lib/reapal/form/deposit_apply_form.rb +2 -3
- data/lib/reapal/form/find_trade_password_form.rb +1 -1
- data/lib/reapal/form/member_payment_form.rb +51 -0
- data/lib/reapal/form/mobile_modify_form.rb +1 -1
- data/lib/reapal/form/refund_guarant_payment_form.rb +50 -0
- data/lib/reapal/form/shortcut_recharge_form.rb +43 -0
- data/lib/reapal/form/signle_tender_transfer_form.rb +76 -0
- data/lib/reapal/form/tender_apply_confirm_form.rb +42 -0
- data/lib/reapal/form/tender_invest_form.rb +49 -0
- data/lib/reapal/form/tender_refund_form.rb +81 -0
- data/lib/reapal/form/user_contract_form.rb +46 -0
- data/lib/reapal/form/withdraw_apply_form.rb +1 -1
- data/lib/reapal/http/communicate.rb +1 -1
- data/lib/reapal/http/error_code/tender.rb +16 -0
- data/lib/reapal/http/error_code/user.rb +4 -0
- data/lib/reapal/version.rb +1 -1
- metadata +20 -12
- data/lib/reapal/api/money/deposit_apply_api.rb +0 -77
- data/lib/reapal/api/money/deposit_confirm_api.rb +0 -57
- data/lib/reapal/api/money/deposit_sms_api.rb +0 -52
- data/lib/reapal/api/tender/tender_onekey_single_transfer.rb +0 -80
- data/lib/reapal/api/user/bank_card_add_sms.rb +0 -65
- data/lib/reapal/api/user/bank_card_add_sms_again.rb +0 -47
- data/lib/reapal/api/user/bank_card_add_sms_confirm.rb +0 -46
- data/lib/reapal/api/user/onekey_com_contract.rb +0 -81
- data/lib/reapal/api/user/onekey_contract.rb +0 -52
@@ -0,0 +1,44 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
module Reapal
|
3
|
+
module Api
|
4
|
+
module User
|
5
|
+
module SetHistoryUserType
|
6
|
+
|
7
|
+
# 5.1 设置历史用户角色
|
8
|
+
#
|
9
|
+
# @param flow_id [ String ] 订单号
|
10
|
+
# @param contracts [ String ] 用户协议号
|
11
|
+
# @param user_type [ String ] 注册类别 01:出借人 02:借款人 03:担保人 04:受托方
|
12
|
+
#
|
13
|
+
# @return [ Hash ] 结果集
|
14
|
+
# * :result [String] "S"/"F"/"P"
|
15
|
+
# * :request_params [Hash] 请求参数
|
16
|
+
# * :response [Object] 请求返回对象
|
17
|
+
# * :error_code [String] 错误代号
|
18
|
+
# * :error_msg [String] 错误信息
|
19
|
+
# * :data: 具体业务返回信息
|
20
|
+
# * :flow_id [ String ] 订单号
|
21
|
+
# * :result_code [ String ] 结果代码 0000:设置成功
|
22
|
+
#
|
23
|
+
def set_history_user_type(flow_id, contracts, user_type)
|
24
|
+
service = 'reapal.trust.setHistoryUserType'
|
25
|
+
post_path = '/reagw/agreement/setHistoryUserType.htm'
|
26
|
+
|
27
|
+
params = {
|
28
|
+
orderNo: flow_id,
|
29
|
+
contracts: contracts,
|
30
|
+
userType: user_type,
|
31
|
+
queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
32
|
+
}
|
33
|
+
|
34
|
+
res = operate_post(:operate, service, params, post_path, Http::ErrorCode.common, ['0000'])
|
35
|
+
|
36
|
+
Reapal.logger.info res
|
37
|
+
|
38
|
+
res
|
39
|
+
end
|
40
|
+
|
41
|
+
end # module
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -2,16 +2,15 @@
|
|
2
2
|
|
3
3
|
module Reapal
|
4
4
|
module Form
|
5
|
-
module
|
5
|
+
module BindBankCardForm
|
6
6
|
|
7
|
-
#
|
7
|
+
# 1.7 银行卡绑定
|
8
8
|
#
|
9
|
-
# @param flow_id [String]
|
10
|
-
# @param
|
11
|
-
# @param contract [String] 借款人协议号
|
9
|
+
# @param flow_id [String] 签约订单号
|
10
|
+
# @param contract [String] 用户协议号
|
12
11
|
# @param return_url [String] 回调 url
|
13
12
|
# @param notify_url [String] 通知 url
|
14
|
-
# @param
|
13
|
+
# @param busway [String] 设备通道,默认手机端。00:PC端;01:手机端;02:Pad端;03:其它
|
15
14
|
#
|
16
15
|
# @return [ Hash ] 结果集
|
17
16
|
# * :form_method
|
@@ -22,14 +21,14 @@ module Reapal
|
|
22
21
|
# * :encryptkey
|
23
22
|
# * :data
|
24
23
|
#
|
25
|
-
def
|
26
|
-
service = 'reapal.trust.
|
27
|
-
post_path = '/reagw/
|
24
|
+
def bind_bank_card_form(flow_id, contract, return_url, notify_url, busway='01')
|
25
|
+
service = 'reapal.trust.bankCardAddV3'
|
26
|
+
post_path = '/reagw/bankcard/toBankCardBinding.htm'
|
28
27
|
|
29
28
|
params = {
|
30
29
|
orderNo: flow_id,
|
31
30
|
contracts: contract,
|
32
|
-
|
31
|
+
busway: busway,
|
33
32
|
returnUrl: return_url,
|
34
33
|
notifyUrl: notify_url,
|
35
34
|
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
@@ -4,16 +4,18 @@ module Reapal
|
|
4
4
|
module Form
|
5
5
|
module BusinessAuthForm
|
6
6
|
|
7
|
-
# 3.
|
7
|
+
# 3.12 标的授权 (Form)
|
8
8
|
#
|
9
9
|
# @param flow_id [String] 业务订单号
|
10
|
-
# @param
|
11
|
-
# @param services [String] 授权服务 02
|
10
|
+
# @param contract [String] 用户协议号
|
11
|
+
# @param services [String] 授权服务 02 自动投标 03 自动还款 05 自动担保还款
|
12
12
|
# @param auth_limit [String] 授权期限日期 YYYYMMDD
|
13
|
+
# @param amount [Bigdecimal] 金额
|
14
|
+
# @param total_amount [Bigdecimal] 累计金额
|
13
15
|
# @param return_url [String] 回调 url
|
14
16
|
# @param notify_url [String] 通知 url
|
15
|
-
# @param tender_no [String] 标的号,授权为一键还款时必填
|
16
17
|
# @param busway [String] 00:PC端;01:手机端;02:Pad端;03:其它
|
18
|
+
# @param remark [ String ] 备注
|
17
19
|
#
|
18
20
|
# @return [ Hash ] 结果集
|
19
21
|
# * form_method
|
@@ -24,22 +26,23 @@ module Reapal
|
|
24
26
|
# * :encryptkey
|
25
27
|
# * :data
|
26
28
|
#
|
27
|
-
def business_auth_form(flow_id,
|
28
|
-
return_url, notify_url,
|
29
|
+
def business_auth_form(flow_id, contract, services, auth_limit, amount, total_amount,
|
30
|
+
return_url, notify_url, busway='01', remark='')
|
29
31
|
|
30
32
|
service = 'reapal.trust.businessAuth'
|
31
33
|
post_path = '/reagw/user/rest.htm'
|
32
34
|
|
33
35
|
params = {
|
34
36
|
orderNo: flow_id,
|
35
|
-
contracts:
|
37
|
+
contracts: contract,
|
36
38
|
services: services,
|
37
39
|
busway: busway,
|
38
40
|
authLimit: auth_limit,
|
39
|
-
|
41
|
+
amount: amount,
|
42
|
+
totalAmount: total_amount,
|
40
43
|
returnUrl: return_url,
|
41
44
|
notifyUrl: notify_url,
|
42
|
-
remark:
|
45
|
+
remark: remark,
|
43
46
|
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
44
47
|
}
|
45
48
|
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Reapal
|
4
|
+
module Form
|
5
|
+
module CloseAccountForm
|
6
|
+
|
7
|
+
# 1.11 取消签约
|
8
|
+
#
|
9
|
+
# @param flow_id [String] 流水号
|
10
|
+
# @param contract [String] 用户协议
|
11
|
+
# @param return_url [String] 回调 url
|
12
|
+
# @param notify_url [String] 通知 url
|
13
|
+
# @param busway [String] 设备通道,默认手机端。00:PC端;01:手机端;02:Pad端;03:其它
|
14
|
+
#
|
15
|
+
# @return [ Hash ] 结果集
|
16
|
+
# * :form_method
|
17
|
+
# * :method
|
18
|
+
# * :url
|
19
|
+
# * :form_data
|
20
|
+
# * :merchant_id
|
21
|
+
# * :encryptkey
|
22
|
+
# * :data
|
23
|
+
#
|
24
|
+
def close_account_form(flow_id, contract, return_url, notify_url, busway='01')
|
25
|
+
service = 'reapal.trust.closeAccount'
|
26
|
+
post_path = '/reagw/agreement/closeAccountApply.htm'
|
27
|
+
|
28
|
+
params = {
|
29
|
+
orderNo: flow_id,
|
30
|
+
contracts: contract,
|
31
|
+
busway: busway,
|
32
|
+
returnUrl: return_url,
|
33
|
+
notifyUrl: notify_url,
|
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,64 @@
|
|
1
|
+
module Reapal
|
2
|
+
module Form
|
3
|
+
module ComContractForm
|
4
|
+
|
5
|
+
# 1.1 企业签约
|
6
|
+
#
|
7
|
+
# @param flow_id [ String ] 订单号
|
8
|
+
# @param corp_name [ String ] 法人代表姓名
|
9
|
+
# @param identity_id [ String ] 法人身份证号
|
10
|
+
# @param com_name [ String ] 企业名称
|
11
|
+
# @param com_license [ String ] 组织机构代码/社会征信号
|
12
|
+
# @param lic_start_date [ Time ] 企业组织机构证起始日
|
13
|
+
# @param lic_end_date [ Time ] 企业组织机构证截止日
|
14
|
+
# @param phone [ String ] 手机号
|
15
|
+
# @param bank_code [ String ] 银行编码
|
16
|
+
# @param user_type [ String ] 注册类别 01:出借人 02:借款人 03:担保人 04:受托方
|
17
|
+
# @param email [ String ] 企业邮箱
|
18
|
+
# @param return_url [ String ] 回调 URL
|
19
|
+
# @param notify_url [ String ] 通知 URL
|
20
|
+
# @param busway [ String ] 设备通道,默认手机端 00:PC端;01:移动端H5页面
|
21
|
+
# @param remark [ String ] 备注
|
22
|
+
#
|
23
|
+
# @return [ Hash ] 结果集
|
24
|
+
# * :form_method
|
25
|
+
# * :method
|
26
|
+
# * :url
|
27
|
+
# * :form_data
|
28
|
+
# * :merchant_id
|
29
|
+
# * :encryptkey
|
30
|
+
# * :data
|
31
|
+
#
|
32
|
+
def com_contract_form(flow_id, corp_name, identity_id, com_name, com_license,
|
33
|
+
lic_start_date, lic_end_date, phone, bank_code,
|
34
|
+
user_type, email, return_url, notify_url,
|
35
|
+
busway='01', remark='')
|
36
|
+
|
37
|
+
service = 'reapal.trust.comContract'
|
38
|
+
post_path = '/reagw/agreement/agree.htm'
|
39
|
+
|
40
|
+
params = {
|
41
|
+
orderNo: flow_id,
|
42
|
+
corpName: corp_name,
|
43
|
+
corpIdentity: identity_id,
|
44
|
+
comName: com_name,
|
45
|
+
comLicense: com_license,
|
46
|
+
licStartDate: lic_start_date.strftime("%Y%m%d"),
|
47
|
+
licEndDate: lic_end_date.strftime("%Y%m%d"),
|
48
|
+
bankMobile: phone,
|
49
|
+
bankCode: bank_code,
|
50
|
+
userType: user_type,
|
51
|
+
email: email,
|
52
|
+
busway: busway,
|
53
|
+
returnUrl: return_url,
|
54
|
+
notifyUrl: notify_url,
|
55
|
+
remark: remark,
|
56
|
+
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
57
|
+
}
|
58
|
+
|
59
|
+
get_form_data(service, params, post_path)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -14,7 +14,6 @@ module Reapal
|
|
14
14
|
# @param notify_url [String] 通知 url
|
15
15
|
# @param remark [String] 备注(默认为 '')
|
16
16
|
# @param payment_type [String](默认为 1)1:表示富民银行收银台支付(默认值,此字段为空时,默认此种方式);2:表示B2B企业充值银行直连;3: 表示B2C个人借记卡银行直连;
|
17
|
-
# @param channel [String] (默认为 bank) 如果是跳转收银台值为:bank,银行直连请参考:银行代码
|
18
17
|
# @param pay_customer_no [String] (默认为 '')支付方式(paymentType参数)为企业银行直连时:民生、浦发、交通三家银行 B2B(企业网银)支付需要提交该字段。其他情况下提交空字符串
|
19
18
|
#
|
20
19
|
# @return [ Hash ] 结果集
|
@@ -28,7 +27,7 @@ module Reapal
|
|
28
27
|
#
|
29
28
|
def deposit_apply_form(flow_id, contracts, money, charge,
|
30
29
|
return_url, notify_url, remark='',
|
31
|
-
payment_type='1',
|
30
|
+
payment_type='1', pay_customer_no='')
|
32
31
|
|
33
32
|
service = 'reapal.trust.depositApply'
|
34
33
|
post_path = '/reagw/service/deposit.htm'
|
@@ -42,7 +41,7 @@ module Reapal
|
|
42
41
|
notifyUrl: notify_url,
|
43
42
|
remark: remark,
|
44
43
|
paymentType: payment_type,
|
45
|
-
channel:
|
44
|
+
channel: 'bank',
|
46
45
|
payCustomerNo: pay_customer_no,
|
47
46
|
busway: '00',
|
48
47
|
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Reapal
|
4
|
+
module Form
|
5
|
+
module MemberPaymentForm
|
6
|
+
|
7
|
+
# 2.6 会员缴费
|
8
|
+
#
|
9
|
+
# @param flow_id [ String ] 订单号
|
10
|
+
# @param payment_subject [ String ] 缴费名目
|
11
|
+
# @param amount [ String ] 金额
|
12
|
+
# @param payer_contract [ String ] 付款方协议号
|
13
|
+
# @param return_url [ String ] 回调 url
|
14
|
+
# @param notify_url [ String ] 通知 url
|
15
|
+
# @param busway [ String ] 设备通道,默认手机端。00:PC端;01:手机端;02:Pad端;03:其它
|
16
|
+
# @param remark [ String ] 备注
|
17
|
+
#
|
18
|
+
# @return [ Hash ] 结果集
|
19
|
+
# * :form_method
|
20
|
+
# * :method
|
21
|
+
# * :url
|
22
|
+
# * :form_data
|
23
|
+
# * :merchant_id
|
24
|
+
# * :encryptkey
|
25
|
+
# * :data
|
26
|
+
#
|
27
|
+
def member_payment_form(flow_id, payment_subject,
|
28
|
+
amount, payer_contract,
|
29
|
+
return_url, notify_url,
|
30
|
+
busway='01', remark='')
|
31
|
+
service = 'reapal.trust.memberPayment'
|
32
|
+
post_path = '/reagw/tender/rest.htm'
|
33
|
+
|
34
|
+
params = {
|
35
|
+
orderNo: flow_id,
|
36
|
+
paymentSubject: payment_subject,
|
37
|
+
amount: amount,
|
38
|
+
payerContract: payer_contract,
|
39
|
+
busway: busway,
|
40
|
+
returnUrl: return_url,
|
41
|
+
notifyUrl: notify_url,
|
42
|
+
remark: remark,
|
43
|
+
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
44
|
+
}
|
45
|
+
|
46
|
+
get_form_data(service, params, post_path)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Reapal
|
4
|
+
module Form
|
5
|
+
module RefundGuarantPaymentForm
|
6
|
+
|
7
|
+
# 3.16 借款人还代偿款
|
8
|
+
#
|
9
|
+
# @param flow_id [ String ] 还款订单号
|
10
|
+
# @param tender_no [ String ] 代偿还款标的号
|
11
|
+
# @param amount [ Bigdecimal ] 金额
|
12
|
+
# @param fee_amount [ Bigdecimal ] 预期手续费
|
13
|
+
# @param payee_contract [ String ] 标的对应的担保方协议号
|
14
|
+
# @param return_url [String] 回调 url
|
15
|
+
# @param notify_url [String] 通知 url
|
16
|
+
# @param busway [String] 设备通道,默认手机端。00:PC端;01:手机端;02:Pad端;03:其它
|
17
|
+
#
|
18
|
+
# @return [ Hash ] 结果集
|
19
|
+
# * :form_method
|
20
|
+
# * :method
|
21
|
+
# * :url
|
22
|
+
# * :form_data
|
23
|
+
# * :merchant_id
|
24
|
+
# * :encryptkey
|
25
|
+
# * :data
|
26
|
+
#
|
27
|
+
def refund_guarant_payment_form(flow_id, tender_no, amount,
|
28
|
+
fee_amount, payee_contract,
|
29
|
+
return_url, notify_url, busway='01')
|
30
|
+
service = 'reapal.trust.refundGuarantPayment'
|
31
|
+
post_path = '/reagw/tender/rest.htm'
|
32
|
+
|
33
|
+
params = {
|
34
|
+
orderNo: flow_id,
|
35
|
+
tenderNo: tender_no,
|
36
|
+
amount: amount,
|
37
|
+
feeAmount: fee_amount,
|
38
|
+
payeeContract: payee_contract,
|
39
|
+
busway: busway,
|
40
|
+
returnUrl: return_url,
|
41
|
+
notifyUrl: notify_url,
|
42
|
+
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
43
|
+
}
|
44
|
+
|
45
|
+
get_form_data(service, params, post_path)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Reapal
|
2
|
+
module Form
|
3
|
+
module ShortcutRechargeForm
|
4
|
+
|
5
|
+
# 2.2 快捷充值
|
6
|
+
#
|
7
|
+
# @param flow_id [ String ] 订单号
|
8
|
+
# @param contracts [ String ] 协议号
|
9
|
+
# @param money [ Number ] 交易金额
|
10
|
+
# @param return_url [String] 回调 url
|
11
|
+
# @param notify_url [String] 通知 url
|
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 shortcut_recharge_form(flow_id, contracts, money, return_url, notify_url, remark='')
|
24
|
+
service = 'reapal.trust.depositApply'
|
25
|
+
post_path = '/reagw/service/deposit.htm'
|
26
|
+
|
27
|
+
params = {
|
28
|
+
orderNo: flow_id,
|
29
|
+
contracts: contracts,
|
30
|
+
amount: money,
|
31
|
+
returnUrl: return_url,
|
32
|
+
notifyUrl: notify_url,
|
33
|
+
busway: '01',
|
34
|
+
remark: remark,
|
35
|
+
applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
|
36
|
+
}
|
37
|
+
|
38
|
+
get_form_data(service, params, post_path)
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|