Skip to content

Instantly share code, notes, and snippets.

@cored
Created December 24, 2017 18:44
Show Gist options
  • Save cored/834a78c2f11af8761f21118380c29dd3 to your computer and use it in GitHub Desktop.
Save cored/834a78c2f11af8761f21118380c29dd3 to your computer and use it in GitHub Desktop.
module EasyPost
module Carriers
class CancelSlot
attr_reader :ez_shipment
def self.call(courier_slot)
new.call(courier_slot)
end
def initialize(easy_post_api: EasyPost::Shipment)
@easy_post_api = easy_post_api
end
def call(external_api_identifier)
@ez_shipment = easy_post_api.retrieve(external_api_identifier)
ez_shipment.refund
self
end
private
attr_reader :easy_post_api
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment