Class: FatZebra::PaymentPlan

Inherits:
APIResource show all
Includes:
APIOperation::Delete, APIOperation::Find, APIOperation::Save
Defined in:
lib/fat_zebra/payment_plan.rb

Overview

FatZebra Payment Plan

Manage payment plan for the API

  • save

  • find

  • delete

  • suspend!

  • active!

Instance Attribute Summary

Attributes inherited from FatZebraObject

#accepted

Attributes included from ObjectHelper

#data, #errors, #raw

Instance Method Summary collapse

Methods included from APIOperation::Delete

#destroy, included

Methods included from APIOperation::Save

included, #save

Methods included from APIOperation::Find

included

Methods inherited from APIResource

base_path, request

Methods included from APIHelper

included, #request, #resource_name, #resource_path

Methods inherited from FatZebraObject

initialize_from, #load_response_api, #update_from

Methods included from Validation

#errors, #valid!, #valid?, #validates

Methods included from ObjectHelper

#[], #[]=, #add_accessor, #add_accessors, #add_data, #initialize, #inspect, #keys, #method_missing, #remove_accessor, #to_hash, #to_json, #update_attributes

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FatZebra::ObjectHelper

Instance Method Details

#active!(params = {}, options = {}) ⇒ FatZebra::PaymentPlan

Activate a payment plan

Parameters:

  • params (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



52
53
54
55
56
57
58
# File 'lib/fat_zebra/payment_plan.rb', line 52

def active!(params = {}, options = {})
  params = {
    new_status: 'Active'
  }.merge(params)

  save(params, options)
end

#suspend!(params = {}, options = {}) ⇒ FatZebra::PaymentPlan

Suspend a payment plan

Parameters:

  • params (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



37
38
39
40
41
42
43
# File 'lib/fat_zebra/payment_plan.rb', line 37

def suspend!(params = {}, options = {})
  params = {
    new_status: 'Suspended'
  }.merge(params)

  save(params, options)
end