Module: Deliveries::Couriers::Envialia
- Extended by:
- Deliveries::Courier
- Defined in:
- lib/deliveries/couriers/envialia.rb,
lib/deliveries/couriers/envialia/pickups/trace.rb,
lib/deliveries/couriers/envialia/authentication.rb,
lib/deliveries/couriers/envialia/pickups/create.rb,
lib/deliveries/couriers/envialia/labels/generate.rb,
lib/deliveries/couriers/envialia/shipments/trace.rb,
lib/deliveries/couriers/envialia/shipments/create.rb,
lib/deliveries/couriers/envialia/pickups/trace/format_response.rb,
lib/deliveries/couriers/envialia/shipments/trace/format_response.rb
Defined Under Namespace
Modules: Authentication, Labels, Pickups, Shipments
Classes: Config
Constant Summary
collapse
- ENVIALIA_LOGIN_ENDPOINT_LIVE =
'http://ws.envialia.com/SOAP?service=LoginService'.freeze
- ENVIALIA_LOGIN_ENDPOINT_TEST =
'http://wstest.envialia.com:9085/SOAP?service=LoginService'.freeze
- ENVIALIA_ENDPOINT_LIVE =
'http://ws.envialia.com/SOAP?service=WebServService'.freeze
- ENVIALIA_ENDPOINT_TEST =
'http://wstest.envialia.com:9085/SOAP?service=WebServService'.freeze
Class Method Summary
collapse
-
.create_pickup(sender:, receiver:, parcels:, reference_code:, pickup_date: nil, remarks: nil, tracking_code: nil) ⇒ Object
-
.create_shipment(sender:, receiver:, parcels:, reference_code:, collection_point: nil, shipment_date: nil, remarks: nil) ⇒ Object
-
.get_label(tracking_code:) ⇒ Object
-
.get_labels(tracking_codes:) ⇒ Object
-
.pickup_info(tracking_code:) ⇒ Object
-
.shipment_info(tracking_code:) ⇒ Object
config, configure, configured?, get_collection_point, get_collection_points, live?, test?
Class Method Details
.create_pickup(sender:, receiver:, parcels:, reference_code:, pickup_date: nil, remarks: nil, tracking_code: nil) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/deliveries/couriers/envialia.rb', line 40
def create_pickup(sender:, receiver:, parcels:, reference_code:, pickup_date: nil, remarks: nil, tracking_code: nil, **)
Pickups::Create.new(
sender: sender,
receiver: receiver,
parcels: parcels,
reference_code: reference_code,
pickup_date: pickup_date,
remarks: ,
tracking_code: tracking_code
).execute
end
|
.create_shipment(sender:, receiver:, parcels:, reference_code:, collection_point: nil, shipment_date: nil, remarks: nil) ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/deliveries/couriers/envialia.rb', line 28
def create_shipment(sender:, receiver:, parcels:, reference_code:, collection_point: nil, shipment_date: nil, remarks: nil, **)
Shipments::Create.new(
sender: sender,
receiver: receiver,
collection_point: collection_point,
shipment_date: shipment_date,
parcels: parcels,
reference_code: reference_code,
remarks:
).execute
end
|
.get_label(tracking_code:) ⇒ Object
72
73
74
75
76
77
78
|
# File 'lib/deliveries/couriers/envialia.rb', line 72
def get_label(tracking_code:, **)
pdf = Labels::Generate.new(
tracking_codes: tracking_code
).execute.first
Deliveries::Label.new(raw: pdf)
end
|
.get_labels(tracking_codes:) ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/deliveries/couriers/envialia.rb', line 80
def get_labels(tracking_codes:, **)
labels = Deliveries::Labels.new
Labels::Generate.new(
tracking_codes: tracking_codes
).execute.each do |pdf|
labels << pdf
end
labels
end
|
.pickup_info(tracking_code:) ⇒ Object
.shipment_info(tracking_code:) ⇒ Object