Class: Dune::Balanced::Bankaccount::DelayedPaymentProcessing

Inherits:
Object
  • Object
show all
Defined in:
app/models/dune/balanced/bankaccount/delayed_payment_processing.rb

Instance Method Summary collapse

Constructor Details

#initialize(contributor, resources) ⇒ DelayedPaymentProcessing

Returns a new instance of DelayedPaymentProcessing.



3
4
5
# File 'app/models/dune/balanced/bankaccount/delayed_payment_processing.rb', line 3

def initialize(contributor, resources)
  @contributor, @resources = contributor, resources
end

Instance Method Details

#completeObject



7
8
9
10
11
12
13
14
15
16
# File 'app/models/dune/balanced/bankaccount/delayed_payment_processing.rb', line 7

def complete
  @resources.each do |resource|
    Dune::Balanced::Bankaccount::Payment.new(
      'balanced-bankaccount',
      customer,
      resource,
      {}
    ).checkout!
  end
end

#customerObject



18
19
20
# File 'app/models/dune/balanced/bankaccount/delayed_payment_processing.rb', line 18

def customer
  @customer ||= ::Balanced::Customer.find(@contributor.href)
end