def checkout
      response = gateway.purchase(payment.price,
                                  currency: payment.currency.to_s,
                                  client_ip_addr: request.remote_ip,
                                  description: payment.description,
                                  language: payment.first_data_language)
      if response[:transaction_id]
        trx = LolitaFirstData::Transaction.add(payment, request, response)
        redirect_to gateway.redirect_url(trx.transaction_id)
      else
        if request.xhr? || !request.referer
          render text: I18n.t('fd.purchase_failed'), status: 400
        else
          flash[:error] = I18n.t('fd.purchase_failed')
          redirect_to :back
        end
      end
    ensure
      LolitaFirstData.logger.info("[#{session_id}][#{payment.id}][checkout] #{response}")
    end
def checkout
      response = gateway.purchase(payment.price,
                                  currency: payment.currency.to_s,
                                  client_ip_addr: request.remote_ip,
                                  description: payment.description,
                                  language: payment.first_data_language)
      if response[:transaction_id]
        trx = LolitaFirstData::Transaction.add(payment, request, response)
        redirect_to gateway.redirect_url(trx.transaction_id)
      else
        if request.xhr? || !request.referer
          render text: I18n.t('fd.purchase_failed'), status: 400
        else
          flash[:error] = I18n.t('fd.purchase_failed')
          redirect_to :back
        end
      end
    ensure
      LolitaFirstData.logger.info("[#{session_id}][#{payment.id}][checkout] #{response}")
    end
We get transaction_id from FirstData and if ok, then we redirect to web interface