chargify_api_ares 0.4.1 → 0.4.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.
- data/chargify_api_ares.gemspec +2 -2
- data/lib/chargify_api_ares.rb +4 -0
- data/spec/factories.rb +10 -0
- metadata +2 -2
data/chargify_api_ares.gemspec
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = %q{chargify_api_ares}
|
|
3
|
-
s.version = "0.4.
|
|
3
|
+
s.version = "0.4.2"
|
|
4
4
|
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
6
6
|
s.authors = ["Michael Klett", "Nathan Verni", "Rodrigo Franco", "Shay Frendt"]
|
|
7
|
-
s.date = %q{2011-10-
|
|
7
|
+
s.date = %q{2011-10-20}
|
|
8
8
|
s.description = %q{}
|
|
9
9
|
s.email = %q{support@chargify.com}
|
|
10
10
|
s.extra_rdoc_files = [
|
data/lib/chargify_api_ares.rb
CHANGED
|
@@ -298,6 +298,10 @@ module Chargify
|
|
|
298
298
|
end
|
|
299
299
|
|
|
300
300
|
class Coupon < Base
|
|
301
|
+
def self.find_all_by_product_family_id(product_family_id)
|
|
302
|
+
Coupon.find(:all, :params => { :product_family_id => product_family_id })
|
|
303
|
+
end
|
|
304
|
+
|
|
301
305
|
def self.find_by_product_family_id_and_code(product_family_id, code)
|
|
302
306
|
Coupon.new get(:lookup, :product_family_id => product_family_id, :code => code)
|
|
303
307
|
end
|
data/spec/factories.rb
CHANGED
|
@@ -61,4 +61,14 @@ FactoryGirl.define do
|
|
|
61
61
|
f.unit_name 'unit'
|
|
62
62
|
f.component_type 'quantity_based_component'
|
|
63
63
|
end
|
|
64
|
+
|
|
65
|
+
factory :coupon, :class => Chargify::Coupon do |f|
|
|
66
|
+
f.name { '15% off' }
|
|
67
|
+
f.code { '15OFF' }
|
|
68
|
+
f.description { '15% off for life' }
|
|
69
|
+
f.percentage { '14' }
|
|
70
|
+
f.allow_negative_balance { false }
|
|
71
|
+
f.recurring { false }
|
|
72
|
+
f.end_date { 1.month.from_now }
|
|
73
|
+
end
|
|
64
74
|
end
|
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: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date: 2011-10-
|
|
15
|
+
date: 2011-10-20 00:00:00.000000000 -04:00
|
|
16
16
|
default_executable:
|
|
17
17
|
dependencies: []
|
|
18
18
|
description: ''
|