bancbox_invest 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/bancbox_invest.rb +62 -0
  3. metadata +86 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef7a7d05b557739655bd7f055417ce7b0a1472cc
4
+ data.tar.gz: 7ba2e1c5ba6a497a4a6cd2615147a520fd7f7732
5
+ SHA512:
6
+ metadata.gz: 02d6f8afb58e1cd9e59496be63df6ad794dcfc36800e848a7657e12f1d5350965f39f50af370571436cf92d95bf0e2d990d9302acb4f8998b47a71116bf56ba7
7
+ data.tar.gz: 6bdeb73f9c7e85d7423178cdbfd8689a4ceb7251033d400b8672d94001fc52e91208d7770d9c4423d837c6b8d5fc3e0c50d25125616f3d2cc63db1a33d0eb68c
@@ -0,0 +1,62 @@
1
+ require 'httparty'
2
+
3
+ class Bancbox
4
+
5
+ attr_accessor :bancbox_api_key, :bancbox_api_secret, :bancbox_api_url
6
+
7
+ def initialize(options = {})
8
+ options.each do |key, value|
9
+ send(:"#{key}=", value)
10
+ end
11
+ yield(self) if block_given?
12
+ @options = credentials
13
+ end
14
+
15
+ def credentials
16
+ {
17
+ api_key: bancbox_api_key,
18
+ secret: bancbox_api_secret,
19
+ }
20
+ end
21
+
22
+ def post(url, options)
23
+ HTTParty.post(bancbox_api_url+url, query: options)
24
+ end
25
+
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)
60
+ end
61
+
62
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bancbox_invest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Maksim Berjoza
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.13'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ description: Bancbox Invest ruby api wrapper
56
+ email: maksim.berjoza@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/bancbox_invest.rb
62
+ homepage: https://github.com/torbjon/bancbox_invest
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.2.2
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Bancbox Invest
86
+ test_files: []