Class: Spree::Payments::Create

Inherits:
Object
  • Object
show all
Includes:
ServiceModule::Base
Defined in:
app/services/spree/payments/create.rb

Instance Method Summary collapse

Methods included from ServiceModule::Base

prepended

Instance Method Details

#call(order:, params: {}) ⇒ Object



6
7
8
9
10
11
12
# File 'app/services/spree/payments/create.rb', line 6

def call(order:, params: {})
  ApplicationRecord.transaction do
    run :prepare_payment_attributes
    run :find_or_create_payment_source
    run :save_payment
  end
end