summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions
diff options
context:
space:
mode:
authorBrendan Deere <brendan.g.deere@gmail.com>2016-12-20 11:37:17 -0800
committerBrendan Deere <brendan@stembolt.com>2017-01-06 14:07:21 -0800
commitbad2e1220d22fad84aec50d040829781c8b3ae71 (patch)
tree0a882a9b7d3df8b32cd465a923b415a5b17f3ec5 /lib/solidus_subscriptions
parent76888eaa7622f32ba656bd1ccf6a46d1fd97d6fb (diff)
Spec against Solidus 2.0
Diffstat (limited to 'lib/solidus_subscriptions')
-rw-r--r--lib/solidus_subscriptions/config.rb94
1 files changed, 47 insertions, 47 deletions
diff --git a/lib/solidus_subscriptions/config.rb b/lib/solidus_subscriptions/config.rb
index 18ba9ec..3b6f714 100644
--- a/lib/solidus_subscriptions/config.rb
+++ b/lib/solidus_subscriptions/config.rb
@@ -32,62 +32,62 @@ module SolidusSubscriptions
@out_of_stock_dispatcher_class ||= ::SolidusSubscriptions::OutOfStockDispatcher
end
- # Maximum number of times a user can skip their subscription before it
- # must be processed
- mattr_accessor(:maximum_successive_skips) { 1 }
+ def default_gateway(&block)
+ return @gateway.call unless block_given?
+ @gateway = block
+ end
+ end
- # Limit on the number of times a user can skip thier subscription. Once
- # this limit is reached, no skips are permitted
- mattr_accessor(:maximum_total_skips) { nil }
+ # Maximum number of times a user can skip their subscription before it
+ # must be processed
+ mattr_accessor(:maximum_successive_skips) { 1 }
- # Time between an installment failing to be processed and the system
- # retrying to fulfil it
- mattr_accessor(:reprocessing_interval) { 1.day }
+ # Limit on the number of times a user can skip thier subscription. Once
+ # this limit is reached, no skips are permitted
+ mattr_accessor(:maximum_total_skips) { nil }
- mattr_accessor(:minimum_cancellation_notice) { 1.day }
+ # Time between an installment failing to be processed and the system
+ # retrying to fulfil it
+ mattr_accessor(:reprocessing_interval) { 1.day }
- # Which queue is responsible for processing subscriptions
- mattr_accessor(:processing_queue) { :default }
+ mattr_accessor(:minimum_cancellation_notice) { 1.day }
- # SolidusSubscriptions::LineItem attributes which are allowed to
- # be updated from user data
- #
- # This is useful in the case where certain fields should not be allowed to
- # be modified by the user. This locks these attributes from being passed
- # in to the orders controller (or the api controller).
+ # Which queue is responsible for processing subscriptions
+ mattr_accessor(:processing_queue) { :default }
- # Ie. if a store does not want to allow users to configure the number of
- # installments they will receive. Add this to an initializer:
+ # SolidusSubscriptions::LineItem attributes which are allowed to
+ # be updated from user data
+ #
+ # This is useful in the case where certain fields should not be allowed to
+ # be modified by the user. This locks these attributes from being passed
+ # in to the orders controller (or the api controller).
- # ```
- # SolidusSubscriptions::Config.subscription_line_item_attributes = [
- # :quantity,
- # :interval_length,
- # :interval_units,
- # :subscribable_id
- # ]
- # ```
+ # Ie. if a store does not want to allow users to configure the number of
+ # installments they will receive. Add this to an initializer:
- # This configuration also easily allows the gem to be customized to track
- # more information on the subcriptions line items.
- mattr_accessor(:subscription_line_item_attributes) do
- [
- :quantity,
- :subscribable_id,
- :interval_length,
- :interval_units,
- :max_installments
- ]
- end
+ # ```
+ # SolidusSubscriptions::Config.subscription_line_item_attributes = [
+ # :quantity,
+ # :interval_length,
+ # :interval_units,
+ # :subscribable_id
+ # ]
+ # ```
- # SolidusSubscriptions::Subscription attributes which are allowed to
- # be updated from user data
- mattr_accessor(:subscription_attributes) { [:actionable_date] }
-
- def default_gateway(&block)
- return @gateway.call unless block_given?
- @gateway = block
- end
+ # This configuration also easily allows the gem to be customized to track
+ # more information on the subcriptions line items.
+ mattr_accessor(:subscription_line_item_attributes) do
+ [
+ :quantity,
+ :subscribable_id,
+ :interval_length,
+ :interval_units,
+ :max_installments
+ ]
end
+
+ # SolidusSubscriptions::Subscription attributes which are allowed to
+ # be updated from user data
+ mattr_accessor(:subscription_attributes) { [:actionable_date] }
end
end