Sha256: 5cc319e6a646e22e82bb31d26edff5fdbea44098c08cd8be466014e441900720

Contents?: true

Size: 491 Bytes

Versions: 5

Compression:

Stored size: 491 Bytes

Contents

module ShiprocketAPI
  module Shared
    module OrderHelper
      def generate_label
        return false unless attributes['shipment_id'] && shipment_id != 0

        self.label = ::ShiprocketAPI::Label.new(shipment_id: [shipment_id])
        label.save
      end

      def create_pickup
        return false unless attributes['shipment_id'] && shipment_id != 0

        self.pickup = ::ShiprocketAPI::Pickup.new(shipment_id: [shipment_id])
        pickup.save
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shiprocket_api-0.8.0 lib/shiprocket_api/shared/order_helper.rb
shiprocket_api-0.7.0 lib/shiprocket_api/shared/order_helper.rb
shiprocket_api-0.6.0 lib/shiprocket_api/shared/order_helper.rb
shiprocket_api-0.5.3 lib/shiprocket_api/shared/order_helper.rb
shiprocket_api-0.5.2 lib/shiprocket_api/shared/order_helper.rb