-angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, StatusMessage) ->
+angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, StatusMessage, $timeout) ->
   new class AdminStripeElements
 
     # These are both set from the AdminStripeElements directive


      @stripe.createToken(@card, cardData).then (response) =>
        if(response.error)
          StatusMessage.display 'error', response.error.message
          console.error(JSON.stringify(response.error))
        else
          secrets.token = response.token.id


      @stripe.createPaymentMethod({ type: 'card', card: @card }, @card, cardData).then (response) =>
        if(response.error)
          $timeout -> StatusMessage.display 'error', response.error.message
          console.error(JSON.stringify(response.error))
        else
          secrets.token = response.paymentMethod.id
