bill_forward 1.2015.217 → 1.2015.217.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA512:
3
- data.tar.gz: 6cee9b9e5c6e248aeee7a7480fd1e072354e668d43a25ed6fe29758d8b22170c55479524dfe0a786a507c99bf3c9753781b5c28b4abc623695e8471abb582436
4
- metadata.gz: 5aa2778c1841499a2ed5c803e9158f221744f5ea0d27f60cce0d6d5afc4af8267644e7c000e7e1c348d8c2c88487fc054926219ea1ab4d8814ed7792563294a2
3
+ metadata.gz: 36859defb8b4cab57fd19f2d43a18f5173c0aafef9f81b02432089bcdb5abc304f1a9bd0fc822812b8b033a0b5da27ce50d694bbd9917fe7b58e357e45ed9304
4
+ data.tar.gz: 43962803784339c2d072b47db0254ca0ea9fdde0b03fb86e1c613a084fc271555c05046263df70b478c9b48a37be52f5625c059de82eb1837ae5486f1e8d7ad4
5
5
  SHA1:
6
- data.tar.gz: 89ea27c2853fdc0b7f0d95a5a1d7e3251713818a
7
- metadata.gz: ca8daa6171b817f9861c67494bccd180f25ce11f
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 publish bill_forward-1.2015.217.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
- #### MIGRATE PLAN VIA AMENDMENT
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.
@@ -1,4 +1,4 @@
1
1
  module BillForward
2
2
  # in an rspec run, the gemspec and bill_forward.rb loader will both visit this
3
- VERSION = "1.2015.217" unless const_defined?(:VERSION)
3
+ VERSION = "1.2015.217.1" unless const_defined?(:VERSION)
4
4
  end
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