asm-products/pay-it-forward

View on GitHub
app/jobs/capture_pledge_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class CapturePledgeJob < ActiveJob::Base
  queue_as :capture_pledge

  def perform(pledge)
    # While this job should not be enqueued unless the pledge is capture-able, there
    # is a chance that this job will be enqueued multiple times. This catch protects
    # from that case.
    return unless pledge.authorized?

    pledge.capture!
  end
end