function pushNotification()
{
    $orderId = $_POST['OperationId'];
    $requestKey = $_POST['RequestKey'];
    $eventType = $_POST['EventType'];
    $eventKey = $_POST['EventKey'];
    //Los siguientes 2 campos solo se recuperana a modo informativo.
    $eventDateTime = $_POST['EventDateTime'];
    $eventData = $_POST['EventData'];
    require 'includes/application_top.php';
    require_once dirname(__FILE__) . '/includes/modules/payment/todopagoplugin/includes/Logger/loggerFactory.php';
    //ini_set("date.timezone", "America/Buenos_Aires");
    //$logger = loggerFactory::createLogger();
    //$logger->debug("PushNotification: OperationId: $orderId, RequestKey: $requestKey, EventType: $eventType, EventKey: $eventKey, EventDateTime: $eventDateTime, EventData: $eventData");
    header("Content-Type: text/json", true);
    require_once 'includes/modules/payment/todopagoplugin/includes/TodopagoTransaccion.php';
    $transaction = new TodopagoTransaccion();
    if ($transaction->_getStep($orderId) == TodopagoTransaccion::TRANSACTION_FINISHED && $requestKey == $transaction->getRequestKey($orderId)) {
        $newOrderStatus = getNewOrderStatus($eventType);
        updateOrder($orderId, $newOrderStatus, $comment = 'Actualizado por TodoPago - PushNotificationService', true);
        $statusCode = -1;
    } else {
        $statusCode = 1;
        //$logger->info("Fallo el update de la orden por push. OperationId: $orderId, RequestKey: $requestKey, EventKey: $eventKey");
    }
    $rta = json_encode(array('StatusCode' => $statusCode, 'EventKey' => $eventKey));
    //$logger->debug("Rta PushNotification: $rta");
    echo $rta;
}
 */
require_once __DIR__ . '/../bootstrap.php';
session_start();
if (!isSignedIn()) {
    header('Location: ../user/sign_in.php');
    exit;
}
if (isset($_GET['success'])) {
    // We were redirected here from PayPal after the buyer approved/cancelled
    // the payment
    if ($_GET['success'] == 'true' && isset($_GET['PayerID']) && isset($_GET['orderId'])) {
        $orderId = $_GET['orderId'];
        try {
            $order = getOrder($orderId);
            $payment = executePayment($order['payment_id'], $_GET['PayerID']);
            updateOrder($orderId, $payment->getState());
            $messageType = "success";
            $message = "Your payment was successful. Your order id is {$orderId}.";
        } catch (\PayPal\Exception\PPConnectionException $ex) {
            $message = parseApiError($ex->getData());
            $messageType = "error";
        } catch (Exception $ex) {
            $message = $ex->getMessage();
            $messageType = "error";
        }
    } else {
        $messageType = "error";
        $message = "Your payment was cancelled.";
    }
}
require_once 'orders.php';
示例#3
0
            }
            break;
    }
} else {
    if (isset($_GET['function'])) {
        //route in case the user wants to do things via their web browser without a web front end to connect to it
        switch ($_GET['function']) {
            case 'test':
                test();
                break;
            case 'addressData':
                addressData($dbApi);
                break;
            case 'updateOrder':
                if (isset($_GET['index']) && $_GET['index'] != 'none') {
                    updateOrder($dbApi, intval($_GET['index']));
                }
                break;
        }
    }
}
// the basic test function
function test()
{
    $testArr = array('test' => 'works');
    $testVal = json_encode($testArr);
    echo $testVal;
}
function addressData($dbUse)
{
    //Gets all of the necessary data, including the user, their address and the order number that is to be updated
示例#4
0
 * @api {PUT} /channel/sorting 		Sort the Channel
 * @apiName sortChannel
 * @apiGroup Channel
 * @apiVersion 1.0.0
 * @apiDescription Sort the order of Units and Subchannels of a Channel.
 * You put in a whole channel and the Server will iterate over all Subchannels and Units and will set their view_index to the according index in the given array.
 *
 *
 * @apiPermission Author of the Channel
 * @apiUse NotPermitted
 * @apiUse MissingParameter
 *
 */
$app->put('/channel/sorting', function () use($app) {
    include_once 'libs/channel.php';
    updateOrder($app->request->getBody());
});
/**
 *
 * @api {DELETE} /channel/:channelId/unit/:unitId  		Delete a Unit from Channel
 * @apiName deleteUnitFromChannel
 * @apiGroup Channel
 * @apiVersion 1.0.0
 *
 * @apiParam {Number} id   			Id of Unit to delete
 * @apiParamExample {json} Request-Example:
 *     {
 *       "id": "42",
 *     }
 *
 * @apiPermission Author of the Parent Channel
$error = 'error';
$prefix = 'BCASH_';
$id_transacao = Tools::getValue('id_transacao');
$id_pedido = Tools::getValue('id_pedido');
if (empty($id_transacao) || empty($id_pedido)) {
    echo http_response_code(404);
    exit;
}
$email = Configuration::get($prefix . 'EMAIL');
$token = Configuration::get($prefix . 'TOKEN');
$cancellation = new Cancellation($email, $token);
$cancellation->enableSandBox(Configuration::get($prefix . 'SANDBOX'));
try {
    $response = $cancellation->execute($id_transacao);
    if ($response->transactionStatusId == 7 || $response->transactionStatusId == 6) {
        updateOrder($id_pedido, $response);
        writeHistory($id_pedido, $response);
    }
} catch (ValidationException $e) {
    die(errorResponse($e));
} catch (ConnectionException $e) {
    die(errorResponse($e));
}
echo json_encode($response);
exit;
function errorResponse($e)
{
    $erros = $e->getErrors();
    if (!empty($erros)) {
        return $e->getErrors()->list[0]->description;
    }
示例#6
0
	if($action == "addOrder"){
		if(!empty($teleNum) && (!empty($orderNum)) && (!empty($orderState))){
			$sql = "INSERT INTO telerecord
							VALUES ('{$teleNum}', '{$orderNum}', '{$orderState}')";
			addOrder($sql);		
		}
		$sql2 = "select * from telerecord where orderNum = '{$orderNum}'";
		getOrder($sql2);
	}

	if($action == "updateOrder"){
		if(!empty($teleNum) && (!empty($orderNum)) && (!empty($orderState))){
			$sql = "UPDATE telerecord SET teleNum='{$teleNum}', orderState='{$orderState}'
							WHERE orderNum='{$orderNum}'";
		}
		updateOrder($sql);
		$sql2 = "select * from telerecord where orderNum = '{$orderNum}'";
		getOrder($sql2);
	}

	$conn=null;

	function connectDb(){
		global $conn;
		$servername = "localhost";
		$username = "******";
		$password = "******";

		try {
	    $conn = new PDO("mysql:host=$servername;dbname=yjz", $username, $password);
	    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
示例#7
0
 $data["txtStartTime"] = implode(" ", array($_POST['txtStartTimeD'], $_POST['txtStartTimeT']));
 $data["txtEndTime"] = implode(" ", array($_POST['txtEndTimeD'], $_POST['txtEndTimeT']));
 $data["selRf"] = $_POST['selRf'];
 $data["selOS"] = $_POST['selOS'];
 $data["selApp"] = $_POST['selApp'];
 $data["txtLayoutPt"] = $_POST['txtLayoutPt'];
 $data["txtTextPt"] = $_POST['txtTextPt'];
 $data["txtFormat"] = $_POST['txtFormat'];
 $data["txtDiv"] = $_POST['txtDiv'];
 $data["selImg"] = $_POST['selImg'];
 $data["txtImgPt"] = $_POST['txtImgPt'];
 $data["txtAdPt"] = $_POST['txtAdPt'];
 $data["txtComment"] = $_POST['txtComment'];
 $data["txtDDate"] = implode(" ", array($_POST['txtDDateD'], $_POST['txtDDateT']));
 $data['selStatus'] = $_POST['selStatus'];
 if (!updateOrder($data, $db)) {
     header("location: " . ROOT . "order_list.php");
     exit;
 }
 ## clear Rf and App data first
 deleteRf($data["hidOrdID"], $db);
 deleteApp($data["hidOrdID"], $db);
 ## loop through receiptfacts
 for ($i = 0; $i < count($data['selRf']); $i++) {
     if ($data['selRf'][$i] == 0) {
         continue;
     }
     if (!insertRf($data["hidOrdID"], $data['selRf'][$i], $db)) {
         header("location: " . ROOT . "error.html");
         exit;
     }
		</div>
	</div>

<?php 
} else {
    ?>
	<!-- Link List -->
	<div class="content">	
		<div class="content-header">
			<h4><a href="?p=admin">Main Menu</a> / Frontpage Links</h4>
		</div> <!-- .content-header -->				
		<div class="main-content">
			<?php 
    if (isset($_POST['action'])) {
        if ($_POST['action'] == 'update') {
            updateOrder();
        } elseif ($_POST['action'] == 'addlink') {
            addLink();
        }
    }
    ?>
			<h4><center><b><u>
				<a href="?p=admin&sub=fplinks&addlink=true" style="text-decoration: none;"> 
					<button><span><?php 
    echo $lang['add_link'];
    ?>
</span></button>
				</a></u></b></center>
			</h4>
			<form method="POST" action="?p=admin&sub=fplinks" class="form label-inline">
			<input type="hidden" name="action" value="update">
    const DEVOLVIDO = 'Devolvido';
    const COMPLETO = 'Completo';
    const ESTORNADO = 'Estornado';
}
require_once 'app/Mage.php';
require_once 'app/code/core/Mage/Sales/Model/Order.php';
$codigoTransacao = $_POST["transacao_id"];
$statusAkatus = $_POST["status"];
$tokenRecebido = $_POST["token"];
$order = getOrder($codigoTransacao);
$tokenNIP = Mage::getStoreConfig('payment/akatus/tokennip', $order->getStoreId());
if ($tokenNIP == $tokenRecebido) {
    $newOrderState = getNewOrderState($statusAkatus, $order);
    Mage::Log('new order state: ' . $newOrderState);
    if ($newOrderState) {
        updateOrder($order, $newOrderState);
    }
}
function getOrder($codigoTransacao)
{
    $mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
    $mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
    Mage::app($mageRunCode, $mageRunType);
    $db = Mage::getSingleton('core/resource')->getConnection('core_write');
    $retorno = $db->query("SELECT idpedido FROM akatus_transacoes WHERE codtransacao = '" . $codigoTransacao . "' ORDER BY id DESC");
    $transacao = $retorno->fetch();
    if ($order = Mage::getModel('sales/order')->load($transacao['idpedido'])) {
        return $order;
    } else {
        return Mage::getModel('sales/order')->loadByIncrementId($transacao['idpedido']);
    }