Skip to content

Commit

Permalink
Remove payment method when a subscription is canceled without looking…
Browse files Browse the repository at this point in the history
… up the subscription. Fixes #893
  • Loading branch information
excid3 committed Nov 3, 2023
1 parent da21242 commit cc6ceb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pay/paddle_billing/subscription.rb
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ def self.sync(subscription_id, object: nil, name: Pay.default_product_name)
case attributes[:status]
when "canceled"
# Remove payment methods since customer cannot be reused after cancelling
Pay::PaymentMethod.where(customer_id: pay_subscription.customer_id).destroy_all
Pay::PaymentMethod.where(customer_id: object.customer_id).destroy_all
when "trialing"
attributes[:trial_ends_at] = Time.parse(object.next_billed_at)
when "paused"

0 comments on commit cc6ceb9

Please sign in to comment.