lib/rsr_group/order.rb in rsr_group-1.0.0 vs lib/rsr_group/order.rb in rsr_group-1.0.1

- old
+ new

@@ -38,19 +38,23 @@ # @param [Hash] ffl_options optional # @option ffl_options [String] :licence_number *required* # @option ffl_options [String] :name *required* # @option ffl_options [String] :zip *required* def add_recipient(shipping_info, ffl_options = {}) + requires!(shipping_info, :shipping_name, :address_one, :city, :state, :zip) + @recipient = OrderRecipient.new(shipping_info.merge(order_identifier: @identifier)) @ffl = OrderFFL.new(ffl_options.merge(order_identifier: @identifier)) if ffl_options.any? end # @param [Hash] item # @option item [String] :rsr_stock_number *required* # @option item [Integer] :quantity *required* # @option item [String] :shipping_carrier *required* # @option item [String] :shipping_method *required* def add_item(item) + requires!(item, :rsr_stock_number, :quantity, :shipping_carrier, :shipping_method) + @items << OrderDetail.new(item.merge(order_identifier: @identifier)) end def filename name = ["EORD", @merchant_number, @timestamp, @sequence_number].join("-")