         order:
           coupon_code: code
 
-      @put("apply_coupon_code", params)
+      service._request("/api/orders/#{Cart.current.number}/apply_coupon_code", params)
 
     update: ->
       order = Cart.current


        params.payment_source[paymentMethodId] = sourceParams

      @put("quick_update", params)
        .success (data) ->
          Cart.lastOrder = Sprangular.extend(data, Sprangular.Order)



      ga "ecommerce:send"

    put: (params) ->
      service._request("/api/checkouts/#{Cart.current.number}/quick_update", params ||= {})

    _request: (url, params) ->
      config =
        headers:
          'X-Spree-Order-Token': Cart.current.token

      Cart.current.errors = null

      $http.put(url, $.param(params), config)
        .success (response) ->
          Cart.load(response) unless response.error
        .error (response) ->
          Cart.errors(response.errors || response.exception)

    _findPaymentMethodId: ->
      paymentMethod = _.find Env.config.payment_methods, (method) -> method.name == 'Credit Card'
