Exemplo n.º 1
0
<?php

include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../header.php';
include dirname(__FILE__) . '/tinklit.php';
if (!$cookie->isLogged(true)) {
    Tools::redirect('authentication.php?back=order.php');
}
$tinklit = new tinklit();
if (_PS_VERSION_ <= '1.5') {
    echo $tinklit->execPayment($cart);
} else {
    Tools::redirect(Context::getContext()->link->getModuleLink('tinklit', 'payment'));
}
include_once dirname(__FILE__) . '/../../footer.php';
Exemplo n.º 2
0
<?php

/**
 * @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
 */
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../header.php';
include dirname(__FILE__) . '/tinklit.php';
$context = Context::getContext();
$cart = $context->cart;
$tinklit = new tinklit();
// p("ciao");
// Tools::redirect('index.php?controller=order&step=1');
if ($cart->id_customer == 0 or $cart->id_address_delivery == 0 or $cart->id_address_invoice == 0 or !$tinklit->active) {
    Tools::redirect('index.php?controller=order&step=1');
}
// Check that this payment option is still available in case the customer
// changed his address just before the end of the checkout process
$authorized = false;
foreach (Module::getPaymentModules() as $module) {
    if ($module['name'] == 'tinklit') {
        $authorized = true;
        break;
    }
}
if (!$authorized) {
    die($tinklit->l('This payment method is not available.', 'validation'));
}
echo $tinklit->execPayment($cart);
include_once dirname(__FILE__) . '/../../footer.php';
Exemplo n.º 3
0
 */
// called by notification_url
include_once dirname(__FILE__) . '/../../config/config.inc.php';
include_once dirname(__FILE__) . '/../../header.php';
include_once dirname(__FILE__) . '/tinklit.php';
$handle = fopen('php://input', 'r');
$jsonInput = fgets($handle);
if (function_exists('json_decode')) {
    $decoded = json_decode($jsonInput, true);
} else {
    $decoded = rmJSONdecode($jsonInput);
}
fclose($handle);
// remember, item_code is cart id
$order = (int) Order::getOrderByCartId((int) $decoded['item_code']);
$tinklit = new tinklit();
if (in_array($decoded['status'], array('payed'))) {
    if ($order == 0) {
        p("order is 0");
        $customer_securekey = $decoded['order_id'];
        $tinklit->validateOrder($decoded['item_code'], Configuration::get('PS_OS_PAYMENT'), $decoded['price'], $tinklit->displayName, null, array(), null, false, $customer_securekey);
    } else {
        if (empty(Context::getContext()->link)) {
            Context::getContext()->link = new Link();
        }
        // workaround a prestashop bug so email is sent
        $key = $decoded['order_id'];
        $order = new Order((int) Order::getOrderByCartId((int) $decoded['item_code']));
        $new_history = new OrderHistory();
        $new_history->id_order = (int) $order->id;
        //    $order_status = (int)Configuration::get('PS_OS_PAYMENT');