capital_one 0.2.0 → 0.3.0
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 +4 -4
- data/lib/capital_one/account.rb +3 -2
- data/lib/capital_one/bill.rb +3 -2
- data/lib/capital_one/customer.rb +3 -2
- data/lib/capital_one/deposit.rb +3 -3
- data/lib/capital_one/transaction.rb +3 -2
- data/lib/capital_one/withdrawal.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbc2f9909981e3e6c28c5ffedaf019df1b8c8331
|
4
|
+
data.tar.gz: 3324bd1688e85d433110080cec4144850fa5ea6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a19f6ee7e419509ae32fce8b96128585886fb257c4bc81f9a217400cc07efe9e66add806674a1e5a69aff3de3f94a28af3bbbf160d03d5182763c6642755a2b
|
7
|
+
data.tar.gz: c9d75359a81e350be15e5497d5dfda449330d0ab2f6f6d3c5eb8e540666759291a4401585401313032fa3f0baaa67e8872aa37fde8959f1947aa02ad5c0a4239
|
data/lib/capital_one/account.rb
CHANGED
@@ -62,12 +62,13 @@ class Account
|
|
62
62
|
#Parameters: AccountID, AccountHash
|
63
63
|
#Returns the http response code.
|
64
64
|
def self.updateAccount(accountId, account)
|
65
|
+
accountToUpdate = account.to_json
|
65
66
|
url = "#{self.urlWithEntity}/#{accountId}?key=#{self.apiKey}"
|
66
67
|
uri = URI.parse(url)
|
67
68
|
http = Net::HTTP.new(uri.host, uri.port)
|
68
69
|
key = "?key=#{self.apiKey}"
|
69
|
-
request = Net::HTTP::Put.new(uri.path+key)
|
70
|
-
request.
|
70
|
+
request = Net::HTTP::Put.new(uri.path+key, initheader = {'Content-Type' =>'application/json'})
|
71
|
+
request.body = accountToUpdate
|
71
72
|
response = http.request(request)
|
72
73
|
return JSON.parse(response.body)
|
73
74
|
end
|
data/lib/capital_one/bill.rb
CHANGED
@@ -73,12 +73,13 @@ class Bill
|
|
73
73
|
#Returns http response code.
|
74
74
|
|
75
75
|
def self.updateBill(accountId, billId, bill)
|
76
|
+
billToUpdate = bill.to_json
|
76
77
|
url = "#{self.accountBaseUrl}/#{accountId}/bills/#{billId}?key=#{self.apiKey}"
|
77
78
|
uri = URI.parse(url)
|
78
79
|
http = Net::HTTP.new(uri.host, uri.port)
|
79
80
|
key = "?key=#{self.apiKey}"
|
80
|
-
request = Net::HTTP::Put.new(uri.path+key)
|
81
|
-
request.
|
81
|
+
request = Net::HTTP::Put.new(uri.path+key, initheader = {'Content-Type' =>'application/json'})
|
82
|
+
request.body = billToUpdate
|
82
83
|
response = http.request(request)
|
83
84
|
return JSON.parse(response.body)
|
84
85
|
end
|
data/lib/capital_one/customer.rb
CHANGED
@@ -64,12 +64,13 @@ class Customer
|
|
64
64
|
# }
|
65
65
|
#Returns http response code.
|
66
66
|
def self.updateCustomer(custID, customer)
|
67
|
+
customerToUpdate = customer.to_json
|
67
68
|
url = "#{self.urlWithEntity}/#{custID}?key=#{self.apiKey}"
|
68
69
|
uri = URI.parse(url)
|
69
70
|
http = Net::HTTP.new(uri.host, uri.port)
|
70
71
|
key = "?key=#{self.apiKey}"
|
71
|
-
request = Net::HTTP::Put.new(uri.path+key)
|
72
|
-
request.
|
72
|
+
request = Net::HTTP::Put.new(uri.path+key, initheader = {'Content-Type' =>'application/json'})
|
73
|
+
request.body = customerToUpdate
|
73
74
|
response = http.request(request)
|
74
75
|
return JSON.parse(response.body)
|
75
76
|
end
|
data/lib/capital_one/deposit.rb
CHANGED
@@ -45,12 +45,13 @@ class Deposit
|
|
45
45
|
#Creates a new deposit.
|
46
46
|
#Parameters: toAccountId, hashWithDepositData
|
47
47
|
#Returns http response code.
|
48
|
-
def self.createDeposit(toAcc,
|
48
|
+
def self.createDeposit(toAcc, deposit)
|
49
|
+
depositToCreate = deposit.to_json
|
49
50
|
url = "#{self.urlWithEntity}/#{toAcc}/deposits?key=#{self.apiKey}"
|
50
51
|
uri = URI.parse(url)
|
51
52
|
http = Net::HTTP.new(uri.host, uri.port)
|
52
53
|
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' => 'application/json'})
|
53
|
-
request.body =
|
54
|
+
request.body = depositToCreate
|
54
55
|
resp = http.request(request)
|
55
56
|
data = JSON.parse(resp.body)
|
56
57
|
end
|
@@ -72,6 +73,5 @@ class Deposit
|
|
72
73
|
key="?key=#{self.apiKey}"
|
73
74
|
request = Net::HTTP::Delete.new(uri.path+key)
|
74
75
|
resp = http.request(request)
|
75
|
-
data = JSON.parse(resp.body)
|
76
76
|
end
|
77
77
|
end
|
@@ -71,12 +71,13 @@ class Transaction
|
|
71
71
|
#Creates a new transaction.
|
72
72
|
#Parameters: toAccountId, hashWithTransacionData
|
73
73
|
#Returns http response code.
|
74
|
-
def self.createTransaction(toAcc,
|
74
|
+
def self.createTransaction(toAcc, transaction)
|
75
|
+
transactionToCreate = transaction.to_json
|
75
76
|
url = "#{self.urlWithEntity}/#{toAcc}/transactions?key=#{self.apiKey}"
|
76
77
|
uri = URI.parse(url)
|
77
78
|
http = Net::HTTP.new(uri.host, uri.port)
|
78
79
|
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' => 'application/json'})
|
79
|
-
request.body =
|
80
|
+
request.body = transactionToCreate
|
80
81
|
resp = http.request(request)
|
81
82
|
data = JSON.parse(resp.body)
|
82
83
|
end
|
@@ -45,12 +45,13 @@ class Withdrawal
|
|
45
45
|
#Creates a new withdrawal.
|
46
46
|
#Parameters: toAccountId, hashWithWithdrawalData
|
47
47
|
#Returns http response code.
|
48
|
-
def self.createWithdrawal(toAcc,
|
48
|
+
def self.createWithdrawal(toAcc, withdrawal)
|
49
|
+
withdrawalToCreate = withdrawal.to_json
|
49
50
|
url = "#{self.urlWithEntity}/#{toAcc}/withdrawals?key=#{self.apiKey}"
|
50
51
|
uri = URI.parse(url)
|
51
52
|
http = Net::HTTP.new(uri.host, uri.port)
|
52
53
|
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' => 'application/json'})
|
53
|
-
request.body =
|
54
|
+
request.body = withdrawalToCreate
|
54
55
|
resp = http.request(request)
|
55
56
|
data = JSON.parse(resp.body)
|
56
57
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capital_one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Besong
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|