bancbox_invest 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bancbox_invest.rb +15 -35
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c974dcddd5a06f0740115923b18b8192d4bdef49
|
4
|
+
data.tar.gz: 154ea886744e70ca4e5608f653591de5d496388d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43954c7b896d411526ae62c6dd4d0d4ec4cc17860c70f7ce5e84bd29d19d56cc932f28557505a42fb67d9d41ee749e417b8dc2873e2d45f2dd935363bfa25fb5
|
7
|
+
data.tar.gz: bbc57e3e79468084279afbf15abbcde6aed21b5373c1d1fb70487c93306a1601ca9cd2594da8db569c5dcac897d4af6de140fee2a5ade8f47d6fc808d81c34e8
|
data/lib/bancbox_invest.rb
CHANGED
@@ -1,9 +1,18 @@
|
|
1
1
|
require 'httparty'
|
2
|
+
require 'active_support/core_ext'
|
2
3
|
|
3
4
|
class Bancbox
|
4
5
|
|
5
6
|
attr_accessor :bancbox_api_key, :bancbox_api_secret, :bancbox_api_url
|
6
7
|
|
8
|
+
BANCBOX_METHODS = %w[create_investor submit_agreement verify_identity create_issuer open_escrow fund_account fund_escrow
|
9
|
+
cge_investor_contr cancel_escrow close_escrow get_escrow_details get_escrow_list get_activity_details get_investor_list
|
10
|
+
get_investor get_issuer_list get_issuer_details disburse_escrow disburse_escrow get_investment_ledger update_investment_ledger
|
11
|
+
freeze_investment_ledger create_proceeds_schedules get_proceeds_schedules cancel_proceeds_schedules withdraw_funds
|
12
|
+
update_escrow_account transfer_funds link_external_account confirm_wire_transfer verify_income accredit_investor_3rd_party
|
13
|
+
get_verification_status get_activity get_ledger create_challenge_deposit verify_challenge_deposit get_challenge_deposit_status
|
14
|
+
update_investor update_issuer]
|
15
|
+
|
7
16
|
def initialize(options = {})
|
8
17
|
options.each do |key, value|
|
9
18
|
send(:"#{key}=", value)
|
@@ -23,40 +32,11 @@ class Bancbox
|
|
23
32
|
HTTParty.post(bancbox_api_url+url, query: options)
|
24
33
|
end
|
25
34
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# https://invest.bancbox.com/apis_create_investor.html
|
33
|
-
def create_investor(options={})
|
34
|
-
@options.merge!(options)
|
35
|
-
post('/crowd/v0/cfp/createInvestor', @options)
|
36
|
-
end
|
37
|
-
|
38
|
-
# https://invest.bancbox.com/apis_create_issuer.html
|
39
|
-
def create_issuer(options={})
|
40
|
-
@options.merge!(options)
|
41
|
-
post('/crowd/v0/cfp/createIssuer', @options)
|
42
|
-
end
|
43
|
-
|
44
|
-
# https://invest.bancbox.com/apis_fund_escrow.html
|
45
|
-
def fund_escrow(options={})
|
46
|
-
@options.merge!(options)
|
47
|
-
post('/crowd/v0/cfp/fundEscrow', @options)
|
48
|
-
end
|
49
|
-
|
50
|
-
# https://invest.bancbox.com/apis_get_investor.html
|
51
|
-
def get_investor(options={})
|
52
|
-
@options.merge!(options)
|
53
|
-
post('/crowd/v0/cfp/getInvestorDetails', @options)
|
54
|
-
end
|
55
|
-
|
56
|
-
# https://invest.bancbox.com/apis_open_escrow.html
|
57
|
-
def open_escrow(options={})
|
58
|
-
@options.merge!(options)
|
59
|
-
post('/crowd/v0/cfp/createEscrowAccount', @options)
|
35
|
+
BANCBOX_METHODS.each do |action|
|
36
|
+
define_method(action) do |argument|
|
37
|
+
@options.merge!(argument)
|
38
|
+
post("/crowd/v0/cfp/#{action.camelize(:lower)}", @options)
|
39
|
+
end
|
60
40
|
end
|
61
41
|
|
62
|
-
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bancbox_invest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maksim Berjoza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|