lib/rock_rms/response/transaction.rb in rock_rms-3.1.0 vs lib/rock_rms/response/transaction.rb in rock_rms-3.2.0

- old
+ new

@@ -8,18 +8,20 @@ batch_id: 'BatchId', recurring_donation_id: 'ScheduledTransactionId', summary: 'Summary', transaction_code: 'TransactionCode', details: 'TransactionDetails', + payment_details: 'FinancialPaymentDetail', payment_detail_id: 'FinancialPaymentDetailId', transaction_type_id: 'TransactionTypeValueId' }.freeze def format_single(data) - response = to_h(MAP, data) - response[:details] = TransactionDetail.format(response[:details]) - response[:amount] = calculate_total(response[:details]) + response = to_h(MAP, data) + response[:details] = TransactionDetail.format(response[:details]) + response[:payment_details] = PaymentMethod.format(response[:payment_details]) + response[:amount] = calculate_total(response[:details]) response end def calculate_total(details) details.reduce(0) { |sum, td| sum + td[:amount] }