*** old/uc_roboxchange.module	2010-08-12 12:58:05.000000000 +0400
--- uc_roboxchange.module	2010-08-12 12:58:22.000000000 +0400
***************
*** 1,5 ****
  <?php
! // $Id: uc_roboxchange.module,v 1.3.2.1 2009/05/03 13:47:11 gor Exp $
  
  /**
   * @file
--- 1,5 ----
  <?php
! // $Id$
  
  /**
   * @file
***************
*** 69,77 ****
  
  
  function uc_roboxchange_done_payment() {
!   $order_id           = $GLOBALS['_POST']['inv_id'];
!   $amount             = $GLOBALS['_POST']['out_summ'];
!   $hash               = drupal_strtoupper($GLOBALS['_POST']['crc']);
  
    $mps2 = variable_get('uc_roboxchange_mps2', '');
    $crc=strtoupper(md5($amount .':'. $order_id .':'. $mps2));
--- 69,77 ----
  
  
  function uc_roboxchange_done_payment() {
!   $order_id           = $GLOBALS['_POST']['InvId'];
!   $amount             = $GLOBALS['_POST']['OutSum'];
!   $hash               = drupal_strtoupper($GLOBALS['_POST']['SignatureValue']);
  
    $mps2 = variable_get('uc_roboxchange_mps2', '');
    $crc=strtoupper(md5($amount .':'. $order_id .':'. $mps2));
***************
*** 101,112 ****
        uc_payment_enter($order_id, 'roboxchange', $amount, $order->uid, NULL, $description);
        uc_cart_complete_sale($order);
        uc_order_comment_save($order_id, 0, t('A payment has been accepted.'), 'admin');
!       return "OK". $order_id;
    }
    else {
        uc_order_comment_save($order_id, 0, $res, 'admin');
        uc_order_update_status($order_id, 'canceled');
!       return $res;
    }
  }
  
--- 101,112 ----
        uc_payment_enter($order_id, 'roboxchange', $amount, $order->uid, NULL, $description);
        uc_cart_complete_sale($order);
        uc_order_comment_save($order_id, 0, t('A payment has been accepted.'), 'admin');
!       print "OK". $order_id; exit;
    }
    else {
        uc_order_comment_save($order_id, 0, $res, 'admin');
        uc_order_update_status($order_id, 'canceled');
!       print $res; exit;
    }
  }
  
***************
*** 194,204 ****
      db_query("INSERT INTO {uc_roboxchange_transaction} (txnid, description) VALUES (%d, '%s')", $order->order_id, $description);
    }
    $mrh=variable_get('uc_roboxchange_mrh', '');
!   $form['mrh'] = array(
      '#type' => 'hidden',
      '#value' => $mrh,
    );
!   $form['inv_id'] = array(
      '#type' => 'hidden',
      '#value' => $order->order_id,
    );
--- 194,204 ----
      db_query("INSERT INTO {uc_roboxchange_transaction} (txnid, description) VALUES (%d, '%s')", $order->order_id, $description);
    }
    $mrh=variable_get('uc_roboxchange_mrh', '');
!   $form['MrchLogin'] = array(
      '#type' => 'hidden',
      '#value' => $mrh,
    );
!   $form['InvId'] = array(
      '#type' => 'hidden',
      '#value' => $order->order_id,
    );
***************
*** 206,222 ****
    $sitename=variable_get('site_name', 'Drupal');
    $desc = t('Purchase from site !sitename. Transaction !ID.', array('!sitename' => $sitename, '!ID' => $order->order_id));
  
!   $form['inv_desc'] = array(
      '#type' => 'hidden',
      '#default_value' => $desc,
    );
  
!   $form['out_summ'] = array(
      '#type' => 'hidden',
      '#value' => $amount,
    );
    $crc=md5($mrh .':'. $amount .':'. $order->order_id .':'. variable_get('uc_roboxchange_mps1', ''));
!   $form['crc'] = array(
      '#type' => 'hidden',
      '#value' => $crc,
    );
--- 206,222 ----
    $sitename=variable_get('site_name', 'Drupal');
    $desc = t('Purchase from site !sitename. Transaction !ID.', array('!sitename' => $sitename, '!ID' => $order->order_id));
  
!   $form['Desc'] = array(
      '#type' => 'hidden',
      '#default_value' => $desc,
    );
  
!   $form['OutSum'] = array(
      '#type' => 'hidden',
      '#value' => $amount,
    );
    $crc=md5($mrh .':'. $amount .':'. $order->order_id .':'. variable_get('uc_roboxchange_mps1', ''));
!   $form['SignatureValue'] = array(
      '#type' => 'hidden',
      '#value' => $crc,
    );
