Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all code and references for ChurnBuster #234

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,6 @@ This extensions adds the following [Promotion rules](https://guides.solidus.io/d

You can find the API documentation [here](https://stoplight.io/p/docs/gh/solidusio-contrib/solidus_subscriptions?group=master).

### Churn Buster integration

This extension optionally integrates with [Churn Buster](https://churnbuster.io) for failed payment
recovery. In order to enable the integration, simply add your Churn Buster credentials to your
configuration:

```ruby
SolidusSubscriptions.configure do |config|
# ...

config.churn_buster_account_id = 'YOUR_CHURN_BUSTER_ACCOUNT_ID'
config.churn_buster_api_key = 'YOUR_CHURN_BUSTER_API_KEY'
end
```

The extension will take care of reporting successful/failed payments and payment method changes
to Churn Buster.

### Failed installments retries

The extension generates an installment for each subscription cycle, however some of them can fail
Expand Down

This file was deleted.

8 changes: 2 additions & 6 deletions app/models/solidus_subscriptions/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ class Subscription < ApplicationRecord
joins(:installments).merge(Installment.unfulfilled)
end)

scope :with_default_payment_source, (lambda do
where(payment_method: nil, payment_source: nil)
end)

def self.ransackable_scopes(_auth_object = nil)
[:in_processing_state]
end
Expand All @@ -107,7 +103,7 @@ def self.processing_states
state_machine :state, initial: :active do
event :cancel do
transition [:active, :pending_cancellation] => :canceled,
if: ->(subscription) { subscription.can_be_canceled? }
if: ->(subscription) { subscription.can_be_canceled? }

transition active: :pending_cancellation
end
Expand All @@ -122,7 +118,7 @@ def self.processing_states

event :deactivate do
transition active: :inactive,
if: ->(subscription) { subscription.can_be_deactivated? }
if: ->(subscription) { subscription.can_be_deactivated? }
end

event :activate do
Expand Down
39 changes: 0 additions & 39 deletions app/subscribers/solidus_subscriptions/churn_buster_subscriber.rb

This file was deleted.

2 changes: 0 additions & 2 deletions config/initializers/subscribers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

if Spree.solidus_gem_version < Gem::Version.new('2.11.0')
require SolidusSubscriptions::Engine.root.join('app/subscribers/solidus_subscriptions/event_storage_subscriber')
require SolidusSubscriptions::Engine.root.join('app/subscribers/solidus_subscriptions/churn_buster_subscriber')

SolidusSubscriptions::ChurnBusterSubscriber.subscribe!
SolidusSubscriptions::EventStorageSubscriber.subscribe!
end
15 changes: 0 additions & 15 deletions lib/solidus_subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
require 'solidus_subscriptions/permission_sets/subscription_management'
require 'solidus_subscriptions/version'
require 'solidus_subscriptions/engine'
require 'solidus_subscriptions/churn_buster/client'
require 'solidus_subscriptions/churn_buster/serializer'
require 'solidus_subscriptions/churn_buster/subscription_customer_serializer'
require 'solidus_subscriptions/churn_buster/subscription_payment_method_serializer'
require 'solidus_subscriptions/churn_buster/subscription_serializer'
require 'solidus_subscriptions/churn_buster/order_serializer'
require 'solidus_subscriptions/checkout'
require 'solidus_subscriptions/subscription_generator'
require 'solidus_subscriptions/subscription_line_item_builder'
Expand All @@ -37,14 +31,5 @@ def configure
def configuration
@configuration ||= Configuration.new
end

def churn_buster
return unless configuration.churn_buster?

@churn_buster ||= ChurnBuster::Client.new(
account_id: SolidusSubscriptions.configuration.churn_buster_account_id,
api_key: SolidusSubscriptions.configuration.churn_buster_api_key,
)
end
end
end
48 changes: 0 additions & 48 deletions lib/solidus_subscriptions/churn_buster/client.rb

This file was deleted.

19 changes: 0 additions & 19 deletions lib/solidus_subscriptions/churn_buster/order_serializer.rb

This file was deleted.

23 changes: 0 additions & 23 deletions lib/solidus_subscriptions/churn_buster/serializer.rb

This file was deleted.

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions lib/solidus_subscriptions/churn_buster/subscription_serializer.rb

This file was deleted.

7 changes: 1 addition & 6 deletions lib/solidus_subscriptions/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
module SolidusSubscriptions
class Configuration
attr_accessor(
:maximum_total_skips, :maximum_reprocessing_time, :churn_buster_account_id,
:churn_buster_api_key, :clear_past_installments, :processing_error_handler
:maximum_total_skips, :maximum_reprocessing_time, :clear_past_installments, :processing_error_handler
)

attr_writer(
Expand Down Expand Up @@ -78,10 +77,6 @@ def subscribable_class
@subscribable_class.constantize
end

def churn_buster?
churn_buster_account_id.present? && churn_buster_api_key.present?
end

def order_creator_class
@order_creator_class ||= 'SolidusSubscriptions::OrderCreator'
@order_creator_class.constantize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ def dispatch
order.touch(:completed_at)
order.cancel
installment.payment_failed!(order)

::Spree::Event.fire(
'solidus_subscriptions.installment_failed_payment',
installment: installment,
order: order,
)
end
end
end
Expand Down
6 changes: 0 additions & 6 deletions lib/solidus_subscriptions/dispatcher/success_dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ module Dispatcher
class SuccessDispatcher < Base
def dispatch
installment.success!(order)

::Spree::Event.fire(
'solidus_subscriptions.installment_succeeded',
installment: installment,
order: order,
)
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions solidus_subscriptions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'shoulda-matchers', '~> 4.4'
spec.add_development_dependency 'solidus_dev_support', '~> 2.0'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'vcr'
spec.add_development_dependency 'versioncake'
spec.add_development_dependency 'webmock'
spec.add_development_dependency 'yard'
end
Loading