Method: PaymentRails::InvoicePaymentGateway#invoice_payments_list_builder

Defined in:
lib/paymentrails/gateways/InvoicePaymentGateway.rb

#invoice_payments_list_builder(response) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/paymentrails/gateways/InvoicePaymentGateway.rb', line 42

def invoice_payments_list_builder(response)
  invoice_payments = []
  data = JSON.parse(response)

  data.each do |key, value|
    next unless key === 'invoicePayments'
    value.each do |newKey, _newValue|
      invoice_payment = loosely_hydrate_model(InvoicePayment.new, newKey)
      invoice_payments.push(invoice_payment)
    end
  end
  invoice_payments
end