delete customer when subscription destroyed

This commit is contained in:
Rimian Perkins
2019-11-29 08:00:13 +11:00
parent 298e70b32a
commit 2eab43d4a0
3 changed files with 19 additions and 6 deletions
@@ -34,7 +34,6 @@ module DiscoursePatrons
return render_json_error e.message
end
end
end
end
end
@@ -45,6 +45,8 @@ module DiscoursePatrons
if customer.present?
deleted = ::Stripe::Subscription.delete(params[:id])
customer.delete
render_json_dump deleted
else
render_json_error I18n.t('discourse_patrons.customer_id_not_found')