Sha256: f43facae69f03195da8754d481f06b5ba4070e98e3133e2f1fae2a5b0f513837

Contents?: true

Size: 1.95 KB

Versions: 14

Compression:

Stored size: 1.95 KB

Contents

module GoTransverseTractApi

  module BillingAccount

    class ScheduledCharge

      class << self

        def find_all
          GoTransverseTractApi.get_response_for(self)
        end

        #
        # @param {Long} eid
        # @param {String} query_scope (default: 'SHALLOW')
        #
        def find_by_eid eid, query_scope=nil 
          GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
        end

        #
        # @param {Long} service_price_eid
        # @param {String} query_scope (default: 'SHALLOW')
        #
        def find_by_service_price_eid service_price_eid, query_scope=nil 
          GoTransverseTractApi.get_response_for(self, {service_price_eid: service_price_eid, queryScope: query_scope})
        end

        #
        # @param {Boolean} invoiced
        # @param {String} query_scope (default: 'SHALLOW')
        #
        def find_by_invoiced invoiced, query_scope=nil 
          GoTransverseTractApi.get_response_for(self, {invoiced: invoiced, queryScope: query_scope})
        end

        #
        # @param {Long} order_item_eid
        # @param {String} query_scope (default: 'SHALLOW')
        #
        def find_by_order_item_eid order_item_eid, query_scope=nil 
          GoTransverseTractApi.get_response_for(self, {order_item_eid: order_item_eid, queryScope: query_scope})
        end

        #
        # @param {Hash} scheduled_charges
        #
        def self.get_scheduled_charges scheduled_charges
          sch_charges = {
            attributes: api_data.get_page_info(scheduled_charges),
            scheduleCharge: {
              eid: scheduled_charges[:eid],
              description: scheduled_charges[:description],
              amount: scheduled_charges[:amount],
              invoiced: scheduled_charges[:invoiced],
              chargeDate: scheduled_charges[:charge_date]
            }
          }

          sch_charges.delete_if{|k,v| v.nil?}
        end
      end

    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
gotransverse-tract-api-0.7.4 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.7.3 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.7.2 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.7.1 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.7.0 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.7 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.6 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.5 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.4 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.3 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.2 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.1 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.6.0 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
gotransverse-tract-api-0.5.3 lib/gotransverse-tract-api/billing_account/scheduled_charge.rb