Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure to close the Recurly account when the user close his account
- Loading branch information
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class RegistrationsController < Devise::RegistrationsController | ||
# Here is the right place to notify yourself if you'd like | ||
after_filter({:only => :create}) do | ||
end | ||
|
||
def destroy | ||
if current_user.recurly_enabled | ||
BillingService.close_account(current_user.recurly_account_code) | ||
end | ||
# Here you can send the user a specific email | ||
# You could also send you the reason entered by the user | ||
# + LTV + activity before cancellation | ||
super | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
Yes! You are in, with a paid subscription. | ||
Yes! You are in, with a paid subscription. | ||
|
||
<%= link_to "Cancel my account", user_registration_path, :confirm => "Are you sure?", :method => :delete %>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters