chargify_api_ares 1.1.0.pre → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.env +4 -0
  3. data/.gitignore +1 -0
  4. data/.rspec +1 -0
  5. data/.travis.yml +9 -0
  6. data/Gemfile +1 -1
  7. data/Gemfile.lock +7 -1
  8. data/HISTORY.md +9 -0
  9. data/README.md +1 -1
  10. data/chargify_api_ares.gemspec +4 -2
  11. data/examples/metadata.rb +58 -0
  12. data/examples/metafields.rb +32 -0
  13. data/lib/chargify_api_ares.rb +4 -2
  14. data/lib/chargify_api_ares/behaviors/inspectable.rb +33 -0
  15. data/lib/chargify_api_ares/behaviors/metadata.rb +61 -0
  16. data/lib/chargify_api_ares/behaviors/metafield.rb +30 -0
  17. data/lib/chargify_api_ares/resources/customer_metafield.rb +14 -1
  18. data/lib/chargify_api_ares/resources/invoice.rb +4 -4
  19. data/lib/chargify_api_ares/resources/subscription.rb +26 -3
  20. data/lib/chargify_api_ares/resources/subscription_metadata.rb +17 -0
  21. data/lib/chargify_api_ares/resources/subscription_metafield.rb +14 -1
  22. data/spec/cassettes/subscription/find.yml +266 -0
  23. data/spec/cassettes/subscription_metadata/create.yml +78 -0
  24. data/spec/cassettes/subscription_metadata/list-after-create.yml +77 -0
  25. data/spec/cassettes/subscription_metadata/list.yml +71 -0
  26. data/spec/factories.rb +1 -0
  27. data/spec/resources/customer_metafield_spec.rb +64 -0
  28. data/spec/resources/customer_spec.rb +4 -4
  29. data/spec/resources/subscription_metadata_spec.rb +54 -0
  30. data/spec/resources/subscription_metafield_spec.rb +63 -0
  31. data/spec/resources/subscription_spec.rb +27 -0
  32. data/spec/spec_helper.rb +14 -2
  33. metadata +78 -31
  34. data/lib/chargify_api_ares/metafield_xml_formatter.rb +0 -10
  35. data/lib/chargify_api_ares/resources/metafield.rb +0 -67
  36. data/spec/spec.opts +0 -2
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://acme_test_key:X@acme.chargify.dev/subscriptions/22/metadata.xml
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ authorization:
11
+ - Basic YWNtZV90ZXN0X2tleTpY
12
+ accept:
13
+ - application/xml
14
+ accept-encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ user-agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ x-frame-options:
24
+ - SAMEORIGIN
25
+ content-type:
26
+ - application/xml; charset=utf-8
27
+ x-meta-request-version:
28
+ - 0.3.3
29
+ x-ratelimit-limit:
30
+ - '1000000'
31
+ x-ratelimit-remaining:
32
+ - '999994'
33
+ x-ratelimit-reset:
34
+ - '1408579200'
35
+ x-ua-compatible:
36
+ - IE=Edge
37
+ etag:
38
+ - '"e9a95198b59ed267ae98469ca5407530"'
39
+ cache-control:
40
+ - max-age=0, private, must-revalidate
41
+ p3p:
42
+ - CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
43
+ set-cookie:
44
+ - _chargify_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiJWU2MzQ0OGNmZWU1ZmM1OTRlZDQ5NDY0ZDhjYmUzZWU0BjsAVEkiF3NlbGxlcl9jcmVkZW50aWFscwY7AEZJIgGANjAzYmM3NTMyMDIxM2RiMWJkOGMzYTZmNzRlYzVlYjJiZGQxODJlOWJmNmQzZDI4YWRlOTFmZWMyMDEwNjk3OGY2YTAyNWJjNTA0MmU5ZmUwODMzMWFmYmEwYWI0N2NmYTg1OGZiNDAwZDI1OTdlNmE2ZmVlOWQ4NzY5NjJlYTEGOwBGSSIac2VsbGVyX2NyZWRlbnRpYWxzX2lkBjsARmkH--d6aac1c42f2faaa0a3709c739f47aee6e208c29d;
45
+ domain=.chargify.dev; path=/; HttpOnly
46
+ x-request-id:
47
+ - 34e2641ab3ce62cd1194b9ee01544d5b
48
+ x-runtime:
49
+ - '0.128866'
50
+ connection:
51
+ - close
52
+ server:
53
+ - thin 1.6.2 codename Doc Brown
54
+ date:
55
+ - Wed, 20 Aug 2014 03:21:35 GMT
56
+ transfer-encoding:
57
+ - chunked
58
+ body:
59
+ encoding: UTF-8
60
+ string: |
61
+ <?xml version="1.0" encoding="UTF-8"?>
62
+ <results>
63
+ <total-count type="integer">0</total-count>
64
+ <current-page type="integer">1</current-page>
65
+ <total-pages type="integer">1</total-pages>
66
+ <per-page type="integer">20</per-page>
67
+ <metadata type="array"/>
68
+ </results>
69
+ http_version: '1.1'
70
+ recorded_at: Wed, 20 Aug 2014 03:21:35 GMT
71
+ recorded_with: VCR 2.9.2
data/spec/factories.rb CHANGED
@@ -46,6 +46,7 @@ FactoryGirl.define do
46
46
  f.customer Chargify::Customer.new
47
47
  f.product Chargify::Product.new
48
48
  f.credit_card "CREDIT CARD"
49
+ f.bank_account "BANK ACCOUNT"
49
50
  end
50
51
 
51
52
  factory :component, :class => Chargify::Component do |f|
@@ -0,0 +1,64 @@
1
+ require 'spec_helper'
2
+
3
+ describe Chargify::CustomerMetafield do
4
+
5
+ describe '.inspect' do
6
+ specify { expect(described_class.inspect).to eql('Chargify::CustomerMetafield(current_name: string, name: string, scope: { hosted: [], csv: boolean })') }
7
+ end
8
+
9
+ describe '#inspect' do
10
+ its(:inspect) { should eql('#<Chargify::CustomerMetafield current_name: nil, name: nil>') }
11
+ end
12
+
13
+ describe '#on_csv_export?' do
14
+ it 'returns true when the scope.csv is "1" or true' do
15
+ expect(Chargify::CustomerMetafield.new({:scope => {:csv => '1'}}).on_csv_export?).to eql(true)
16
+ expect(Chargify::CustomerMetafield.new({:scope => {:csv => true}}).on_csv_export?).to eql(true)
17
+ end
18
+
19
+ it 'returns false when the scope.csv is "0" or false' do
20
+ expect(Chargify::CustomerMetafield.new({:scope => {:csv => '0'}}).on_csv_export?).to eql(false)
21
+ expect(Chargify::CustomerMetafield.new({:scope => {:csv => false}}).on_csv_export?).to eql(false)
22
+ end
23
+ end
24
+
25
+ describe '#on_csv_export=' do
26
+ it 'converts the value to a string representation of a boolean' do
27
+ metafield = Chargify::CustomerMetafield.new({:scope => {}})
28
+
29
+ metafield.on_csv_export = true
30
+ expect(metafield.scope.csv).to eql('1')
31
+
32
+ metafield.on_csv_export = '1'
33
+ expect(metafield.scope.csv).to eql('1')
34
+
35
+ metafield.on_csv_export = false
36
+ expect(metafield.scope.csv).to eql('0')
37
+
38
+ metafield.on_csv_export = '0'
39
+ expect(metafield.scope.csv).to eql('0')
40
+ end
41
+ end
42
+
43
+ describe '#on_hosted_pages?' do
44
+ it 'returns true when the scope.hosted has items' do
45
+ expect(Chargify::CustomerMetafield.new({:scope => {:hosted => ['1']}}).on_hosted_pages?).to eql(true)
46
+ end
47
+
48
+ it 'returns false when the scope.hosted has no items' do
49
+ expect(Chargify::CustomerMetafield.new({:scope => {:hosted => []}}).on_hosted_pages?).to eql(false)
50
+ end
51
+ end
52
+
53
+ describe 'on_hosted_pages=' do
54
+ it 'converts a list of product ids into a api consumable array' do
55
+ metafield = Chargify::CustomerMetafield.new({:scope => {}})
56
+
57
+ metafield.on_hosted_pages = 1, 2, 3
58
+ expect(metafield.scope.hosted).to eql(['1', '2', '3'])
59
+
60
+ metafield.on_hosted_pages = [1, 2]
61
+ expect(metafield.scope.hosted).to eql(['1', '2'])
62
+ end
63
+ end
64
+ end
@@ -5,14 +5,14 @@ describe Chargify::Customer, :fake_resource do
5
5
  let(:existing_customer) { Chargify::Customer.create(:id => 5, :reference => 'sigma') }
6
6
 
7
7
  before(:each) do
8
- FakeWeb.register_uri(:get, "#{test_domain}/customers/lookup.xml?reference=#{existing_customer.reference}", :body => existing_customer.attributes.to_xml)
8
+ FakeWeb.register_uri(:get, "#{test_domain}/customers/lookup.xml?reference=sigma", :body => existing_customer.attributes.to_xml)
9
9
  end
10
-
10
+
11
11
  it 'finds the correct customer by reference' do
12
12
  customer = Chargify::Customer.find_by_reference('sigma')
13
13
  customer.should == existing_customer
14
14
  end
15
-
15
+
16
16
  it 'is an instance of Chargify::Customer' do
17
17
  customer = Chargify::Customer.find_by_reference('sigma')
18
18
  customer.should be_instance_of(Chargify::Customer)
@@ -25,7 +25,7 @@ describe Chargify::Customer, :fake_resource do
25
25
  end
26
26
 
27
27
  context "#subscriptions" do
28
- let(:customer) { Chargify::Customer.create(:id => 5, :reference => 'sigma') }
28
+ let(:customer) { Chargify::Customer.create(:id => 5, :reference => 'sigma') }
29
29
  let(:subscription_1) { Chargify::Customer::Subscription.create(:customer_id => customer.id, :balance_in_cents => 4999) }
30
30
  let(:subscription_2) { Chargify::Customer::Subscription.create(:customer_id => customer.id, :balance_in_cents => 2499) }
31
31
 
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe Chargify::SubscriptionMetadata do
4
+
5
+ describe '.inspect' do
6
+ specify { expect(described_class.inspect).to eql("Chargify::SubscriptionMetadata(resource_id: integer, current_name: string, name: string, value: string)") }
7
+ end
8
+
9
+ describe "#inspect" do
10
+ its(:inspect) { should eql("#<Chargify::SubscriptionMetadata resource_id: nil, current_name: nil, name: nil, value: nil>") }
11
+ end
12
+
13
+ describe 'listing metadata for a subscription', :remote => true do
14
+ it 'returns a list of metadata' do
15
+ subscription, list = nil
16
+
17
+ VCR.use_cassette 'subscription/find' do
18
+ subscription = Chargify::Subscription.last
19
+ end
20
+
21
+ VCR.use_cassette 'subscription_metadata/list' do
22
+ list = subscription.metadata
23
+ end
24
+
25
+ expect(list).to eql([])
26
+ end
27
+ end
28
+
29
+ describe 'creating a piece of metadata', :remote => true do
30
+ it 'can create a new metadata' do
31
+ subscription, data, list = nil
32
+
33
+ VCR.use_cassette 'subscription/find' do
34
+ subscription = Chargify::Subscription.last
35
+ end
36
+
37
+ VCR.use_cassette 'subscription_metadata/create' do
38
+ # Shorthand for Chargify::SubscriptionMetadata.create(:resource_id => sub.id ...)
39
+ data = subscription.create_metadata(:name => 'favorite color', :value => 'red')
40
+ end
41
+
42
+ expect(data).to be_persisted
43
+ expect(data.name).to eql('favorite color')
44
+ expect(data.value).to eql('red')
45
+
46
+ VCR.use_cassette 'subscription_metadata/list-after-create' do
47
+ list = subscription.metadata
48
+ end
49
+
50
+ expect(list.size).to eql(1)
51
+ expect(list).to include(data)
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,63 @@
1
+ require 'spec_helper'
2
+
3
+ describe Chargify::SubscriptionMetafield do
4
+ describe '.inspect' do
5
+ specify { expect(described_class.inspect).to eql('Chargify::SubscriptionMetafield(current_name: string, name: string, scope: { hosted: [], csv: boolean })') }
6
+ end
7
+
8
+ describe '#inspect' do
9
+ its(:inspect) { should eql('#<Chargify::SubscriptionMetafield current_name: nil, name: nil>') }
10
+ end
11
+
12
+ describe '#on_csv_export?' do
13
+ it 'returns true when the scope.csv is "1" or true' do
14
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:csv => '1'}}).on_csv_export?).to eql(true)
15
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:csv => true}}).on_csv_export?).to eql(true)
16
+ end
17
+
18
+ it 'returns false when the scope.csv is "0" or false' do
19
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:csv => '0'}}).on_csv_export?).to eql(false)
20
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:csv => false}}).on_csv_export?).to eql(false)
21
+ end
22
+ end
23
+
24
+ describe '#on_csv_export=' do
25
+ it 'converts the value to a string representation of a boolean' do
26
+ metafield = Chargify::SubscriptionMetafield.new({:scope => {}})
27
+
28
+ metafield.on_csv_export = true
29
+ expect(metafield.scope.csv).to eql('1')
30
+
31
+ metafield.on_csv_export = '1'
32
+ expect(metafield.scope.csv).to eql('1')
33
+
34
+ metafield.on_csv_export = false
35
+ expect(metafield.scope.csv).to eql('0')
36
+
37
+ metafield.on_csv_export = '0'
38
+ expect(metafield.scope.csv).to eql('0')
39
+ end
40
+ end
41
+
42
+ describe '#on_hosted_pages?' do
43
+ it 'returns true when the scope.hosted has items' do
44
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:hosted => ['1']}}).on_hosted_pages?).to eql(true)
45
+ end
46
+
47
+ it 'returns false when the scope.hosted has no items' do
48
+ expect(Chargify::SubscriptionMetafield.new({:scope => {:hosted => []}}).on_hosted_pages?).to eql(false)
49
+ end
50
+ end
51
+
52
+ describe 'on_hosted_pages=' do
53
+ it 'converts a list of product ids into a api consumable array' do
54
+ metafield = Chargify::SubscriptionMetafield.new({:scope => {}})
55
+
56
+ metafield.on_hosted_pages = 1, 2, 3
57
+ expect(metafield.scope.hosted).to eql(['1', '2', '3'])
58
+
59
+ metafield.on_hosted_pages = [1, 2]
60
+ expect(metafield.scope.hosted).to eql(['1', '2'])
61
+ end
62
+ end
63
+ end
@@ -24,6 +24,12 @@ describe Chargify::Subscription, :fake_resource do
24
24
  @subscription.save!
25
25
  @subscription.attributes['credit_card'].should be_blank
26
26
  end
27
+
28
+ it 'strips bank account' do
29
+ @subscription.attributes['bank_account'].should_not be_blank
30
+ @subscription.save!
31
+ @subscription.attributes['bank_account'].should be_blank
32
+ end
27
33
 
28
34
  it "doesn't strip other attrs" do
29
35
  subscription = build(:subscription)
@@ -31,6 +37,27 @@ describe Chargify::Subscription, :fake_resource do
31
37
  lambda { subscription.save! }.should_not change(subscription, :attributes)
32
38
  end
33
39
  end
40
+
41
+ describe "points to the correct payment profile" do
42
+ before do
43
+ @subscription = build(:subscription)
44
+ end
45
+
46
+ it 'does not have a payment profile' do
47
+ @subscription.payment_profile.should be_nil
48
+ end
49
+
50
+ it 'returns credit_card details' do
51
+ @subscription.credit_card = "CREDIT CARD"
52
+ @subscription.payment_profile.should == "CREDIT CARD"
53
+ end
54
+
55
+ it 'returns bank_account details' do
56
+ @subscription.bank_account = "BANK ACCOUNT"
57
+ @subscription.payment_profile.should == "BANK ACCOUNT"
58
+ end
59
+
60
+ end
34
61
 
35
62
  it 'creates a one-time charge' do
36
63
  id = generate(:subscription_id)
data/spec/spec_helper.rb CHANGED
@@ -5,14 +5,25 @@ Bundler.require(:default, :development)
5
5
 
6
6
  require 'support/fake_resource'
7
7
  require 'pry'
8
+ require 'dotenv'
9
+
10
+ Dotenv.load
8
11
 
9
12
  FactoryGirl.find_definitions
10
13
  ActiveResource::Base.send :include, ActiveResource::FakeResource
11
14
  FakeWeb.allow_net_connect = false
12
15
 
13
16
  Chargify.configure do |c|
14
- c.subdomain = 'test'
15
- c.api_key = 'test'
17
+ c.subdomain = ENV['SUBDOMAIN'] || 'acme'
18
+ c.api_key = ENV['API_KEY'] || 'acme_test_key'
19
+ c.domain = ENV['DOMAIN'] || 'chargify.dev'
20
+ c.protocol = ENV['protocol'] || 'https'
21
+ end
22
+
23
+ VCR.configure do |c|
24
+ c.allow_http_connections_when_no_cassette = true
25
+ c.cassette_library_dir = 'spec/cassettes'
26
+ c.hook_into :fakeweb
16
27
  end
17
28
 
18
29
  RSpec.configure do |config|
@@ -21,6 +32,7 @@ RSpec.configure do |config|
21
32
  config.treat_symbols_as_metadata_keys_with_true_values = true
22
33
  config.alias_example_to :fit, :focused => true
23
34
  config.color_enabled = true
35
+ config.filter_run_excluding :remote => true
24
36
 
25
37
  config.include FactoryGirl::Syntax::Methods
26
38
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chargify_api_ares
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klett
@@ -11,146 +11,174 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-08-08 00:00:00.000000000 Z
14
+ date: 2014-08-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activeresource
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - "~>"
20
+ - - ~>
21
21
  - !ruby/object:Gem::Version
22
22
  version: 3.2.16
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.16
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - "~>"
34
+ - - ~>
35
35
  - !ruby/object:Gem::Version
36
36
  version: 10.0.3
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "~>"
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
43
  version: 10.0.3
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: rspec
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - "~>"
48
+ - - ~>
49
49
  - !ruby/object:Gem::Version
50
50
  version: 2.12.0
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - "~>"
55
+ - - ~>
56
56
  - !ruby/object:Gem::Version
57
57
  version: 2.12.0
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: factory_girl
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
62
+ - - ~>
63
63
  - !ruby/object:Gem::Version
64
64
  version: '2.6'
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ~>
70
70
  - !ruby/object:Gem::Version
71
71
  version: '2.6'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: fakeweb
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - "~>"
76
+ - - ~>
77
77
  - !ruby/object:Gem::Version
78
78
  version: 1.3.0
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - "~>"
83
+ - - ~>
84
84
  - !ruby/object:Gem::Version
85
85
  version: 1.3.0
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: faker
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - "~>"
90
+ - - ~>
91
91
  - !ruby/object:Gem::Version
92
92
  version: 1.1.2
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
99
  version: 1.1.2
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: guard-rspec
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - "~>"
104
+ - - ~>
105
105
  - !ruby/object:Gem::Version
106
106
  version: 2.4.0
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - "~>"
111
+ - - ~>
112
112
  - !ruby/object:Gem::Version
113
113
  version: 2.4.0
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: growl
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - "~>"
118
+ - - ~>
119
119
  - !ruby/object:Gem::Version
120
120
  version: 1.0.3
121
121
  type: :development
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - "~>"
125
+ - - ~>
126
126
  - !ruby/object:Gem::Version
127
127
  version: 1.0.3
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: rb-fsevent
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - "~>"
132
+ - - ~>
133
133
  - !ruby/object:Gem::Version
134
134
  version: 0.9.2
135
135
  type: :development
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - "~>"
139
+ - - ~>
140
140
  - !ruby/object:Gem::Version
141
141
  version: 0.9.2
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: pry
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - ">="
146
+ - - '>='
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  type: :development
150
150
  prerelease: false
151
151
  version_requirements: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - ">="
153
+ - - '>='
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ - !ruby/object:Gem::Dependency
157
+ name: vcr
158
+ requirement: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ - !ruby/object:Gem::Dependency
171
+ name: dotenv
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ type: :development
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - '>='
154
182
  - !ruby/object:Gem::Version
155
183
  version: '0'
156
184
  description: ''
@@ -159,8 +187,10 @@ executables: []
159
187
  extensions: []
160
188
  extra_rdoc_files: []
161
189
  files:
162
- - ".gitignore"
163
- - ".travis.yml"
190
+ - .env
191
+ - .gitignore
192
+ - .rspec
193
+ - .travis.yml
164
194
  - Gemfile
165
195
  - Gemfile.lock
166
196
  - Guardfile
@@ -172,6 +202,8 @@ files:
172
202
  - examples/charges.rb
173
203
  - examples/coupons.rb
174
204
  - examples/customers.rb
205
+ - examples/metadata.rb
206
+ - examples/metafields.rb
175
207
  - examples/metered_components.rb
176
208
  - examples/migrations.rb
177
209
  - examples/products.rb
@@ -179,8 +211,10 @@ files:
179
211
  - examples/subscriptions.rb
180
212
  - examples/transactions.rb
181
213
  - lib/chargify_api_ares.rb
214
+ - lib/chargify_api_ares/behaviors/inspectable.rb
215
+ - lib/chargify_api_ares/behaviors/metadata.rb
216
+ - lib/chargify_api_ares/behaviors/metafield.rb
182
217
  - lib/chargify_api_ares/config.rb
183
- - lib/chargify_api_ares/metafield_xml_formatter.rb
184
218
  - lib/chargify_api_ares/resources/base.rb
185
219
  - lib/chargify_api_ares/resources/charge.rb
186
220
  - lib/chargify_api_ares/resources/component.rb
@@ -189,7 +223,6 @@ files:
189
223
  - lib/chargify_api_ares/resources/customer_metafield.rb
190
224
  - lib/chargify_api_ares/resources/event.rb
191
225
  - lib/chargify_api_ares/resources/invoice.rb
192
- - lib/chargify_api_ares/resources/metafield.rb
193
226
  - lib/chargify_api_ares/resources/migration.rb
194
227
  - lib/chargify_api_ares/resources/payment_profile.rb
195
228
  - lib/chargify_api_ares/resources/product.rb
@@ -198,12 +231,17 @@ files:
198
231
  - lib/chargify_api_ares/resources/site.rb
199
232
  - lib/chargify_api_ares/resources/statement.rb
200
233
  - lib/chargify_api_ares/resources/subscription.rb
234
+ - lib/chargify_api_ares/resources/subscription_metadata.rb
201
235
  - lib/chargify_api_ares/resources/subscription_metafield.rb
202
236
  - lib/chargify_api_ares/resources/transaction.rb
203
237
  - lib/chargify_api_ares/resources/usage.rb
204
238
  - lib/chargify_api_ares/resources/webhook.rb
205
239
  - lib/chargify_api_ares/response_helper.rb
206
240
  - lib/patches/activemodel_3_0_patch.rb
241
+ - spec/cassettes/subscription/find.yml
242
+ - spec/cassettes/subscription_metadata/create.yml
243
+ - spec/cassettes/subscription_metadata/list-after-create.yml
244
+ - spec/cassettes/subscription_metadata/list.yml
207
245
  - spec/factories.rb
208
246
  - spec/remote/remote.example.yml
209
247
  - spec/remote/remote_helper.rb
@@ -211,6 +249,7 @@ files:
211
249
  - spec/resources/base_spec.rb
212
250
  - spec/resources/charge_spec.rb
213
251
  - spec/resources/coupon_spec.rb
252
+ - spec/resources/customer_metafield_spec.rb
214
253
  - spec/resources/customer_spec.rb
215
254
  - spec/resources/migration_preview_spec.rb
216
255
  - spec/resources/migration_spec.rb
@@ -219,9 +258,10 @@ files:
219
258
  - spec/resources/product_spec.rb
220
259
  - spec/resources/renewal_preview_spec.rb
221
260
  - spec/resources/subscription_component_spec.rb
261
+ - spec/resources/subscription_metadata_spec.rb
262
+ - spec/resources/subscription_metafield_spec.rb
222
263
  - spec/resources/subscription_spec.rb
223
264
  - spec/resources/usage_spec.rb
224
- - spec/spec.opts
225
265
  - spec/spec_helper.rb
226
266
  - spec/support/fake_resource.rb
227
267
  homepage: http://github.com/chargify/chargify_api_ares
@@ -233,14 +273,14 @@ require_paths:
233
273
  - lib
234
274
  required_ruby_version: !ruby/object:Gem::Requirement
235
275
  requirements:
236
- - - ">="
276
+ - - '>='
237
277
  - !ruby/object:Gem::Version
238
278
  version: '0'
239
279
  required_rubygems_version: !ruby/object:Gem::Requirement
240
280
  requirements:
241
- - - ">"
281
+ - - '>='
242
282
  - !ruby/object:Gem::Version
243
- version: 1.3.1
283
+ version: '0'
244
284
  requirements: []
245
285
  rubyforge_project:
246
286
  rubygems_version: 2.2.2
@@ -248,6 +288,10 @@ signing_key:
248
288
  specification_version: 3
249
289
  summary: A Chargify API wrapper for Ruby using ActiveResource
250
290
  test_files:
291
+ - spec/cassettes/subscription/find.yml
292
+ - spec/cassettes/subscription_metadata/create.yml
293
+ - spec/cassettes/subscription_metadata/list-after-create.yml
294
+ - spec/cassettes/subscription_metadata/list.yml
251
295
  - spec/factories.rb
252
296
  - spec/remote/remote.example.yml
253
297
  - spec/remote/remote_helper.rb
@@ -255,6 +299,7 @@ test_files:
255
299
  - spec/resources/base_spec.rb
256
300
  - spec/resources/charge_spec.rb
257
301
  - spec/resources/coupon_spec.rb
302
+ - spec/resources/customer_metafield_spec.rb
258
303
  - spec/resources/customer_spec.rb
259
304
  - spec/resources/migration_preview_spec.rb
260
305
  - spec/resources/migration_spec.rb
@@ -263,8 +308,10 @@ test_files:
263
308
  - spec/resources/product_spec.rb
264
309
  - spec/resources/renewal_preview_spec.rb
265
310
  - spec/resources/subscription_component_spec.rb
311
+ - spec/resources/subscription_metadata_spec.rb
312
+ - spec/resources/subscription_metafield_spec.rb
266
313
  - spec/resources/subscription_spec.rb
267
314
  - spec/resources/usage_spec.rb
268
- - spec/spec.opts
269
315
  - spec/spec_helper.rb
270
316
  - spec/support/fake_resource.rb
317
+ has_rdoc: