Class: RockRMS::Response::RecurringDonation

Inherits:
Base
  • Object
show all
Defined in:
lib/rock_rms/response/recurring_donation.rb

Constant Summary collapse

MAP =
{
  id: 'Id',
  active: 'IsActive',
  financial_gateway_id: 'FinancialGatewayId',
  foreign_key: 'ForeignKey',
  frequency: 'TransactionFrequencyValueId',
  end_date: 'EndDate',
  gateway_schedule_id: 'GatewayScheduleId',
  next_payment_date: 'NextPaymentDate',
  payment_details: 'FinancialPaymentDetail',
  person_id: 'AuthorizedPersonAliasId',
  start_date: 'StartDate',
  transaction_details: 'ScheduledTransactionDetails',
  transaction_code: 'TransactionCode',
  transaction_type_id: 'TransactionTypeValueId',
  summary: 'Summary'
}.freeze

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

format, #format, #initialize, #to_h

Constructor Details

This class inherits a constructor from RockRMS::Response::Base

Instance Method Details

#find_frequency_by_id(type_id) ⇒ Object



30
31
32
# File 'lib/rock_rms/response/recurring_donation.rb', line 30

def find_frequency_by_id(type_id)
  RecurringFrequencies::RECURRING_FREQUENCIES.key(type_id)
end

#format_single(data) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/rock_rms/response/recurring_donation.rb', line 22

def format_single(data)
  result = to_h(MAP, data)
  result[:frequency]           = find_frequency_by_id(result[:frequency])
  result[:transaction_details] = RecurringDonationDetails.format(result[:transaction_details])
  result[:payment_details]     = PaymentDetail.format(result[:payment_details])
  result
end