Sha256: 02efdd8b0cae60b41bc44bd3500df1d340a59ed95d09de1a55cbf0944334954b

Contents?: true

Size: 382 Bytes

Versions: 4

Compression:

Stored size: 382 Bytes

Contents

module Pay
  module Stripe
    module Webhooks
      class CustomerUpdated
        def call(event)
          object = event.data.object
          user = Pay.user_model.find_by(processor: :stripe, processor_id: object.id)

          # Couldn't find user, we can skip
          return unless user.present?

          user.sync_card_from_stripe
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pay-2.0.3 lib/pay/stripe/webhooks/customer_updated.rb
pay-2.0.2 lib/pay/stripe/webhooks/customer_updated.rb
pay-2.0.1 lib/pay/stripe/webhooks/customer_updated.rb
pay-2.0.0 lib/pay/stripe/webhooks/customer_updated.rb