fakturownia 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/lib/fakturownia/api.rb +27 -0
- data/lib/fakturownia/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/fakturownia/api.rb
CHANGED
@@ -98,6 +98,33 @@ module Fakturownia
|
|
98
98
|
http.delete(whole_url)
|
99
99
|
end
|
100
100
|
|
101
|
+
|
102
|
+
# Get all clients in XML
|
103
|
+
def self.clients
|
104
|
+
endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients.xml"
|
105
|
+
response = self.make_get_request(endpoint)
|
106
|
+
|
107
|
+
(response.code == '200') ? response.body : nil
|
108
|
+
end
|
109
|
+
|
110
|
+
# Get client based on client_id
|
111
|
+
# Return in XML
|
112
|
+
def self.client client_id
|
113
|
+
endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients/#{client_id}.xml"
|
114
|
+
response = self.make_get_request(endpoint)
|
115
|
+
|
116
|
+
(response.code == '200') ? response.body : nil
|
117
|
+
end
|
118
|
+
|
119
|
+
# Get client based on email and password
|
120
|
+
# Return in XML
|
121
|
+
def self.client_by_email_and_password email, password
|
122
|
+
endpoint = "https://#{Fakturownia.account_name}.fakturownia.pl/clients/check"
|
123
|
+
response = self.make_get_request(endpoint, { :email => email, :password => password })
|
124
|
+
|
125
|
+
(response.code == '200' and response.body.to_s != 'brak klienta') ? response.body : nil
|
126
|
+
end
|
127
|
+
|
101
128
|
|
102
129
|
# Make GET request returning response
|
103
130
|
def self.make_get_request endpoint, additional_params = {}
|
data/lib/fakturownia/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakturownia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -94,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
segments:
|
96
96
|
- 0
|
97
|
-
hash:
|
97
|
+
hash: 2331183322955811531
|
98
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
99
|
none: false
|
100
100
|
requirements:
|