     new Promise (resolve, reject) ->
       $.get laroute.route('payments.xsolla.token')
       .done (data) ->
-        console.debug('token loaded')
         resolve(data)
       .fail (xhr, error) ->
         console.error xhr

    .catch (error) ->
      console.error error

    click = DeferrablePromise()

    $(button).on 'click', ->
      button.classList.add('store-payment-button--waiting')
      click.resolve()

    $(button).on 'click', ->
      Promise.all([init, click]).then (values) ->
        console.log(values)
        XPayStationWidget.open()

  @loadXsollaScript: ->

      script.async = true
      script.src = "https://static.xsolla.com/embed/paystation/1.0.7/widget.min.js"
      script.addEventListener 'load', ->
        # TODO: remove after testing
        Timeout.set 5000, ->
          resolve()
