Module: PacklinkLite

Defined in:
lib/packlink_lite.rb,
lib/packlink_lite/label.rb,
lib/packlink_lite/order.rb,
lib/packlink_lite/client.rb,
lib/packlink_lite/errors.rb,
lib/packlink_lite/service.rb,
lib/packlink_lite/version.rb,
lib/packlink_lite/shipment.rb,
lib/packlink_lite/configuration.rb,
lib/packlink_lite/tracking_history.rb

Defined Under Namespace

Classes: Client, Configuration, Error, Label, Order, ResponseError, Service, Shipment, TrackingHistory

Constant Summary collapse

PRODUCTION_URL =
'https://api.packlink.com/v1/'
SANDBOX_URL =
'https://apisandbox.packlink.com/v1/'
VERSION =
'0.5.2'

Class Method Summary collapse

Class Method Details

.change_shipment_callback_url(url, options = {}) ⇒ Object



33
34
35
# File 'lib/packlink_lite.rb', line 33

def change_shipment_callback_url(url, options = {})
  client.post('shipments/callback', { url: url }, options.merge(parse_response: false))
end

.change_tracking_callback_url(url, options = {}) ⇒ Object



37
38
39
# File 'lib/packlink_lite.rb', line 37

def change_tracking_callback_url(url, options = {})
  client.post('shipments/tracking_callback', { url: url }, options.merge(parse_response: false))
end

.clientObject



25
26
27
# File 'lib/packlink_lite.rb', line 25

def client
  @client ||= Client.new
end

.configObject



21
22
23
# File 'lib/packlink_lite.rb', line 21

def config
  @configuration ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/packlink_lite.rb', line 17

def configure
  yield(config)
end

.urlObject



29
30
31
# File 'lib/packlink_lite.rb', line 29

def url
  config.testing? ? SANDBOX_URL : PRODUCTION_URL
end