bill_forward 1.2015.183 → 1.2015.186
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 +5 -5
- data/lib/bill_forward/billing_entity.rb +17 -2
- data/lib/bill_forward/entities/subscription.rb +14 -0
- data/lib/bill_forward/version.rb +1 -1
- data/spec/functional/bad_citizen/situational/malordered_entity_spec.rb +1 -1
- data/spec/functional/organisation_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 03950eb3b76ab947d2c992800c770876757a078c
|
4
|
-
data.tar.gz: c748b8b839b282579d191d3d3357db11bba5969e
|
5
2
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcb3c0a8b2ab8282898254511825062da03f3d7111419c87d210b3f2650a4a0a9edcf197482bea4942c4115262aa064cf919fd3aa7f576021d4f5931b9aa9f89
|
4
|
+
data.tar.gz: d364d04d13a95188a0c3ffddea745cfb84a49f4f0f6afb3b636ece6b52a4609c21ee5c2359cbfd22193b6fd425cebbe18a910012b69ab9339f80aaa5e3064ca2
|
5
|
+
SHA1:
|
6
|
+
metadata.gz: 57c81fad0beeda2549ebc4d6fd6f21c3aefb4a26
|
7
|
+
data.tar.gz: 7f47a2f6d9e233013b76ff2c0130b440fddd5bc8
|
@@ -139,14 +139,29 @@ module BillForward
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
|
+
|
143
|
+
|
142
144
|
def method_missing(method_id, *arguments, &block)
|
145
|
+
def camel_case_lower(operand)
|
146
|
+
operand.split('_').reduce('') do |accumulator, iterand|
|
147
|
+
accumulator.empty? \
|
148
|
+
? iterand \
|
149
|
+
: accumulator + iterand.capitalize
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
qualified = camel_case_lower method_id.to_s
|
154
|
+
if qualified != method_id.to_s
|
155
|
+
return self.send(qualified.intern, *arguments)
|
156
|
+
end
|
157
|
+
|
143
158
|
# no call to super; our criteria is all keys.
|
144
159
|
#setter
|
145
|
-
if /^(\w+)=$/ =~
|
160
|
+
if /^(\w+)=$/ =~ qualified
|
146
161
|
return set_state_param($1, arguments.first)
|
147
162
|
end
|
148
163
|
#getter
|
149
|
-
get_state_param(
|
164
|
+
get_state_param(qualified)
|
150
165
|
end
|
151
166
|
|
152
167
|
def [](key)
|
@@ -18,6 +18,20 @@ module BillForward
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
def productRatePlan
|
22
|
+
if (super.nil?)
|
23
|
+
self.productRatePlan = BillForward::ProductRatePlan::get_by_id self.productRatePlanID
|
24
|
+
end
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def product
|
29
|
+
if (super.nil?)
|
30
|
+
self.product = BillForward::Product::get_by_id self.productID
|
31
|
+
end
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
21
35
|
def activate
|
22
36
|
set_state_param('state', 'AwaitingPayment')
|
23
37
|
response = save
|
data/lib/bill_forward/version.rb
CHANGED
@@ -29,7 +29,7 @@ describe BillForward::Amendment do
|
|
29
29
|
allow(amendment.class).to receive(:resource_path).and_return(BillForward::InvoiceRecalculationAmendment.resource_path)
|
30
30
|
allow(amendment).to receive(:serialize).and_return(malformed_serialize)
|
31
31
|
|
32
|
-
expect{BillForward::InvoiceRecalculationAmendment.create(amendment)}.to raise_error(BillForward::ApiError, /500/)
|
32
|
+
expect{BillForward::InvoiceRecalculationAmendment.create(amendment)}.to raise_error(BillForward::ApiError, /400|500/)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), "..", "spec_helper")
|
2
2
|
|
3
|
-
describe BillForward::
|
3
|
+
describe BillForward::Organisation do
|
4
4
|
before :all do
|
5
5
|
@client = BillForwardTest::TEST_CLIENT
|
6
6
|
BillForward::Client.default_client = @client
|
@@ -8,7 +8,7 @@ describe BillForward::Account do
|
|
8
8
|
describe '::get_all' do
|
9
9
|
it 'raises permissions error' do
|
10
10
|
# 'admin' privilege is insufficient to see other organisations
|
11
|
-
expect{BillForward::Organisation::get_all}.to raise_error(BillForward::ApiError, /500/)
|
11
|
+
expect{BillForward::Organisation::get_all}.to raise_error(BillForward::ApiError, /400|500/)
|
12
12
|
# Expected error:
|
13
13
|
# ====
|
14
14
|
# 500 API Error.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bill_forward
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2015.
|
4
|
+
version: 1.2015.186
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BillForward
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-06 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|