Sha256: 14e7d9e44005c71408c64c77c3591fdcc833e529554baeec989162722ddd8968

Contents?: true

Size: 403 Bytes

Versions: 1

Compression:

Stored size: 403 Bytes

Contents

# frozen_string_literal: true

module SolidusEasypost
  class TrackerWebhookHandler
    def self.call(payload)
      return unless payload['description'] == 'tracker.updated'

      carton = ::Spree::Carton.find_by(easy_post_tracker_id: payload['result']['id'])
      return unless carton

      ::Spree::Event.fire 'solidus_easypost.tracker.updated', carton: carton, payload: payload
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_easypost-3.0.0 lib/solidus_easypost/tracker_webhook_handler.rb