billogram 0.3.4 → 0.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fadd6213aa124ee984518313a5e6efa9ab69f850
4
- data.tar.gz: 6cd8a165334d0caf5e4759cf5d9b62c253e3f81b
3
+ metadata.gz: 965138ccd131dce9e5a9f15df46be337f475f56a
4
+ data.tar.gz: 42d9b19c62e470673ae673f42bc3f8ae88a11bba
5
5
  SHA512:
6
- metadata.gz: 53acd31be13d777e960e46251a18956e761b2adbafe6b54006d3864bf167e066196f3f0eefe2364111b3361fe6cb602411068b5c24b3b0f1135576f6f93f02ec
7
- data.tar.gz: ce5f2603f091d041eef0d964950a75108df450007f125ceac60bacae81282340dfa41570008ab1f992c199c1693d196e7e658375d016bba68f8fde6ee44f1d94
6
+ metadata.gz: 9d20a423ff9c92aec634633e6d150e370664cbea22546ca434bbca311311f7125270ff07dae106d14f01a5a3be1f5795970e03c7fc6719b0192e04252145d547
7
+ data.tar.gz: 8cb71574eec60220cdf1fcba61111a1c6e6f9cdb4840a6cf1bb5a2286a511d57edb4d5f120b71228767dee3e38b69541e2ed3050f7c238db0cd6f2cb37bb2b75
data/lib/billogram.rb CHANGED
@@ -5,10 +5,11 @@ require "billogram/relation_builder"
5
5
  require "billogram/resource"
6
6
  require 'billogram/resources/address'
7
7
  require 'billogram/resources/bookkeeping'
8
- require 'billogram/resources/callback'
8
+ require 'billogram/resources/callbacks'
9
9
  require 'billogram/resources/contact'
10
10
  require 'billogram/resources/customer'
11
11
  require 'billogram/resources/data'
12
+ require 'billogram/resources/detailed_sums'
12
13
  require 'billogram/resources/delivery_address'
13
14
  require 'billogram/resources/event'
14
15
  require 'billogram/resources/info'
@@ -1,3 +1,5 @@
1
1
  ActiveSupport::Inflector.inflections do |inflect|
2
2
  inflect.irregular 'data', 'data'
3
+ inflect.irregular 'callbacks', 'callbacks'
4
+ inflect.irregular 'sums', 'sums'
3
5
  end
@@ -85,5 +85,12 @@ module Billogram
85
85
  def endpoint
86
86
  self.class.endpoint
87
87
  end
88
+
89
+ def to_json(*args)
90
+ instance_variables
91
+ .map{|var| ["#{var}"[1..-1], instance_variable_get(var)]}
92
+ .to_h
93
+ .to_json(*args)
94
+ end
88
95
  end
89
96
  end
@@ -1,5 +1,5 @@
1
1
  module Billogram
2
- class Callback < Resource
2
+ class Callbacks < Resource
3
3
  attr_accessor :callback_id, :custom, :signature, :sandbox
4
4
 
5
5
  relation :event, :one
@@ -0,0 +1,9 @@
1
+ module Billogram
2
+ class DetailedSums < Resource
3
+ attr_accessor :credited_sum, :net_sum, :gross_sum, :invoice_fee_vat, :paid_sum,
4
+ :interest_fee, :vat_sum, :reminder_fee, :invoice_fee, :rounding, :collector_paid_sum,
5
+ :remaining_sum
6
+
7
+ relation :regional_sweden, :one
8
+ end
9
+ end
@@ -12,6 +12,8 @@ module Billogram
12
12
  relation :info, :one
13
13
  relation :customer, :one
14
14
  relation :regional_sweden, :one
15
+ relation :callbacks, :one
16
+ relation :detailed_sums, :one
15
17
 
16
18
  relation :items, :many
17
19
  relation :events, :many
@@ -1,3 +1,3 @@
1
1
  module Billogram
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
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
4
+ version: 0.3.5
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-31 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,11 +148,12 @@ files:
148
148
  - lib/billogram/resource.rb
149
149
  - lib/billogram/resources/address.rb
150
150
  - lib/billogram/resources/bookkeeping.rb
151
- - lib/billogram/resources/callback.rb
151
+ - lib/billogram/resources/callbacks.rb
152
152
  - lib/billogram/resources/contact.rb
153
153
  - lib/billogram/resources/customer.rb
154
154
  - lib/billogram/resources/data.rb
155
155
  - lib/billogram/resources/delivery_address.rb
156
+ - lib/billogram/resources/detailed_sums.rb
156
157
  - lib/billogram/resources/event.rb
157
158
  - lib/billogram/resources/info.rb
158
159
  - lib/billogram/resources/invoice.rb