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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bancbox_invest.rb +15 -35
  3. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef7a7d05b557739655bd7f055417ce7b0a1472cc
4
- data.tar.gz: 7ba2e1c5ba6a497a4a6cd2615147a520fd7f7732
3
+ metadata.gz: c974dcddd5a06f0740115923b18b8192d4bdef49
4
+ data.tar.gz: 154ea886744e70ca4e5608f653591de5d496388d
5
5
  SHA512:
6
- metadata.gz: 02d6f8afb58e1cd9e59496be63df6ad794dcfc36800e848a7657e12f1d5350965f39f50af370571436cf92d95bf0e2d990d9302acb4f8998b47a71116bf56ba7
7
- data.tar.gz: 6bdeb73f9c7e85d7423178cdbfd8689a4ceb7251033d400b8672d94001fc52e91208d7770d9c4423d837c6b8d5fc3e0c50d25125616f3d2cc63db1a33d0eb68c
6
+ metadata.gz: 43954c7b896d411526ae62c6dd4d0d4ec4cc17860c70f7ce5e84bd29d19d56cc932f28557505a42fb67d9d41ee749e417b8dc2873e2d45f2dd935363bfa25fb5
7
+ data.tar.gz: bbc57e3e79468084279afbf15abbcde6aed21b5373c1d1fb70487c93306a1601ca9cd2594da8db569c5dcac897d4af6de140fee2a5ade8f47d6fc808d81c34e8
@@ -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
- # https://invest.bancbox.com/apis_create_investor.html
27
- def create_investor(options={})
28
- @options.merge!(options)
29
- post('/crowd/v0/cfp/createInvestor', @options)
30
- end
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.1
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-05-04 00:00:00.000000000 Z
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