     .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)
+    $(button).on 'click.xsolla', ->
+      Promise.all([init, trap]).then (values) ->
         XPayStationWidget.open()
 
   @loadXsollaScript: ->

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

    return unless document.querySelector('#js-xsolla-pay')
    button = document.querySelector('#js-xsolla-pay')

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

    # load scripts
    init = Promise.all([@loadXsollaToken(), @loadXsollaScript()])
    .then (values) =>
      token = values[0]
      options = @optionsWithToken(token)
      XPayStationWidget.init(options)
