eloan 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 41a645a3fffcd50a8f0aff6a4fdcb96616f92eaecba5c563b26f554ab68dee16
4
- data.tar.gz: ab68ec411e84d44706a6c1b53bb8a760bb1bd846bbf194919873cc91aadd4e7d
3
+ metadata.gz: 90ecdeb8bb5691a1297fa622503bc96d1f7af08b45287bd4f1790b2dba8541e7
4
+ data.tar.gz: 78e417e1ab2452e31996d3db97af638571115c223fed98e0f7f6f7b30559e627
5
5
  SHA512:
6
- metadata.gz: 8f2b80ac48a679ff09fc136057334b6fedca924ca5aed8815ea0c5866d0f770aa0b92b06b765996d8addfe10b4dca48a5f2c5a7778c645ee090d83289d4f1fad
7
- data.tar.gz: ee98fe390c79c31bafd0052349456ac97544bf1914020d3c070bac4a425507486d95606370b267618cc00331927ca2604fea6c30c143a45fb4d4efae1fbc511c
6
+ metadata.gz: 190bbf1dabe028f11318f80da8763b9a1e1e27a66cac292cc190f5b38a0fc0a3494c99b497e5974a0d857114137935ad2ec4d5b1ed716f3c758552152ca67132
7
+ data.tar.gz: 54824364f89172c797eb2400ec4d511464650bf472d1288fb80983b1e11173cede24304f134a78732d34311d706a84476106031d2b05889059d1f676c958116f
data/Gemfile CHANGED
@@ -2,5 +2,8 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- # Specify your gem's dependencies in eloan.gemspec
5
+ # Specify your gem's dependencies in eloan.gemspecgem 'yard'
6
+ gem 'yard'
7
+ gem 'yard-activesupport-concern'
8
+
6
9
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,41 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ eloan (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ domain_name (0.5.20180417)
10
+ unf (>= 0.0.5, < 1.0.0)
11
+ http-cookie (1.0.3)
12
+ domain_name (~> 0.5)
13
+ mime-types (3.2.2)
14
+ mime-types-data (~> 3.2015)
15
+ mime-types-data (3.2019.0331)
16
+ netrc (0.11.0)
17
+ rake (10.5.0)
18
+ rest-client (2.0.2)
19
+ http-cookie (>= 1.0.2, < 2.0)
20
+ mime-types (>= 1.16, < 4.0)
21
+ netrc (~> 0.8)
22
+ unf (0.1.4)
23
+ unf_ext
24
+ unf_ext (0.0.7.6)
25
+ yard (0.9.19)
26
+ yard-activesupport-concern (0.0.1)
27
+ yard (>= 0.8)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.16)
34
+ eloan!
35
+ rake (~> 10.0)
36
+ rest-client
37
+ yard
38
+ yard-activesupport-concern
39
+
40
+ BUNDLED WITH
41
+ 1.16.6
data/README.md CHANGED
@@ -1,43 +1,30 @@
1
1
  # Eloan
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/eloan`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ 小贷通支付
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## 安装
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
7
+ 将以下代码添加到 Gemfile:
10
8
 
11
9
  ```ruby
12
10
  gem 'eloan'
13
11
  ```
14
12
 
15
- And then execute:
13
+ 然后执行:
16
14
 
17
15
  $ bundle
18
16
 
19
- Or install it yourself as:
17
+ 或者通过以下方式安装:
20
18
 
21
19
  $ gem install eloan
22
20
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
21
+ ## 使用
32
22
 
33
- ## Contributing
23
+ 通过以下方式添加配置项
34
24
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/eloan. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
37
- ## License
38
-
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
25
+ ```ruby
26
+ rails g eloan:config
27
+ ```
28
+ ## wiki
42
29
 
43
- Everyone interacting in the Eloan project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/eloan/blob/master/CODE_OF_CONDUCT.md).
30
+ 请见examples/example
@@ -0,0 +1,185 @@
1
+ # 备注: 所有有默认值字段后台自动加入参数中,如果上传参数中含有默认值字段,优先使用上传参数
2
+ # 文档: http://api.cloudpnr.com/eloan/eloan.html
3
+ # 有任何疑问请查看以上文档
4
+
5
+
6
+ # 个人开户绑卡
7
+ # code = 101
8
+ # cert_id String 是 最长20 身份证号码
9
+ # user_name String 是 最长80 用户姓名
10
+ # card_no String 是 最长20 银行卡号
11
+ # bank_id String 是 定长8 银行代码
12
+ # bank_mobile String 是 定长11 银行预留手机号
13
+ data = {
14
+ 'cert_id' => '222424200009250021',
15
+ 'user_name' => '香雪海',
16
+ 'card_no' => '6232510000008863',
17
+ 'bank_id' => '01050000',
18
+ 'bank_mobile' => '15200152000'
19
+ }
20
+ Eloan.api.pay(101, data)
21
+
22
+ # 个人开户代扣签约绑卡(102)
23
+ # code = 101
24
+ # cert_id String 是 最长20 身份证号码
25
+ # user_name String 是 最长80 用户姓名
26
+ # card_no String 是 最长20 银行卡号
27
+ # bank_mobile String 是 定长11 银行预留手机号
28
+ # bank_id String 是 定长8 银行代码
29
+ # bind_trans_id String 是 最长20 绑卡请求流水2次调用代扣签约绑卡请求流水必须一致且需为字母+数字
30
+ # step_flag String 是 定长2 阶段标志01-下发短信阶段02-绑卡确认阶段
31
+ # sms_code String 否 定长6 step_flag为01时不填,step_flag为02时必填
32
+ data = {
33
+ 'cert_id' => '222424200009250021',
34
+ 'user_name' => '香雪海',
35
+ 'card_no' => '6232510000008863',
36
+ 'bank_id' => '01050000',
37
+ 'bank_mobile' => '15200152000'
38
+ 'bind_trans_id' => 'pay102',
39
+ 'step_flag' => '02',
40
+ 'sms_code' => '111111'
41
+ }
42
+ Eloan.api.pay(102, data)
43
+
44
+ # 代扣卡解绑
45
+ # code = 103
46
+ # cert_id String 是 最长20 身份证号码
47
+ # user_name String 是 最长80 用户姓名
48
+ # card_no String 是 最长20 银行卡号
49
+ data = {
50
+ 'cert_id' => '222424200009250021',
51
+ 'user_name' => '香雪海',
52
+ 'card_no' => '6232510000008863'
53
+ }
54
+ Eloan.api.pay(103, data)
55
+
56
+ # 放款
57
+ # code = 201
58
+ # loan_start_date String 是 定长8 贷款开始日期,yyyymmdd
59
+ # loan_end_date String 是 定长8 贷款结束日期,yyyymmdd
60
+ # loan_period String 是 最长4 期限,结合期限类型的数字 default: 1
61
+ # loan_period_type String 是 定长2 期限类型:00-年;01-月;02-日 default: 01
62
+ # contract_no String 否 最长80 借款合同编号
63
+ # loan_amount String 是 最长14 放款总额,小数点后两位数字 #.##,须大于 5.00元
64
+ # entrusted_flag String 是 定长1 是否受托支付:Y-是;N-否, default: N
65
+ # user_cert_id String 是 最长20 借款人身份证号码
66
+ # user_name String 是 最长80 借款人姓名
67
+ # user_card_no String 是 最长20 借款人银行卡号
68
+ # user_amount String 是 最长14 借款人金额,小数点后两位数字 #.##
69
+ # user_cash_method String 是 定长2 取现方式:T0:即时到账,手续费较高;T1:第二日到账,手续费较低, default: T1
70
+ # merchant_cert_type String 否 定长2 受托商户证件类型,受托支付时必填:00-普通营业执照企业; 01-三证合一企业
71
+ # merchant_cert_id String 否 最长30 受托商户证件号码,受托支付时必填
72
+ # merchant_amount String 否 最长14 受托商户金额,小数点后两位数字#.##,受托支付时必填
73
+ # installment_number String 是 最长3 分期期数
74
+ # installment_rate String 是 最长5 分期利率,年化<=36.00%,小数点后两位数字#.##, 如22.22%,传参为:22.22
75
+ # payment_method String 是 定长2 还款方式:00-等额本息;01-等额本金;02-一次性还本付息; 03-先息后本(即按频率付息、一次还本)
76
+ # loan_comment String 否 最长256 备注
77
+ # auditor String 否 最长64 审核人
78
+ # audit_time String 否 定长14 审核时间,yyyymmddhhmmss
79
+ # bg_return_url String 是 最长256
80
+ data = {
81
+ 'loan_start_date' => '20190425',
82
+ 'loan_end_date' => '20190525',
83
+ 'loan_amount' => '10.00',
84
+ 'user_cert_id' => '222424000009250021',
85
+ 'user_name' => '香雪海',
86
+ 'user_card_no' => '6232510000008863',
87
+ 'user_amount' => '10.00',
88
+ 'installment_rate' => '10.00'
89
+ }
90
+ Eloan.api.pay('201', data)
91
+
92
+ # 还款代扣接口
93
+ # code = 202
94
+ # cert_id String 是 最长20 身份证号码
95
+ # user_name String 是 最长80 借款人姓名
96
+ # card_no String 是 最长20 卡号
97
+ # repay_mode String 是 定长1 还款方式0-自动代扣,1-主动还款 default: 1
98
+ # trans_amt String 是 最长14 代扣金额,保留2位有效数字
99
+ # loan_request_seq String 是 最长40 放款请求流水号
100
+ # back_cert_type String 是 变长2 回款收款方证件类型00-身份证,1-普通营业执照企业,2-三证合一企业
101
+ # back_cert_id String 是 最长20 回款收款方证件号
102
+ # back_div_details String 否 最长512 回款方分账串信息,JSON数组方式
103
+ data = {
104
+ 'cert_id' => '222424000009250021',
105
+ 'user_name' => '香雪海',
106
+ 'card_no' => '6232510000008863'
107
+ 'trans_amt' => '10.00'
108
+ 'loan_request_seq' => 'test201904258866',
109
+ 'back_cert_id' => '222424000009250021'
110
+ }
111
+ Eloan.api.pay(202, data)
112
+
113
+ # 放款取现
114
+ # code = 204
115
+ # loan_request_seq String 是 最长40 放款请求流水号
116
+ # card_no String 是 最长20 借款人银行卡号
117
+ data = {
118
+ 'loan_request_seq' => 'test201904258866',
119
+ 'card_no' => '6232510000008863'
120
+ }
121
+ Eloan.api.pay(204, data)
122
+
123
+ # 个人开户绑卡查询
124
+ # code = 301
125
+ # bind_request_seq String 否 最长40 该笔请求流水号
126
+ # cert_id String 是 最长20 身份证号
127
+ # card_no String 是 最长20 银行卡号
128
+ data = {
129
+ 'cert_id' => '222424200009250021',
130
+ 'card_no' => '6232510000008863'
131
+ }
132
+ Eloan.api.pay(301, data)
133
+
134
+ # 放款查询
135
+ # code = 302
136
+ # bind_request_seq String 否 最长40 该笔请求流水号
137
+ data = {
138
+ 'loan_request_seq' => 'test201904258866'
139
+ }
140
+ Eloan.api.pay(302, data)
141
+
142
+ # 个人开户代扣签约绑卡查询
143
+ # code = 303
144
+ # cert_id String 是 最长20 身份证号码
145
+ data = {
146
+ 'cert_id' => '222424200009250021',
147
+ 'card_no' => '6232510000008863'
148
+ }
149
+ Eloan.api.pay(303, data)
150
+
151
+ # 还款查询
152
+ # code = 304
153
+ # repay_request_seq String 是 最长40 该笔请求流水号
154
+ data = {
155
+ 'repay_request_seq' => 'test201904258866'
156
+ }
157
+ Eloan.api.pay(304, data)
158
+
159
+ # 卡BIN查询
160
+ # code = 305
161
+ # cert_id String 是 最长20 身份证号码
162
+ data = {
163
+ 'card_no' => '6232510000008863'
164
+ }
165
+ Eloan.api.pay(305, data)
166
+
167
+ # 绑卡信息查询
168
+ # code = 306
169
+ # cert_id String 是 最长20 身份证号码
170
+ data = {
171
+ 'cert_id' => '222424199309250021'
172
+ }
173
+ Eloan.api.pay(306, data)
174
+
175
+ # 放款取现查询
176
+ # code = 307
177
+ # cash_request_seq String 是 最长40 放款取现请求流水号
178
+ data = {
179
+ 'cash_request_seq' => 'test201904258866'
180
+ }
181
+ Eloan.api.pay(307, data)
182
+
183
+ # 委托人余额查询
184
+ # code = 308
185
+ Eloan.api.pay(308)
data/lib/eloan/api.rb CHANGED
@@ -12,7 +12,7 @@ module Eloan
12
12
 
13
13
 
14
14
  def pay code, data = {}
15
- request = request_params(code)
15
+ request = request_params(code.to_s)
16
16
  url = generate_request_url(request[:url])
17
17
  request_method = request[:method]
18
18
 
@@ -1,8 +1,6 @@
1
1
  module Eloan
2
2
  module Helper
3
3
  module Payment
4
- ### 生成公共请求参数
5
-
6
4
  # 生成默认参数
7
5
  def generate_default_params
8
6
  {
@@ -1,6 +1,7 @@
1
1
  module Eloan
2
2
  module Helper
3
3
  module Request
4
+ ### 根据code获取请求方式,默认请求参数
4
5
  def request_params(code)
5
6
  case code
6
7
  when '101'
data/lib/eloan/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eloan
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eloan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rqiang
@@ -64,12 +64,14 @@ files:
64
64
  - ".travis.yml"
65
65
  - CODE_OF_CONDUCT.md
66
66
  - Gemfile
67
+ - Gemfile.lock
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile
70
71
  - bin/console
71
72
  - bin/setup
72
73
  - eloan.gemspec
74
+ - examples/example.rb
73
75
  - lib/eloan.rb
74
76
  - lib/eloan/api.rb
75
77
  - lib/eloan/api_loader.rb