Module: RockRMS::Client::RecurringDonation
- Included in:
- RockRMS::Client
- Defined in:
- lib/rock_rms/resources/recurring_donation.rb
Instance Method Summary collapse
- #create_recurring_donation(active: true, authorized_person_id:, foreign_key: nil, frequency:, funds:, end_date: nil, gateway_id: nil, gateway_schedule_id: nil, next_payment_date:, payment_detail_id: nil, source_type_id: 10, transaction_code: nil, start_date:, summary: nil, status: nil, status_message: nil, guid: nil) ⇒ Object
- #delete_recurring_donation(id) ⇒ Object
- #find_recurring_donation(id) ⇒ Object
- #launch_scheduled_transaction_workflow(id, workflow_type_id:, workflow_name:, attributes: {}) ⇒ Object
- #list_recurring_donations(options = {}) ⇒ Object
- #update_recurring_donation(id, next_payment_date:, transaction_code: nil, payment_detail_id: nil, active: nil, frequency: nil, number_of_payments: nil, end_date: nil, summary: nil, status: nil, status_message: :default_value) ⇒ Object
Instance Method Details
#create_recurring_donation(active: true, authorized_person_id:, foreign_key: nil, frequency:, funds:, end_date: nil, gateway_id: nil, gateway_schedule_id: nil, next_payment_date:, payment_detail_id: nil, source_type_id: 10, transaction_code: nil, start_date:, summary: nil, status: nil, status_message: nil, guid: nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 14 def create_recurring_donation( active: true, authorized_person_id:, foreign_key: nil, frequency:, funds:, end_date: nil, gateway_id: nil, gateway_schedule_id: nil, next_payment_date:, payment_detail_id: nil, source_type_id: 10, transaction_code: nil, start_date:, summary: nil, status: nil, status_message: nil, guid: nil ) = { 'AuthorizedPersonAliasId' => , 'TransactionFrequencyValueId' => RecurringFrequencies::RECURRING_FREQUENCIES[frequency], 'StartDate' => start_date, 'NextPaymentDate' => next_payment_date, 'IsActive' => active, 'FinancialGatewayId' => gateway_id, 'FinancialPaymentDetailId' => payment_detail_id, 'TransactionCode' => transaction_code, 'ScheduledTransactionDetails' => translate_funds(funds), 'GatewayScheduleId' => gateway_schedule_id, 'SourceTypeValueId' => source_type_id, 'ForeignKey' => foreign_key, 'Summary' => summary, 'Status' => status, 'StatusMessage' => } ['EndDate'] = end_date if end_date ['Guid'] = guid if guid post(recurring_donation_path, ) end |
#delete_recurring_donation(id) ⇒ Object
85 86 87 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 85 def delete_recurring_donation(id) delete(recurring_donation_path(id)) end |
#find_recurring_donation(id) ⇒ Object
9 10 11 12 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 9 def find_recurring_donation(id) res = get(recurring_donation_path(id)) Response::RecurringDonation.format(res) end |
#launch_scheduled_transaction_workflow(id, workflow_type_id:, workflow_name:, attributes: {}) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 89 def launch_scheduled_transaction_workflow( id, workflow_type_id:, workflow_name:, attributes: {} ) query_string = "?workflowTypeId=#{workflow_type_id}&workflowName=#{workflow_name}" post(recurring_donation_path + "/LaunchWorkflow/#{id}#{query_string}", attributes) end |
#list_recurring_donations(options = {}) ⇒ Object
4 5 6 7 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 4 def list_recurring_donations( = {}) res = get(recurring_donation_path, ) Response::RecurringDonation.format(res) end |
#update_recurring_donation(id, next_payment_date:, transaction_code: nil, payment_detail_id: nil, active: nil, frequency: nil, number_of_payments: nil, end_date: nil, summary: nil, status: nil, status_message: :default_value) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/rock_rms/resources/recurring_donation.rb', line 58 def update_recurring_donation( id, next_payment_date:, transaction_code: nil, payment_detail_id: nil, active: nil, frequency: nil, number_of_payments: nil, end_date: nil, summary: nil, status: nil, status_message: :default_value ) = { 'NextPaymentDate' => next_payment_date } ['FinancialPaymentDetailId'] = payment_detail_id if payment_detail_id ['TransactionCode'] = transaction_code if transaction_code ['IsActive'] = active if !active.nil? ['TransactionFrequencyValueId'] = RecurringFrequencies::RECURRING_FREQUENCIES[frequency] if !frequency.nil? ['NumberOfPayments'] = number_of_payments if !number_of_payments.nil? ['EndDate'] = end_date if end_date ['Summary'] = summary if summary ['Status'] = status if status ['StatusMessage'] = unless == :default_value patch(recurring_donation_path(id), ) end |