Module: RockRMS::Client::RecurringDonationDetail

Included in:
RockRMS::Client
Defined in:
lib/rock_rms/resources/recurring_donation_detail.rb

Instance Method Summary collapse

Instance Method Details

#create_recurring_donation_detail(recurring_donation_id:, fee_coverage_amount: nil, fund_id:, amount:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rock_rms/resources/recurring_donation_detail.rb', line 6

def create_recurring_donation_detail(
  recurring_donation_id:,
  fee_coverage_amount: nil,
  fund_id:,
  amount:
)
  options = {
    'AccountId' => fund_id,
    'Amount' => amount,
    'ScheduledTransactionId' => recurring_donation_id
  }

  options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

  post(recurring_donation_detail_path, options)
end

#delete_recurring_donation_detail(id) ⇒ Object



23
24
25
# File 'lib/rock_rms/resources/recurring_donation_detail.rb', line 23

def delete_recurring_donation_detail(id)
  delete(recurring_donation_detail_path(id))
end

#update_recurring_donation_detail(id, fund_id: nil, amount: nil, fee_coverage_amount: nil) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/rock_rms/resources/recurring_donation_detail.rb', line 27

def update_recurring_donation_detail(id, fund_id: nil, amount: nil, fee_coverage_amount: nil)
  options = {}
  options['AccountId'] = fund_id if fund_id
  options['Amount']    = amount  if amount
  options['FeeCoverageAmount'] = fee_coverage_amount if fee_coverage_amount

  patch(recurring_donation_detail_path(id), options)
end