Class: DpdApi::Order

Inherits:
Base
  • Object
show all
Defined in:
lib/dpd_api/order.rb

Class Method Summary collapse

Methods inherited from Base

operations

Class Method Details

.add_parcels(params = {}) ⇒ Object



41
42
43
44
# File 'lib/dpd_api/order.rb', line 41

def add_parcels(params = {})
  method = :add_parcels
  response(method, params)
end

.cancel_order(params = {}) ⇒ Object



11
12
13
14
# File 'lib/dpd_api/order.rb', line 11

def cancel_order(params = {})
  method = :cancel_order
  response(method, params)
end

.create_address(params = {}) ⇒ Object



21
22
23
24
# File 'lib/dpd_api/order.rb', line 21

def create_address(params = {})
  method = :create_address
  response(method, params)
end

.create_order(params = {}) ⇒ Object



6
7
8
9
# File 'lib/dpd_api/order.rb', line 6

def create_order(params = {})
  method = :create_order
  response(method, params, namespace: 'orders')
end

.invoice_file(params = {}) ⇒ Object

TODO: add :save for file

f = File.new(“/tmp/file.pdf”, “w”) f.write(Base64.decode64(invoice).force_encoding(‘UTF-8’)) f.close



36
37
38
39
# File 'lib/dpd_api/order.rb', line 36

def invoice_file(params = {})
  method = :get_invoice_file
  response(method, params)
end

.order_status(params = {}) ⇒ Object



16
17
18
19
# File 'lib/dpd_api/order.rb', line 16

def order_status(params = {})
  method = :get_order_status
  response(method, params)
end

.remove_parcels(params = {}) ⇒ Object



46
47
48
49
# File 'lib/dpd_api/order.rb', line 46

def remove_parcels(params = {})
  method = :remove_parcels
  response(method, params)
end

.update_address(params = {}) ⇒ Object



26
27
28
29
# File 'lib/dpd_api/order.rb', line 26

def update_address(params = {})
  method = :update_address
  response(method, params)
end