Class: SpreeStripe::UpdateCustomer

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_stripe/update_customer.rb

Instance Method Summary collapse

Instance Method Details

#call(user:) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/services/spree_stripe/update_customer.rb', line 3

def call(user:)
  gateway_customers = user.gateway_customers.stripe
  return if gateway_customers.empty?

  gateway_customers.each do |gateway_customer|
    stripe_gateway = gateway_customer.payment_method
    stripe_gateway.update_customer(user: user)
  end
end