 		@_getOrderFormIdFromCookie() or @_getOrderFormIdFromURL() or ''
 
 	_getOrderFormIdFromCookie: =>
-		cookie = _.readCookie(@COOKIE_NAME)
-		unless cookie is undefined or cookie is ''
-			return _.getCookieValue(cookie, @COOKIE_ORDER_FORM_ID_KEY)
-		return undefined
+		COOKIE_NAME = 'checkout.vtex.com'
+		COOKIE_ORDER_FORM_ID_KEY = '__ofid'
+		cookie = readCookie(COOKIE_NAME)
+		return undefined if cookie is undefined or cookie is ''
+		return readSubcookie(cookie, COOKIE_ORDER_FORM_ID_KEY)
 
 	_getOrderFormIdFromURL: =>
-		$.url().param('orderFormId')
+		urlParam('orderFormId')
 
 	_getOrderFormURL: =>
 		@HOST_ORDER_FORM_URL + @_getOrderFormId()

window.vtex or= {}
window.vtex.checkout or= {}

# jQuery.ajaxQueue - A queue for ajax requests - jQuery 1.5+
# (c) 2011 Corey Frang - Dual licensed under the MIT and GPL licenses.

	# @param serializedAttachment stringified serializedAttachment
	# @param expectedOrderFormSections
	sendAttachment: (attachmentId, serializedAttachment, expectedOrderFormSections = @expectedFormSections(), options = {}) =>
		if attachmentId is undefined or serializedAttachment is undefined
			d = $.Deferred()
			d.reject("Invalid arguments")
			return d.promise()

		# TODO alterar chamadas para não mandar stringified
		orderAttachmentRequest = JSON.parse(serializedAttachment)
		orderAttachmentRequest[expectedOrderFormSections] = expectedOrderFormSections

		if options.cache and options.currentStateHash
			requestHash = uniqueHashcode(attachmentId + JSON.stringify(orderAttachmentRequest))
			stateRequestHash = options.currentStateHash + ':' +  requestHash

			if @stateRequestHashToResponseMap[stateRequestHash]
				deferred = $.Deferred()
