class DotpayController < PaymentsController
  def confirm
    @dotpay = DotpayPayment.new(request.raw_post)
    if @dotpay.acknowledge
      @order = Order.find_by(description: @dotpay.description)
      @order.update(status: @dotpay.status)
      @order.paid!
    else
      logger.error "Incorrect dotpay payment"
    end
    render plain: 'OK'
  end

  def dotpay_id
    '767542'
  end
end

class DotpayController < PaymentsController
  def confirm
    @dotpay = DotpayPayment.new(request.raw_post)
    if @dotpay.acknowledge
      @order = Order.find_by(payment_description: @dotpay.description)
      @order.update(status: @dotpay.status)
      @order.paid!
    else
      logger.error "Incorrect dotpay payment"
    end
    render plain: 'OK'
  end

  def dotpay_id
    '767542'
  end
end

Fix wrong search in DotpayController
Fix wrong search in DotpayController

The controller should look for orders by the column
"payment_description", not "description". The latter does not exist in
Order model.
