Ver Mensaje Individual
  #8 (permalink)  
Antiguo 03/01/2012, 14:16
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: DineroMail con PHP

Cita:
Iniciado por Patriarka Ver Mensaje
un ejemplo:
Código PHP:
Ver original
  1. <?php
  2. SrvLog::logRequest($_REQUEST);
  3. if(isset($_REQUEST["Notificacion"])){
  4.     /*$notificacion = "";/*"<?xml version=\'1.0\' encoding=\'ISO-8859-1\'?><notificacion><tiponotificacion>1</tiponotificacion><operaciones><operacion><tipo>1</tipo><id>00000000128875139173</id></operacion></operaciones></notificacion>";*/
  5.  
  6.     $notificacion = $_REQUEST["Notificacion"];
  7.     $notificacion = str_replace("\'",'"',$notificacion);
  8.     $Notificacion = simplexml_load_string($notificacion);
  9.     SrvLog::logNotificacion($Notificacion);
  10.     $t_ids = array();
  11.     foreach($Notificacion->operaciones as $operacion) {
  12.         $id_operacion = $operacion->operacion->id;
  13.          if(DineroMail::isOperacionAcreditada($id_operacion)){
  14.             SrvLog::logNotificacionSuccess($Notificacion);
  15.  
  16.             $sql_tid = "SELECT ID, USERID
  17.                        FROM `transaction_details`
  18.                        WHERE `TRANSACTIONID` = '$id_operacion'";
  19.             $res_tid = mysql_query($sql_tid);
  20.             if(mysql_num_rows($res_tid)>0){
  21.                 $row_tid = mysql_fetch_array($res_tid);
  22.                 $t_ids[]=$row_tid['ID']; //OBTENGO TODOS LOS ID DE TRANSACCION
  23.             }
  24.          }else{
  25.             SrvLog::logNotificacionError($Notificacion);
  26.          }
  27.     }
  28.     $deal_quantity=0;
  29.  
  30.     if(count($t_ids)>0){
  31.         foreach ($t_ids as $tid) {
  32.                 $mensaje = 'La trasaccion fue un exito!.';
  33.                 /*
  34.                  * SETEO COMO EXITO LA TRANSACCION
  35.                  */
  36.                 $sql_transation="UPDATE `user`.`transaction_details` SET `ACK` = 'confirmada',
  37.                `CAPTURED` = '1' WHERE `transaction_details`.`ID` =".$tid;
  38.                 $res=mysql_query($sql_transation);
  39.     }}
  40. ?>