lib/pay/stripe/webhooks/payment_method_attached.rb in pay-5.0.4 vs lib/pay/stripe/webhooks/payment_method_attached.rb in pay-6.0.0
- old
+ new
@@ -2,13 +2,10 @@
module Stripe
module Webhooks
class PaymentMethodAttached
def call(event)
object = event.data.object
- pay_customer = Pay::Customer.find_by(processor: :stripe, processor_id: object.customer)
- return unless pay_customer
-
- pay_customer.save_payment_method(object, default: false)
+ Pay::Stripe::PaymentMethod.sync(object.id, stripe_account: event.try(:account))
end
end
end
end
end