Class: Google4R::Checkout::OrderReportCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/google4r/checkout/commands.rb

Overview

The <order-list-request> command lets you to download a list of Google Checkout orders into a comma-separated file. The API will return a list of orders for a period of up to 31 days, and you can limit results to orders that have specific financial or fulfillment order states. code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Order_Report_API.html

Constant Summary

Constants inherited from Command

Command::CHECKOUT_API_URL, Command::DONATE_CHECKOUT_API_URL, Command::DONATE_ORDER_PROCESSING_API_URL, Command::DONATE_ORDER_REPORT_API_URL, Command::ORDER_PROCESSING_API_URL, Command::ORDER_REPORT_API_URL, Command::POLLING_API_URL, Command::PRODUCTION_URL_PREFIX, Command::SANDBOX_URL_PREFIX

Instance Attribute Summary collapse

Attributes inherited from Command

#command_tag_name, #frontend, #google_order_number

Instance Method Summary collapse

Methods inherited from Command

#send_to_google_checkout

Constructor Details

#initialize(frontend, start_date, end_date) ⇒ OrderReportCommand

Returns a new instance of OrderReportCommand.



709
710
711
712
713
714
715
716
717
# File 'lib/google4r/checkout/commands.rb', line 709

def initialize(frontend, start_date, end_date)
  super frontend
  raise 'start_date has to be of type Time' unless start_date.class == Time
  raise 'end_date has to be of type Time' unless start_date.class == Time
  raise 'end_date has to be before start_date' unless
      end_date >= start_date
  @start_date = start_date
  @end_date = end_date
end

Instance Attribute Details

#date_time_zoneObject

The time zone that will be associated with the start date and end date for the report



707
708
709
# File 'lib/google4r/checkout/commands.rb', line 707

def date_time_zone
  @date_time_zone
end

#end_dateObject (readonly)

The time before which an order must have been sent to be included in the API response (Time)



697
698
699
# File 'lib/google4r/checkout/commands.rb', line 697

def end_date
  @end_date
end

#financial_stateObject

The financial status of an order



700
701
702
# File 'lib/google4r/checkout/commands.rb', line 700

def financial_state
  @financial_state
end

#fulfillment_stateObject

The fulfillment status of an order



703
704
705
# File 'lib/google4r/checkout/commands.rb', line 703

def fulfillment_state
  @fulfillment_state
end

#start_dateObject (readonly)

The earliest time that an order could have been submitted to be included in the API response (Time)



693
694
695
# File 'lib/google4r/checkout/commands.rb', line 693

def start_date
  @start_date
end

Instance Method Details

#to_xmlObject



743
744
745
# File 'lib/google4r/checkout/commands.rb', line 743

def to_xml
  ReturnOrderReportCommandXmlGenerator.new(self).generate
end