vogogo_ruby 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f68ef0bd6042317652186f6793060746c6bb2b6
4
+ data.tar.gz: ea4ad761f3629d10f86105f692cb0ab7ac0a35ed
5
+ SHA512:
6
+ metadata.gz: 61cbb3480abc234dca1dc2be0a6f67efdbd8518e5de2d420a6e1455b2995118c8228033bf493871dbe3207938f3168e59e37c2bd6d3520b39a9546360e8aed65
7
+ data.tar.gz: 8299ae6c59d19b9be1c94afc4bd3d87244adf7172c7058f962b4ae6684ce9389895b8aab349471af6de747cd79fd79be10a17303e7553b4f5aba9426eb3dfbba
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vogogo_ruby.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 OverC Studios
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # VogogoRuby
2
+
3
+ VogogoRuby is a tool to easily consume [Vogogo's direct APIs](http://dev.vogogo.com/direct_api.html)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+ ```ruby
9
+ gem 'vogogo_ruby'
10
+ ```
11
+ And then execute:
12
+ ```ruby
13
+ $ bundle
14
+ ```
15
+ Or install it yourself as:
16
+ ```ruby
17
+ $ gem install vogogo_ruby
18
+ ```
19
+ ## Usage
20
+ 1. Create a client instance by providing Vogogo's keys (API_KEY, APP_TOKEN, USER)
21
+ ```ruby
22
+ vc = VogogoClient.new(API_KEY, APP_TOKEN, USER)
23
+ ```
24
+ 2. Consume the API methods
25
+
26
+ - Create Invoice
27
+ ```ruby
28
+ vc = VogogoClient.new('7098l9kachgdfcb63a8a09acb887f5j7', '456b4dbec13abcb98a8a70acb587f5dd', 'foo@example.com')
29
+ data = {customer_ref: 'Mr. Joe Jacob Blow', customer_emails: 'joe@example.com',
30
+ customer_contact_info: '123 Fake ST\nCalgary\nAlberta\n403.987.1231', profile_name: 'Jims Snow Removal',
31
+ profile_emails: 'snow@example.com', profile_contact_info: '403.123.1234', currency: 'CAD',
32
+ amount: '35.00', due_date: '2020-08-14', payable_by: ['CC', 'OBP'],
33
+ message: 'This is your invoice for services rendered.'}
34
+ invoice_id = vc.create_invoice data
35
+ ```
36
+
37
+ - List Invoices
38
+ ```ruby
39
+ vc = VogogoClient.new('7098l9kachgdfcb63a8a09acb887f5j7', '456b4dbec13abcb98a8a70acb587f5dd', 'foo@example.com')
40
+ res = vc.list_invoices
41
+ puts 'Amount is: ' + res['objects'][0]['amount'] #Amount is: 35.00
42
+ ```
43
+
44
+ - Get Invoice
45
+ ```ruby
46
+ vc = VogogoClient.new('7098l9kachgdfcb63a8a09acb887f5j7', '456b4dbec13abcb98a8a70acb587f5dd', 'foo@example.com')
47
+ invoice = vc.get_invoice '87695'
48
+ puts 'Currency is: ' + invoice.parsed_response['currency'] #Currency is: CAD
49
+ ```
50
+
51
+ - Update Invoice
52
+ ```ruby
53
+ vc = VogogoClient.new('7098l9kachgdfcb63a8a09acb887f5j7', '456b4dbec13abcb98a8a70acb587f5dd', 'foo@example.com')
54
+ data = {amount: '50.00'}
55
+ res = vc.update_invoice '87695', data
56
+ puts res #true
57
+ ```
58
+
59
+ - Delete Invoice
60
+ ```ruby
61
+ vc = VogogoClient.new('7098l9kachgdfcb63a8a09acb887f5j7', '456b4dbec13abcb98a8a70acb587f5dd', 'foo@example.com')
62
+ res = vc.delete_invoice '87695'
63
+ puts res #true
64
+ ```
65
+
66
+ For all the rest of the API's methods we use the same approach used in the invoices
67
+
68
+ ```ruby
69
+ #Items
70
+ vc.create_item data
71
+ vc.get_item item_id
72
+ vc.list_items
73
+ vc.update_item item_id, data
74
+ vc.delete_item item_id
75
+ #Customers
76
+ vc.create_customer data
77
+ vc.get_customer customer_id
78
+ vc.list_customers
79
+ vc.update_customer customer_id, data
80
+ vc.delete_customer customer_id
81
+ #Customer Accounts
82
+ vc.create_customer_account data
83
+ vc.get_customer_account customer_account_id
84
+ vc.list_customer_accounts
85
+ vc.delete_customer_account customer_account_id
86
+ #Transactions
87
+ vc.post_credit_card_charge data
88
+ vc.post_eft_credit data
89
+ vc.post_deposit data
90
+ vc.post_withdrawal data
91
+ ```
92
+
93
+ ## Contributing
94
+
95
+ 1. Fork it
96
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
97
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
98
+ 4. Push to the branch (`git push origin my-new-feature`)
99
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ class DataHashError < ArgumentError
2
+ def initialize(msg = "Data hash error - input data not existed or empty")
3
+ super(msg)
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class IdentifierError < ArgumentError
2
+ def initialize(msg = "Identifier error - id not existed or empty")
3
+ super(msg)
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module VogogoRuby
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,195 @@
1
+ require "vogogo_ruby/version"
2
+ require 'vogogo_ruby/exceptions/identifier_error'
3
+ require 'vogogo_ruby/exceptions/data_hash_error'
4
+ require 'httparty'
5
+ module VogogoRuby
6
+ class VogogoDirectAPI
7
+ include HTTParty
8
+ API_URL = 'https://api.vogogo.com'
9
+ URL_BASE = '/v1/'
10
+ ACCOUNT = 'account'
11
+ CUSTOMER = 'customer'
12
+ INVOICE = 'invoice'
13
+ ITEM = 'item'
14
+ CUSTOMER_ACCOUNT = 'customer_account'
15
+ CREDIT_CARD_CHARGE = 'charge'
16
+ EFT_CREDIT = 'credit'
17
+ DEPOSIT = 'deposit'
18
+ WITHDRAWAL = 'withdrawal'
19
+
20
+ # debug_output $stderr
21
+
22
+ def initialize(key, token, user)
23
+ @auth = {username: user, password: key + ':' + token}
24
+ end
25
+
26
+ #Retrieve a list of financial accounts
27
+ def get_accounts
28
+ list ACCOUNT
29
+ end
30
+
31
+ #Retrieve an account details
32
+ def get_account account_id
33
+ raise IdentifierError.new 'account_id cannot be empty' if account_id.nil? || account_id.empty?
34
+ get ACCOUNT, account_id
35
+ end
36
+
37
+ def get_invoice invoice_id
38
+ raise IdentifierError.new 'invoice_id cannot be empty' if invoice_id.nil? || invoice_id.empty?
39
+ get INVOICE, invoice_id
40
+ end
41
+
42
+ def create_invoice data
43
+ raise DataHashError.new 'invoice details hash cannot be empty' if data.nil? || data.empty?
44
+ (create INVOICE, data).headers['location'].split('/').last
45
+ end
46
+
47
+ def update_invoice invoice_id, data
48
+ raise DataHashError.new 'invoice details hash cannot be empty' if data.nil? || data.empty?
49
+ raise IdentifierError.new 'invoice_id cannot be empty' if invoice_id.nil? || invoice_id.empty?
50
+ response = update INVOICE, invoice_id, data
51
+ response.response.code == '202' ? true : false
52
+ end
53
+
54
+ def list_invoices
55
+ list INVOICE
56
+ end
57
+
58
+ def delete_invoice invoice_id
59
+ raise IdentifierError.new 'invoice_id cannot be empty' if invoice_id.nil? || invoice_id.empty?
60
+ response = delete INVOICE, invoice_id
61
+ response.response.code == '204' ? true : false
62
+ end
63
+
64
+ def create_item data
65
+ raise DataHashError.new 'item details hash cannot be empty' if data.nil? || data.empty?
66
+ (create ITEM, data).headers['location'].split('/').last
67
+ end
68
+
69
+ def delete_item item_id
70
+ raise IdentifierError.new 'item_id cannot be empty' if item_id.nil? || item_id.empty?
71
+ response = delete ITEM, item_id
72
+ response.response.code == '204' ? true : false
73
+ end
74
+
75
+ def get_item item_id
76
+ raise IdentifierError.new 'item_id cannot be empty' if item_id.nil? || item_id.empty?
77
+ get ITEM, item_id
78
+ end
79
+
80
+ def list_items
81
+ list ITEM
82
+ end
83
+
84
+ def update_item item_id, data
85
+ raise DataHashError.new 'item details hash cannot be empty' if data.nil? || data.empty?
86
+ raise IdentifierError.new 'item_id cannot be empty' if item_id.nil? || item_id.empty?
87
+ response = update ITEM, item_id, data
88
+ response.response.code == '202' ? true : false
89
+ end
90
+
91
+ def create_customer data
92
+ raise DataHashError.new 'customer details hash cannot be empty' if data.nil? || data.empty?
93
+ (create CUSTOMER, data).headers['location'].split('/').last
94
+ end
95
+
96
+ def delete_customer customer_id
97
+ raise IdentifierError.new 'customer_id cannot be empty' if customer_id.nil? || customer_id.empty?
98
+ response = delete CUSTOMER, customer_id
99
+ response.response.code == '204' ? true : false
100
+ end
101
+
102
+ def get_customer customer_id
103
+ raise IdentifierError.new 'customer_id cannot be empty' if customer_id.nil? || customer_id.empty?
104
+ get CUSTOMER, customer_id
105
+ end
106
+
107
+ def list_customers
108
+ list CUSTOMER
109
+ end
110
+
111
+ def update_customer customer_id, data
112
+ raise DataHashError.new 'customer details hash cannot be empty' if data.nil? || data.empty?
113
+ raise IdentifierError.new 'customer_id cannot be empty' if customer_id.nil? || customer_id.empty?
114
+ response = update CUSTOMER, customer_id, data
115
+ response.response.code == '202' ? true : false
116
+ end
117
+
118
+ def create_customer_account data
119
+ raise DataHashError.new 'customer account details hash cannot be empty' if data.nil? || data.empty?
120
+ (create CUSTOMER_ACCOUNT, data).headers['location'].split('/').last
121
+ end
122
+
123
+ def delete_customer_account customer_account_id
124
+ raise IdentifierError.new 'customer_account_id cannot be empty' if customer_account_id.nil? || customer_account_id.empty?
125
+ response = delete CUSTOMER_ACCOUNT, customer_account_id
126
+ response.response.code == '204' ? true : false
127
+ end
128
+
129
+ def get_customer_account customer_account_id
130
+ raise IdentifierError.new 'customer_account_id cannot be empty' if customer_account_id.nil? || customer_account_id.empty?
131
+ get CUSTOMER_ACCOUNT, customer_account_id
132
+ end
133
+
134
+ def list_customer_accounts
135
+ list CUSTOMER_ACCOUNT
136
+ end
137
+
138
+ def post_credit_card_charge data
139
+ raise DataHashError.new 'credit card charge details hash cannot be empty' if data.nil? || data.empty?
140
+ create CREDIT_CARD_CHARGE, data
141
+ end
142
+
143
+ def post_eft_credit data
144
+ raise DataHashError.new 'eft credit details hash cannot be empty' if data.nil? || data.empty?
145
+ create EFT_CREDIT, data
146
+ end
147
+
148
+ def post_deposit data
149
+ raise DataHashError.new 'deposit details hash cannot be empty' if data.nil? || data.empty?
150
+ create DEPOSIT, data
151
+ end
152
+
153
+ def post_withdrawal data
154
+ raise DataHashError.new 'withdrawal details hash cannot be empty' if data.nil? || data.empty?
155
+ create WITHDRAWAL, data
156
+ end
157
+
158
+ private
159
+
160
+ def list entity
161
+ action('get', entity)
162
+ end
163
+
164
+ def create entity, data
165
+ action('post', entity, '', data)
166
+ end
167
+
168
+ def get entity, id
169
+ action('get', entity, id)
170
+ end
171
+
172
+ def update entity, id, data
173
+ action('patch', entity, id, data)
174
+ end
175
+
176
+ def delete entity, id
177
+ action('delete', entity, id)
178
+ end
179
+
180
+ def action method, entity, id = '', data = {}
181
+ options = {body: data.to_json, basic_auth: auth, headers: {'Content-Type' => 'application/json'}}
182
+ id << '/' unless id.empty?
183
+ self.class.send(method, path(entity.to_s + '/' + id.to_s), options)
184
+ end
185
+
186
+ def auth
187
+ @auth
188
+ end
189
+
190
+ def path(method)
191
+ API_URL + URL_BASE + method
192
+ end
193
+
194
+ end
195
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'vogogo_ruby'
5
+
6
+ RSpec.configure do |config|
7
+ # some (optional) config here
8
+ end
@@ -0,0 +1,232 @@
1
+ require 'spec_helper'
2
+ describe 'Direct API' do
3
+ before(:all) do
4
+ api_key = ENV['API_KEY']
5
+ app_token = ENV['APP_TOKEN']
6
+ user = ENV['USER']
7
+ @vda = VogogoRuby::VogogoDirectAPI.new(api_key, app_token, user)
8
+ end
9
+
10
+ it 'Vogogo keys should not be empty' do
11
+ ENV['API_KEY'].should_not be_empty
12
+ ENV['APP_TOKEN'].should_not be_empty
13
+ ENV['USER'].should_not be_empty
14
+ end
15
+
16
+ describe '-***Positive***-' do
17
+
18
+ describe 'Accounts' do
19
+ it 'should return accounts' do
20
+ ret = @vda.get_accounts
21
+ account_id = ret['objects'][0]['uuid']
22
+ ret['objects'].should be_kind_of Array
23
+ (@vda.get_account account_id)['uuid'].to_s.should eq account_id.gsub('/', '')
24
+ end
25
+ end
26
+
27
+ describe 'Invoice' do
28
+ it 'should create invoice' do
29
+ data = {customer_ref: 'Mr. Joe Jacob Blow', customer_emails: 'joe@example.com',
30
+ customer_contact_info: '123 Fake ST\nCalgary\nAlberta\n403.987.1231', profile_name: 'Jims Snow Removal',
31
+ profile_emails: 'snow@example.com', profile_contact_info: '403.123.1234', currency: 'CAD',
32
+ amount: '35.00', due_date: '2020-08-14', payable_by: ['CC', 'OBP'],
33
+ message: 'This is your invoice for services rendered.'}
34
+ @@invoice_id = @vda.create_invoice data
35
+ @@invoice_id.should_not be_empty
36
+ end
37
+
38
+ it 'should get invoice' do
39
+ invoice = @vda.get_invoice @@invoice_id
40
+ invoice['id'].should eq @@invoice_id.gsub('/', '')
41
+ end
42
+
43
+ it 'should update invoice' do
44
+ data = {payable_by: ['OBP']}
45
+ ret = @vda.update_invoice @@invoice_id, data
46
+ ret.should be true
47
+ end
48
+
49
+ it 'should delete invoice' do
50
+ ret = @vda.delete_invoice @@invoice_id
51
+ ret.should be true
52
+ end
53
+ end
54
+
55
+ describe 'Customer' do
56
+ it 'should create customer' do
57
+ data = {customer_ref: 'Mr. API Customer', emails: 'api_customer1@example.com',
58
+ contact_info: '124 Fake ST\nCalgary\nAlberta\n403.987.1231', subscribe: true, bcc_account_holder: false}
59
+ @@customer_id = @vda.create_customer data
60
+ @@customer_id.should_not be_empty
61
+ end
62
+
63
+ it 'should get customer' do
64
+ customer = @vda.get_customer @@customer_id
65
+ customer['id'].should eq @@customer_id.gsub('/', '')
66
+ end
67
+
68
+ it 'should update customer' do
69
+ data = {subscribe: false}
70
+ ret = @vda.update_customer @@customer_id, data
71
+ ret.should be true
72
+ end
73
+
74
+ it 'should delete customer' do
75
+ ret = @vda.delete_customer @@customer_id
76
+ ret.should be true
77
+ end
78
+ end
79
+
80
+ describe 'Item' do
81
+ it 'should create item' do
82
+ data = {unit_price: '25.00', code: 'RPI_G', description: 'Raspbery Pi Model B', quantity: 3}
83
+ @@item_id = @vda.create_item data
84
+ @@item_id.should_not be_empty
85
+ end
86
+
87
+ it 'should get item' do
88
+ item = @vda.get_item @@item_id
89
+ item['id'].should eq @@item_id.gsub('/', '')
90
+ end
91
+
92
+ it 'should update item' do
93
+ data = {unit_price: '50.00'}
94
+ ret = @vda.update_item @@item_id, data
95
+ ret.should be true
96
+ end
97
+
98
+ it 'should delete item' do
99
+ ret = @vda.delete_item @@item_id
100
+ ret.should be true
101
+ end
102
+ end
103
+
104
+ describe 'Customer Account' do
105
+ it 'should create customer account' do
106
+ data = {account_number: rand(999999999).to_s, account_type: 'BANK_PA', currency: 'CAD', name: 'API 88887',
107
+ transit_number: '80002', institution_number: '002'}
108
+ @@customer_account_id = @vda.create_customer_account data
109
+ @@customer_account_id.should_not be_empty
110
+ end
111
+
112
+ it 'should get customer account' do
113
+ customer_account = @vda.get_customer_account @@customer_account_id
114
+ customer_account.parsed_response['uuid'].should eq @@customer_account_id.gsub('/', '')
115
+ end
116
+
117
+ it 'should delete customer account' do
118
+ ret = @vda.delete_customer_account @@customer_account_id
119
+ ret.should be true
120
+ end
121
+ end
122
+ end
123
+
124
+ describe '-***Negative***-' do
125
+
126
+ describe 'Accounts' do
127
+ it 'should raise IdentifierError' do
128
+ expect { @vda.get_account '' }.to raise_error(IdentifierError)
129
+ expect { @vda.get_account nil }.to raise_error(IdentifierError)
130
+ end
131
+ end
132
+
133
+ describe 'Invoice' do
134
+ it 'get should raise IdentifierError' do
135
+ expect { @vda.get_invoice '' }.to raise_error(IdentifierError)
136
+ expect { @vda.get_invoice nil }.to raise_error(IdentifierError)
137
+ end
138
+
139
+ it 'create should raise DataHashError' do
140
+ expect { @vda.create_invoice '' }.to raise_error(DataHashError)
141
+ expect { @vda.create_invoice nil }.to raise_error(DataHashError)
142
+ end
143
+
144
+ it 'update should raise DataHashError' do
145
+ expect { @vda.update_invoice 'xyz', '' }.to raise_error(DataHashError)
146
+ expect { @vda.update_invoice 'xyz', nil }.to raise_error(DataHashError)
147
+ end
148
+
149
+ it 'update should raise IdentifierError' do
150
+ expect { @vda.update_invoice '', 'xyz' }.to raise_error(IdentifierError)
151
+ expect { @vda.update_invoice nil, 'xyz' }.to raise_error(IdentifierError)
152
+ end
153
+
154
+ it 'delete should raise IdentifierError' do
155
+ expect { @vda.delete_invoice '' }.to raise_error(IdentifierError)
156
+ expect { @vda.delete_invoice nil }.to raise_error(IdentifierError)
157
+ end
158
+ end
159
+
160
+ describe 'Item' do
161
+ it 'get should raise IdentifierError' do
162
+ expect { @vda.get_item '' }.to raise_error(IdentifierError)
163
+ expect { @vda.get_item nil }.to raise_error(IdentifierError)
164
+ end
165
+
166
+ it 'create should raise DataHashError' do
167
+ expect { @vda.create_item '' }.to raise_error(DataHashError)
168
+ expect { @vda.create_item nil }.to raise_error(DataHashError)
169
+ end
170
+
171
+ it 'update should raise DataHashError' do
172
+ expect { @vda.update_item 'xyz', '' }.to raise_error(DataHashError)
173
+ expect { @vda.update_item 'xyz', nil }.to raise_error(DataHashError)
174
+ end
175
+
176
+ it 'update should raise IdentifierError' do
177
+ expect { @vda.update_item '', 'xyz' }.to raise_error(IdentifierError)
178
+ expect { @vda.update_item nil, 'xyz' }.to raise_error(IdentifierError)
179
+ end
180
+
181
+ it 'delete should raise IdentifierError' do
182
+ expect { @vda.delete_item '' }.to raise_error(IdentifierError)
183
+ expect { @vda.delete_item nil }.to raise_error(IdentifierError)
184
+ end
185
+ end
186
+
187
+ describe 'Customer' do
188
+ it 'get should raise IdentifierError' do
189
+ expect { @vda.get_customer '' }.to raise_error(IdentifierError)
190
+ expect { @vda.get_customer nil }.to raise_error(IdentifierError)
191
+ end
192
+
193
+ it 'create should raise DataHashError' do
194
+ expect { @vda.create_customer '' }.to raise_error(DataHashError)
195
+ expect { @vda.create_customer nil }.to raise_error(DataHashError)
196
+ end
197
+
198
+ it 'update should raise DataHashError' do
199
+ expect { @vda.update_customer 'xyz', '' }.to raise_error(DataHashError)
200
+ expect { @vda.update_customer 'xyz', nil }.to raise_error(DataHashError)
201
+ end
202
+
203
+ it 'update should raise IdentifierError' do
204
+ expect { @vda.update_customer '', 'xyz' }.to raise_error(IdentifierError)
205
+ expect { @vda.update_customer nil, 'xyz' }.to raise_error(IdentifierError)
206
+ end
207
+
208
+ it 'delete should raise IdentifierError' do
209
+ expect { @vda.delete_customer '' }.to raise_error(IdentifierError)
210
+ expect { @vda.delete_customer nil }.to raise_error(IdentifierError)
211
+ end
212
+ end
213
+
214
+ describe 'Customer Account' do
215
+ it 'get should raise IdentifierError' do
216
+ expect { @vda.get_customer_account '' }.to raise_error(IdentifierError)
217
+ expect { @vda.get_customer_account nil }.to raise_error(IdentifierError)
218
+ end
219
+
220
+ it 'create should raise DataHashError' do
221
+ expect { @vda.create_customer_account '' }.to raise_error(DataHashError)
222
+ expect { @vda.create_customer_account nil }.to raise_error(DataHashError)
223
+ end
224
+
225
+ it 'delete should raise IdentifierError' do
226
+ expect { @vda.delete_customer_account '' }.to raise_error(IdentifierError)
227
+ expect { @vda.delete_customer_account nil }.to raise_error(IdentifierError)
228
+ end
229
+ end
230
+ end
231
+
232
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vogogo_ruby/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vogogo_ruby"
8
+ spec.version = VogogoRuby::VERSION
9
+ spec.authors = ["Ahmed Youssef"]
10
+ spec.email = ["ahmed.adel.87@gmail.com"]
11
+ spec.description = %q{Consuming Vogogo.com direct integration APIs}
12
+ spec.summary = %q{Consuming Vogogo.com direct integration APIs}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "httparty"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.3"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
26
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vogogo_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ahmed Youssef
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-16 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Consuming Vogogo.com direct integration APIs
70
+ email:
71
+ - ahmed.adel.87@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - lib/vogogo_ruby.rb
82
+ - lib/vogogo_ruby/exceptions/data_hash_error.rb
83
+ - lib/vogogo_ruby/exceptions/identifier_error.rb
84
+ - lib/vogogo_ruby/version.rb
85
+ - spec/spec_helper.rb
86
+ - spec/vogogo_ruby_spec.rb
87
+ - vogogo_ruby.gemspec
88
+ homepage: ''
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.1.11
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Consuming Vogogo.com direct integration APIs
112
+ test_files:
113
+ - spec/spec_helper.rb
114
+ - spec/vogogo_ruby_spec.rb
115
+ has_rdoc: