billogram 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/billogram.gemspec +1 -0
- data/lib/billogram.rb +2 -0
- data/lib/billogram/inflections.rb +3 -0
- data/lib/billogram/relation_builder.rb +1 -2
- data/lib/billogram/resource.rb +8 -0
- data/lib/billogram/resources/customer.rb +2 -0
- data/lib/billogram/resources/invoice.rb +22 -17
- data/lib/billogram/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fadd6213aa124ee984518313a5e6efa9ab69f850
|
4
|
+
data.tar.gz: 6cd8a165334d0caf5e4759cf5d9b62c253e3f81b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53acd31be13d777e960e46251a18956e761b2adbafe6b54006d3864bf167e066196f3f0eefe2364111b3361fe6cb602411068b5c24b3b0f1135576f6f93f02ec
|
7
|
+
data.tar.gz: ce5f2603f091d041eef0d964950a75108df450007f125ceac60bacae81282340dfa41570008ab1f992c199c1693d196e7e658375d016bba68f8fde6ee44f1d94
|
data/billogram.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.10"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "rspec-its"
|
27
28
|
spec.add_development_dependency "webmock", "~> 1.21"
|
28
29
|
spec.add_development_dependency "dotenv", "~> 2.0"
|
29
30
|
spec.add_dependency "httparty", "~> 0.13"
|
data/lib/billogram.rb
CHANGED
@@ -16,8 +16,7 @@ module Billogram
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def relation_class(relation_name)
|
19
|
-
|
20
|
-
"Billogram::#{class_name}".constantize
|
19
|
+
"Billogram::#{relation_name.to_s.classify}".constantize
|
21
20
|
end
|
22
21
|
|
23
22
|
def relation_attributes(relation_name)
|
data/lib/billogram/resource.rb
CHANGED
@@ -17,44 +17,49 @@ module Billogram
|
|
17
17
|
relation :events, :many
|
18
18
|
|
19
19
|
def sell
|
20
|
-
perform_request(
|
20
|
+
perform_request(command_path(:sell), :post)
|
21
21
|
end
|
22
22
|
|
23
23
|
def collect
|
24
|
-
perform_request(
|
24
|
+
perform_request(command_path(:collect), :post)
|
25
25
|
end
|
26
26
|
|
27
|
-
def writeoff
|
28
|
-
perform_request(
|
27
|
+
def writeoff
|
28
|
+
perform_request(command_path(:writeoff), :post)
|
29
29
|
end
|
30
30
|
|
31
|
-
def send!(
|
32
|
-
|
33
|
-
perform_request("#{endpoint}/#{id}/command/send", :post, options)
|
31
|
+
def send!(method: )
|
32
|
+
perform_request(command_path(:send), :post, {method: method})
|
34
33
|
end
|
35
34
|
|
36
|
-
def resend(
|
37
|
-
perform_request(
|
35
|
+
def resend(method: )
|
36
|
+
perform_request(command_path(:resend), :post, {method: method})
|
38
37
|
end
|
39
38
|
|
40
|
-
def remind(
|
41
|
-
perform_request(
|
39
|
+
def remind(method: )
|
40
|
+
perform_request(command_path(:remind), :post, {method: method})
|
42
41
|
end
|
43
42
|
|
44
|
-
def payment(
|
45
|
-
perform_request(
|
43
|
+
def payment(amount: )
|
44
|
+
perform_request(command_path(:payment), :post, {amount: amount})
|
46
45
|
end
|
47
46
|
|
48
47
|
def credit(options = {})
|
49
|
-
perform_request(
|
48
|
+
perform_request(command_path(:credit), :post, options)
|
50
49
|
end
|
51
50
|
|
52
|
-
def message(
|
53
|
-
perform_request(
|
51
|
+
def message(message: )
|
52
|
+
perform_request(command_path(:message), :post, {message: message})
|
54
53
|
end
|
55
54
|
|
56
55
|
def attach(options = {})
|
57
|
-
perform_request(
|
56
|
+
perform_request(command_path(:attach), :post, options)
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def command_path(command)
|
62
|
+
"#{endpoint}/#{id}/command/#{command}"
|
58
63
|
end
|
59
64
|
end
|
60
65
|
end
|
data/lib/billogram/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: billogram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Birman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-its
|
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'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: webmock
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,6 +143,7 @@ files:
|
|
129
143
|
- lib/billogram.rb
|
130
144
|
- lib/billogram/client.rb
|
131
145
|
- lib/billogram/error.rb
|
146
|
+
- lib/billogram/inflections.rb
|
132
147
|
- lib/billogram/relation_builder.rb
|
133
148
|
- lib/billogram/resource.rb
|
134
149
|
- lib/billogram/resources/address.rb
|