       dataType: "json"
     .done (response) =>
       token = response.token
-      @log("GESTPAY: getToken success - #{token}")
+      @log("getToken success - #{token}")
       @createPaymentPage(token)
     .fail (response) =>
       json = $.parseJSON(response.responseText)
-      @log("GESTPAY: getToken failure - #{json.error}")
+      @log("getToken failure - #{json.error}")
 
   createPaymentPage: (token) ->
     GestPay.CreatePaymentPage(@merchant, token, @paymentPageLoaded)

    # Gestpay returns error codes as strings. Convert them to integers before
    # comparing them
    if parseInt(result.ErrorCode) == GESTPAY_NO_ERROR
      @log("GESTPAY: iframe loaded!")
    else
      @log("GESTPAY: error loading iframe: '#{result.ErrorDescription}'
      (#{result.ErrorCode})")

  log: (string) ->
    console.log && console.log(string)

$ ->
  $gestpay = $(".gestpay-data")

  generate: ->
    # Probably not on the correct page
    if @browserSupported()
      @log("iframe initialized")
      @getToken()
    else
      @log("browser not supported")

  browserSupported: ->
    # This variable is set on window directly by the initialization script of
