bill_forward 1.2015.217 → 1.2015.217.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 +4 -4
- data/README.md +3 -1
- data/lib/bill_forward/entities/generic_entity.rb +25 -0
- data/lib/bill_forward/entities/subscription.rb +32 -1
- data/lib/bill_forward/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA512:
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
metadata.gz: 36859defb8b4cab57fd19f2d43a18f5173c0aafef9f81b02432089bcdb5abc304f1a9bd0fc822812b8b033a0b5da27ce50d694bbd9917fe7b58e357e45ed9304
|
|
4
|
+
data.tar.gz: 43962803784339c2d072b47db0254ca0ea9fdde0b03fb86e1c613a084fc271555c05046263df70b478c9b48a37be52f5625c059de82eb1837ae5486f1e8d7ad4
|
|
5
5
|
SHA1:
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
metadata.gz: 32d9639dc234eac3ca071cf6b7fcef5f9b53c63a
|
|
7
|
+
data.tar.gz: 8ac698214ccdc10359278cb6cc813af19c1fd35c
|
data/README.md
CHANGED
|
@@ -290,6 +290,8 @@ Bump the version in `lib/bill_forward/version.rb`, with a major version bump if
|
|
|
290
290
|
|
|
291
291
|
Minor revision is determined by [days since start of year](http://www.wolframalpha.com/input/?i=days+since+start+of+year) (rounded down).
|
|
292
292
|
|
|
293
|
+
If you publish twice in a day, it becomes day.1, day.2 and so on.
|
|
294
|
+
|
|
293
295
|
Build the gemspec locally:
|
|
294
296
|
|
|
295
297
|
```bash
|
|
@@ -299,5 +301,5 @@ gem build bill_forward.gemspec
|
|
|
299
301
|
Then publish the resulting gem:
|
|
300
302
|
|
|
301
303
|
```bash
|
|
302
|
-
gem
|
|
304
|
+
gem push bill_forward-1.2015.217.gem
|
|
303
305
|
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module BillForward
|
|
2
|
+
class GenericEntity < MutableEntity
|
|
3
|
+
class << self
|
|
4
|
+
def create(entity = nil)
|
|
5
|
+
raise DenyMethod.new 'Create support is denied for this entity; '+
|
|
6
|
+
'it is just a payload wrapper, and is thus not a real entity in BillForward.'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def get_by_id(id, query_params = {}, customClient = nil)
|
|
10
|
+
raise DenyMethod.new 'Get by ID support is denied for this entity; '+
|
|
11
|
+
'it is just a payload wrapper, and is thus not a real entity in BillForward.'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def get_all(query_params = {}, customClient = nil)
|
|
15
|
+
raise DenyMethod.new 'Get All support is denied for this entity; '+
|
|
16
|
+
'it is just a payload wrapper, and is thus not a real entity in BillForward.'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def save()
|
|
21
|
+
raise DenyMethod.new 'Save support is denied for this entity; '+
|
|
22
|
+
'it is just a payload wrapper, and is thus not a real entity in BillForward.'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -38,9 +38,40 @@ module BillForward
|
|
|
38
38
|
response
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
def add_payment_method(id)
|
|
42
|
+
raise ArgumentError.new("id cannot be nil") if id.nil?
|
|
43
|
+
|
|
44
|
+
endpoint = sprintf('%s/payment-methods',
|
|
45
|
+
ERB::Util.url_encode(self.id)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
request_entity = BillForward::GenericEntity.new({
|
|
49
|
+
'id' => id
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
self.class.request_first('post', endpoint, request_entity, nil, custom_client)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def remove_payment_method(id)
|
|
56
|
+
raise ArgumentError.new("id cannot be nil") if id.nil?
|
|
57
|
+
|
|
58
|
+
endpoint = sprintf('%s/payment-methods/%s',
|
|
59
|
+
ERB::Util.url_encode(self.id),
|
|
60
|
+
ERB::Util.url_encode(id)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
self.class.request_first('delete', endpoint, nil, custom_client)
|
|
64
|
+
end
|
|
42
65
|
|
|
66
|
+
def get_payment_methods(query_params = {}, custom_client = nil)
|
|
67
|
+
endpoint = sprintf('%s/payment-methods',
|
|
68
|
+
ERB::Util.url_encode(self.id)
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
self.class.request_many_heterotyped(BillForward::PaymentMethod, 'get', endpoint, query_params, custom_client)
|
|
72
|
+
end
|
|
43
73
|
|
|
74
|
+
#### MIGRATE PLAN VIA AMENDMENT
|
|
44
75
|
|
|
45
76
|
# Migrates subscription to new plan, with PricingComponentValue values corresponding to named PricingComponents.
|
|
46
77
|
# This works only for 'arrears' or 'in advance' pricing components.
|
data/lib/bill_forward/version.rb
CHANGED
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.217
|
|
4
|
+
version: 1.2015.217.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BillForward
|
|
@@ -110,6 +110,7 @@ files:
|
|
|
110
110
|
- lib/bill_forward/entities/api_configuration.rb
|
|
111
111
|
- lib/bill_forward/entities/authorize_net_token.rb
|
|
112
112
|
- lib/bill_forward/entities/credit_note.rb
|
|
113
|
+
- lib/bill_forward/entities/generic_entity.rb
|
|
113
114
|
- lib/bill_forward/entities/invoice.rb
|
|
114
115
|
- lib/bill_forward/entities/invoice_parts/invoice_line.rb
|
|
115
116
|
- lib/bill_forward/entities/invoice_parts/invoice_payment.rb
|