lib/active_shipping/carrier.rb in active_shipping-1.7.1 vs lib/active_shipping/carrier.rb in active_shipping-1.7.2

- old
+ new

@@ -5,10 +5,11 @@ # To implement support for a carrier, you should subclass this class and # implement all the methods the carrier supports. # # @see #find_rates # @see #create_shipment + # @see #cancel_shipment # @see #find_tracking_info # # @!attribute test_mode # Whether to interact with the carrier's sandbox environment. # @return [Boolean] @@ -63,9 +64,23 @@ # @return [ActiveShipping::ShipmentResponse] The response from the carrier. This # response should include a shipment identifier or tracking_number if successful, # and potentially shipping labels. def create_shipment(origin, destination, packages, options = {}) raise NotImplementedError, "#create_shipment is not supported by #{self.class.name}." + end + + # Cancels a shipment with a carrier. + # + # @note Override with whatever you need to cancel a shipping label + # + # @param shipment_id [String] The unique identifier of the shipment to cancel. + # This can be shipment_id or tracking number depending on carrier. Up to you and + # the carrier + # @param options [Hash] Carrier-specific parameters. + # @return [ActiveShipping::ShipmentResponse] The response from the carrier. This + # response in most cases has a cancellation id. + def cancel_shipment(shipment_id, options = {}) + raise NotImplementedError, "#cancel_shipment is not supported by #{self.class.name}." end # Retrieves tracking information for a previous shipment # # @note Override with whatever you need to get a shipping label