Sha256: 08164cbd85e6b55721b2c5f3d611bc5fcfd8a67004386b8c14f65e66c8b6144a

Contents?: true

Size: 461 Bytes

Versions: 11

Compression:

Stored size: 461 Bytes

Contents

Spree.user_class.class_eval do
  after_create :create_mollie_customer

  def create_mollie_customer
    # Don't create Mollie customers if spree_auth_devise is not installed.
    return unless defined? Spree::User
    mollie_gateway = Spree::PaymentMethod.find_by_type 'Spree::Gateway::MollieGateway'
    return unless mollie_gateway.present?
    mollie_customer = mollie_gateway.create_customer(self)
    update mollie_customer_id: mollie_customer.id
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_mollie_gateway-2.1.5 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.4 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.4.pre.alpha app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.3 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.2 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.1 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.1.pre.beta app/models/spree/user_decorator.rb
spree_mollie_gateway-2.1.0 app/models/spree/user_decorator.rb
spree_mollie_gateway-2.0.0 app/models/spree/user_decorator.rb
spree_mollie_gateway-1.0.7 app/models/spree/user_decorator.rb
spree_mollie_gateway-1.0.6 app/models/spree/user_decorator.rb