public static Purchase dropOrder(Long idOrder, boolean sendSMS) {
        Connection conn = null;
        Purchase purch = new Purchase(0d, "", "", idOrder);
        purch.setResult(Purchase.PAYMENT_FAILED);
        try {
            conn = getConnection();
            Map<String, String> orderParams = new HashMap<String, String>();
            orderParams.put(KinomirManager.IDORDER, idOrder.toString());
            OrderStatusDTO orderDTO = KinomirManager.getOrderStatus(conn, orderParams);
            if (orderDTO.getOrderState() <= 1) {
                if (sendSMS) {
                    sendCancelSms(idOrder);
                }
                logger.info(String.format("Order %1$d in processing, drop it", new Object[]{idOrder}));
                try {
                    OrderToNullDTO orderNullDTO = KinomirManager.setOrderToNull(conn, orderParams);
                    if ("0".equals(orderNullDTO.getError())) {
                        logger.info(String.format("Order %1$d is set to null", new Object[]{idOrder}));
                        purch.setResult(Purchase.REGISTERED);
                    } else {
                        logger.error("Error while drop order " + idOrder.toString() + ": " + orderNullDTO.getErrorDescription());
                    }
                } catch (Exception ex) {
                    logger.error("Error while drop order id = " + idOrder.toString(), ex);
                }
            } else {
                logger.error("Order " + idOrder.toString() + " state is " + orderDTO.getOrderState().toString() + ", can't drop it");
                purch.setResult(Purchase.CPA_REJECTED);
            }
        } catch (SQLException ex) {
            logger.error("Error while drop order " + idOrder.toString() + ". " + ex.getMessage());
            logger.debug("Error while drop order" + idOrder.toString() + ". ", ex);
        } catch (NamingException ex) {
            logger.error("Error while drop order" + idOrder.toString() + ". " + ex.getMessage());
            logger.debug("Error while drop order" + idOrder.toString() + ". ", ex);
        } finally {
            try {
                if (conn != null) {
                    conn.close();
                }
            } catch (SQLException ex) {
                logger.error("Error while drop order", ex);
            }
        }
        return purch;
    }