Module: SolidusSubscriptions

Defined in:
app/models/solidus_subscriptions/interval.rb,
lib/solidus_subscriptions.rb,
lib/solidus_subscriptions/engine.rb,
lib/solidus_subscriptions/version.rb,
lib/solidus_subscriptions/checkout.rb,
lib/solidus_subscriptions/processor.rb,
lib/solidus_subscriptions/configuration.rb,
lib/solidus_subscriptions/order_creator.rb,
lib/solidus_subscriptions/dispatcher/base.rb,
app/models/solidus_subscriptions/line_item.rb,
app/models/solidus_subscriptions/installment.rb,
app/models/solidus_subscriptions/subscription.rb,
lib/solidus_subscriptions/churn_buster/client.rb,
lib/solidus_subscriptions/permitted_attributes.rb,
lib/solidus_subscriptions/subscription_generator.rb,
lib/solidus_subscriptions/churn_buster/serializer.rb,
app/models/solidus_subscriptions/installment_detail.rb,
app/models/solidus_subscriptions/subscription_event.rb,
app/jobs/solidus_subscriptions/create_subscription_job.rb,
app/jobs/solidus_subscriptions/process_installment_job.rb,
app/subscribers/solidus_subscriptions/order_subscriber.rb,
app/jobs/solidus_subscriptions/process_subscription_job.rb,
lib/solidus_subscriptions/churn_buster/order_serializer.rb,
lib/solidus_subscriptions/dispatcher/failure_dispatcher.rb,
lib/solidus_subscriptions/dispatcher/success_dispatcher.rb,
lib/solidus_subscriptions/subscription_line_item_builder.rb,
lib/solidus_subscriptions/permission_sets/default_customer.rb,
app/controllers/solidus_subscriptions/api/v1/base_controller.rb,
lib/solidus_subscriptions/dispatcher/out_of_stock_dispatcher.rb,
app/subscribers/solidus_subscriptions/churn_buster_subscriber.rb,
app/subscribers/solidus_subscriptions/event_storage_subscriber.rb,
lib/generators/solidus_subscriptions/install/install_generator.rb,
lib/solidus_subscriptions/churn_buster/subscription_serializer.rb,
lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb,
lib/solidus_subscriptions/processing_error_handlers/rails_logger.rb,
lib/solidus_subscriptions/permission_sets/subscription_management.rb,
app/controllers/solidus_subscriptions/api/v1/line_items_controller.rb,
app/decorators/models/solidus_subscriptions/spree/order/after_create.rb,
app/controllers/solidus_subscriptions/api/v1/subscriptions_controller.rb,
lib/solidus_subscriptions/churn_buster/subscription_customer_serializer.rb,
app/models/solidus_subscriptions/promotion/rules/subscription_creation_order.rb,
app/decorators/models/solidus_subscriptions/spree/variant/variant_pretty_name.rb,
lib/solidus_subscriptions/churn_buster/subscription_payment_method_serializer.rb,
app/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions.rb,
app/decorators/models/solidus_subscriptions/spree/product/delegate_subscribable.rb,
app/models/solidus_subscriptions/promotion/rules/subscription_installment_order.rb,
app/decorators/models/solidus_subscriptions/spree/order/subscription_association.rb,
app/decorators/models/solidus_subscriptions/spree/order/installment_details_association.rb,
app/decorators/models/solidus_subscriptions/spree/variant/auto_delete_from_subscriptions.rb,
app/decorators/models/solidus_subscriptions/spree/order/subscription_line_items_association.rb,
app/decorators/models/solidus_subscriptions/spree/line_item/subscription_line_items_association.rb,
app/decorators/models/solidus_subscriptions/spree/wallet_payment_source/report_default_change_to_subscriptions.rb,
lib/decorators/frontend/controllers/solidus_subscriptions/spree/orders_controller/create_subscription_line_items.rb,
lib/decorators/api/controllers/solidus_subscriptions/spree/api/line_items_controller/create_subscription_line_items.rb

Overview

Create new subscription line items associated to the current order, when a line item is added to the cart which includes subscription_line_item params.

The Subscriptions::LineItem acts as a line item place holder for a Subscription, indicating that it has been added to the order, but not yet purchased

Defined Under Namespace

Modules: Api, ChurnBuster, Dispatcher, Generators, Interval, PermissionSets, PermittedAttributes, ProcessingErrorHandlers, Promotion, Spree, SubscriptionGenerator, SubscriptionLineItemBuilder Classes: Checkout, ChurnBusterSubscriber, Configuration, CreateSubscriptionJob, Engine, EventStorageSubscriber, Installment, InstallmentDetail, LineItem, OrderCreator, OrderSubscriber, ProcessInstallmentJob, ProcessSubscriptionJob, Processor, Subscription, SubscriptionEvent

Constant Summary collapse

VERSION =
'2.0.2'

Class Method Summary collapse

Class Method Details

.churn_busterObject



41
42
43
44
45
46
47
48
# File 'lib/solidus_subscriptions.rb', line 41

def churn_buster
  return unless configuration.churn_buster?

  @churn_buster ||= ChurnBuster::Client.new(
    account_id: SolidusSubscriptions.configuration.,
    api_key: SolidusSubscriptions.configuration.churn_buster_api_key,
  )
end

.configurationObject



37
38
39
# File 'lib/solidus_subscriptions.rb', line 37

def configuration
  @configuration ||= Configuration.new
end

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

Yields:



33
34
35
# File 'lib/solidus_subscriptions.rb', line 33

def configure
  yield configuration
end

.table_name_prefixObject



79
80
81
# File 'lib/solidus_subscriptions/engine.rb', line 79

def self.table_name_prefix
  'solidus_subscriptions_'
end