Module: CoreMerchant

Defined in:
lib/core_merchant.rb,
lib/core_merchant/version.rb,
lib/core_merchant/subscription.rb,
lib/core_merchant/customer_behavior.rb,
lib/core_merchant/subscription_plan.rb,
lib/core_merchant/subscription_event.rb,
lib/core_merchant/subscription_manager.rb,
lib/core_merchant/subscription_listener.rb,
lib/generators/core_merchant/install_generator.rb,
lib/core_merchant/concerns/subscription_notifications.rb,
lib/core_merchant/concerns/subscription_state_machine.rb,
lib/core_merchant/concerns/subscription_event_association.rb,
lib/core_merchant/concerns/subscription_manager_notifications.rb

Overview

CoreMerchant module

Defined Under Namespace

Modules: Concerns, CustomerBehavior, Generators, SubscriptionListener Classes: Configuration, Customer, Error, Subscription, SubscriptionCancellationEvent, SubscriptionEvent, SubscriptionManager, SubscriptionPlan, SubscriptionPlanChangeEvent, SubscriptionRenewalEvent, SubscriptionStatusChangeEvent

Constant Summary collapse

VERSION =
"0.11.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



18
19
20
# File 'lib/core_merchant.rb', line 18

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



22
23
24
25
26
27
28
29
# File 'lib/core_merchant.rb', line 22

def configure
  yield(configuration)

  return unless configuration.subscription_listener_class

  listener = configuration.subscription_listener_class.constantize.new
  subscription_manager.add_listener(listener)
end

.customer_classObject



31
32
33
# File 'lib/core_merchant.rb', line 31

def customer_class
  configuration.customer_class.constantize
end

.subscription_managerObject



35
36
37
# File 'lib/core_merchant.rb', line 35

def subscription_manager
  @subscription_manager ||= CoreMerchant::SubscriptionManager.new
end