Class: Chargify::Statement

Inherits:
Base
  • Object
show all
Defined in:
lib/chargify_api_ares/resources/statement.rb

Class Method Summary collapse

Methods inherited from Base

element_name, #to_xml

Class Method Details

.find_pdf(scope, options = {}) ⇒ Object

Returns raw PDF data. Usage example: File.open(file_path, ‘wb+’){ |f| f.write Chargify::Statement.find_pdf(statement.id) }



6
7
8
9
10
# File 'lib/chargify_api_ares/resources/statement.rb', line 6

def self.find_pdf(scope, options = {})
  prefix_options, query_options = split_options(options[:params])
  path = element_path(scope, prefix_options, query_options).gsub(/\.\w+$/, ".pdf")
  connection.get(path, headers).body
end