Class: ActiveMerchant::Shipping::Shipment

Inherits:
Object
  • Object
show all
Includes:
ActiveMerchant::Shipping
Defined in:
lib/active_shipping/shipping/shipment.rb

Direct Known Subclasses

ReturnShipment

Constant Summary collapse

FEDEX_PAYMENT_TYPES =
[
  'COLLECT',
  'RECIPIENT',
  'SENDER',
  'THIRD_PARTY' 
]
FEDEX_DROPOFF_TYPES =
[
  "REGULAR_PICKUP",
  "REQUEST_COURIER",
  "DROP_BOX",
  "BUSINESS_SERVICE_CENTER",
  "STATION"
]
FEDEX_RATE_REQUEST_TYPES =
[
  "ACCOUNT",
  "LIST"
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActiveMerchant::Shipping

#payor_account_country=

Constructor Details

#initialize(attrs = {}) ⇒ Shipment

Returns a new instance of Shipment.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/active_shipping/shipping/shipment.rb', line 49

def initialize(attrs = {})
  attrs.each do |key, value|
    self.send("#{key}=", value) if self.respond_to?("#{key}=")
  end

  self.label ||= Label.new(:format_type => 'COMMON2D')
  self.requested_packages ||= 1
  self.dropoff_type ||= 'REGULAR_PICKUP' 
  self.service ||= 'FEDEX_GROUND'
  self.packaging_type ||= 'YOUR_PACKAGING'
  self.ship_at ||= Time.now
  self.package_count ||= 1
  self.rate_request_type ||= 'ACCOUNT'
  self.total_insured_currency ||= 'USD' if self.total_insured_amount
  self.total_weight_units ||= 'LB' if self.total_weight_value
end

Instance Attribute Details

#dropoff_typeObject

Returns the value of attribute dropoff_type.



37
38
39
# File 'lib/active_shipping/shipping/shipment.rb', line 37

def dropoff_type
  @dropoff_type
end

#labelObject

Returns the value of attribute label.



35
36
37
# File 'lib/active_shipping/shipping/shipment.rb', line 35

def label
  @label
end

#package_countObject

Returns the value of attribute package_count.



39
40
41
# File 'lib/active_shipping/shipping/shipment.rb', line 39

def package_count
  @package_count
end

#packaging_typeObject

Returns the value of attribute packaging_type.



28
29
30
# File 'lib/active_shipping/shipping/shipment.rb', line 28

def packaging_type
  @packaging_type
end

#payment_typeObject

Returns the value of attribute payment_type.



33
34
35
# File 'lib/active_shipping/shipping/shipment.rb', line 33

def payment_type
  @payment_type
end

#payor_account_countryObject (readonly)

Returns the value of attribute payor_account_country.



47
48
49
# File 'lib/active_shipping/shipping/shipment.rb', line 47

def 
  @payor_account_country
end

#payor_account_numberObject

Returns the value of attribute payor_account_number.



42
43
44
# File 'lib/active_shipping/shipping/shipment.rb', line 42

def 
  @payor_account_number
end

#rate_request_typeObject

Returns the value of attribute rate_request_type.



38
39
40
# File 'lib/active_shipping/shipping/shipment.rb', line 38

def rate_request_type
  @rate_request_type
end

#recipientObject

Returns the value of attribute recipient.



32
33
34
# File 'lib/active_shipping/shipping/shipment.rb', line 32

def recipient
  @recipient
end

#requested_packagesObject

Returns the value of attribute requested_packages.



36
37
38
# File 'lib/active_shipping/shipping/shipment.rb', line 36

def requested_packages
  @requested_packages
end

#serviceObject

Returns the value of attribute service.



27
28
29
# File 'lib/active_shipping/shipping/shipment.rb', line 27

def service
  @service
end

#ship_atObject

Returns the value of attribute ship_at.



26
27
28
# File 'lib/active_shipping/shipping/shipment.rb', line 26

def ship_at
  @ship_at
end

#shipperObject

Returns the value of attribute shipper.



29
30
31
# File 'lib/active_shipping/shipping/shipment.rb', line 29

def shipper
  @shipper
end

#special_servicesObject

Returns the value of attribute special_services.



34
35
36
# File 'lib/active_shipping/shipping/shipment.rb', line 34

def special_services
  @special_services
end

#total_insured_amountObject

Returns the value of attribute total_insured_amount.



30
31
32
# File 'lib/active_shipping/shipping/shipment.rb', line 30

def total_insured_amount
  @total_insured_amount
end

#total_insured_currencyObject

Returns the value of attribute total_insured_currency.



31
32
33
# File 'lib/active_shipping/shipping/shipment.rb', line 31

def total_insured_currency
  @total_insured_currency
end

#total_weight_unitsObject

Returns the value of attribute total_weight_units.



41
42
43
# File 'lib/active_shipping/shipping/shipment.rb', line 41

def total_weight_units
  @total_weight_units
end

#total_weight_valueObject

Returns the value of attribute total_weight_value.



40
41
42
# File 'lib/active_shipping/shipping/shipment.rb', line 40

def total_weight_value
  @total_weight_value
end

#tracking_numberObject

Returns the value of attribute tracking_number.



44
45
46
# File 'lib/active_shipping/shipping/shipment.rb', line 44

def tracking_number
  @tracking_number
end

#transit_timeObject

Returns the value of attribute transit_time.



45
46
47
# File 'lib/active_shipping/shipping/shipment.rb', line 45

def transit_time
  @transit_time
end