Class: SolidusSubscriptions::ProcessInstallmentsJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/solidus_subscriptions/process_installments_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(installment_ids) ⇒ Spree::Order

Process a collection of installments

Parameters:

  • installment_ids (Array<Integer>)

    The ids of the installments to be processed together and fulfilled by the same order

Returns:

  • (Spree::Order)

    The order which fulfills the list of installments



14
15
16
17
18
19
20
# File 'app/jobs/solidus_subscriptions/process_installments_job.rb', line 14

def perform(installment_ids)
  return if installment_ids.empty?

  installments = SolidusSubscriptions::Installment.where(id: installment_ids).
    includes(subscription: [:line_items, :user])
  Checkout.new(installments).process
end