aptible-billing 0.1.1 → 0.1.2

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: 18d3cbfe259be3700b30379d0a68c59aea9be212
4
- data.tar.gz: b762d05518e15a05b1da35f31b849ff543c7afa6
3
+ metadata.gz: 7a075c9988a847b87506686ffa23a0a31a73ef5d
4
+ data.tar.gz: 871ce76d451831325320cbe5873ccdd4cca56ad4
5
5
  SHA512:
6
- metadata.gz: 1ff70c7f14861ce52fb3d97e6a8bbdbbe0f1b4b8f4111c7671435f4452f117ca43d1e4501004a2a2f9dde6035ca9698e897016928e264c567e68fe93046ce88d
7
- data.tar.gz: 1d5b1c3a014c34b87ebc493a447e3930b7a6b75fb1a52c13e447a672cb87d7644cc42ee90495c4bf87340dd013a988f8ba796fbcddfb2a2831f8248815063c0f
6
+ metadata.gz: f24dbbb6bf995f6e8a264173f651aede0336d1b50598dca666201505daf5324aa1fbb812d43df5f853c5f5fe1d3dec8b67e422484e34ecd0fa42d9e1012ae722
7
+ data.tar.gz: d413addbc7967a2a7c064d83ee6dce01590aeb1ac6e2408d0d0f090bdeda69a723cfeb0eaeeceb4337cf3d2f1012528caf48156c0b0f3035b3dd17ea11ebb12d
@@ -10,8 +10,24 @@ module Aptible
10
10
  field :stripe_subscription_id
11
11
  field :stripe_subscription_status
12
12
  field :plan
13
- field :billing_contact
14
- field :organization
13
+
14
+ def organization
15
+ Aptible::Auth::Organization.find_by_url(
16
+ links['organization'].href,
17
+ token: token,
18
+ headers: headers)
19
+ rescue
20
+ nil
21
+ end
22
+
23
+ def billing_contact
24
+ Aptible::Auth::User.find_by_url(
25
+ links['billing_contact'].href,
26
+ token: token,
27
+ headers: headers)
28
+ rescue
29
+ nil
30
+ end
15
31
 
16
32
  def stripe_customer
17
33
  return nil if stripe_customer_id.nil?
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Billing
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Pettersson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stripe