$paypal = new PayPalPayment('paypalpluslink');
   include_once DIR_WS_LANGUAGES . $order->info['language'] . '/modules/payment/paypalpluslink.php';
   // confirmed
   if (isset($_GET['PayerID']) && $_GET['PayerID'] != '' && isset($_GET['token']) && $_GET['token'] != '' && isset($_GET['paymentId']) && $_GET['paymentId'] != '' && $_GET['paymentId'] == $_SESSION['paypal']['paymentId']) {
       $_SESSION['paypal']['PayerID'] = $_GET['PayerID'];
       $insert_id = (int) $_GET['oID'];
       $paypal->complete_cart();
       if (isset($_SESSION['customer_id'])) {
           $messageStack->add_session('paypalpluslink', MODULE_PAYMENT_PAYPALPLUSLINK_TEXT_COMPLETED);
           xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'info=1&order_id=' . (int) $_GET['oID'], 'SSL'));
       } else {
           $messageStack->add_session('logoff', MODULE_PAYMENT_PAYPALPLUSLINK_TEXT_COMPLETED);
           xtc_redirect(xtc_href_link(FILENAME_LOGOFF, 'info=1', 'SSL'));
       }
   } else {
       $approval = $paypal->payment_redirect(false, true, true);
       // create smarty elements
       $smarty = new Smarty();
       // include boxes
       require DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/source/boxes.php';
       $breadcrumb->add(NAVBAR_TITLE_2_CHECKOUT_CONFIRMATION);
       require DIR_WS_INCLUDES . 'header.php';
       $javascript = '<script type="text/javascript">
 var ppp = PAYPAL.apps.PPP({	
   "approvalUrl": "' . $approval . '",
   "placeholder": "ppplus",
   "mode": "' . $paypal->get_config('PAYPAL_MODE') . '",
   "language": "' . $_SESSION['language_code'] . '_' . $order->billing['country_iso_2'] . '",
   "country": "' . $order->billing['country_iso_2'] . '",
   "buttonLocation": "outside",
   "preselection": "paypal",
                } else {
                    $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1);
                }
            }
            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'NONSSL'));
            break;
            // BOF - Tomcraft - 2011-02-01 - Paypal Express Modul
        // BOF - Tomcraft - 2011-02-01 - Paypal Express Modul
        case 'paypal_express_checkout':
            if (defined('MODULE_PAYMENT_PAYPALEXPRESS_STATUS') && MODULE_PAYMENT_PAYPALEXPRESS_STATUS == 'True') {
                if (!is_object($product)) {
                    require_once DIR_WS_CLASSES . 'product.php';
                    $product = new product();
                }
                $o_paypal->paypal_express_auth_call();
                xtc_redirect($o_paypal->payPalURL);
            }
            break;
            // EOF - Tomcraft - 2011-02-01 - Paypal Express Modul
            ## Paypal
        // EOF - Tomcraft - 2011-02-01 - Paypal Express Modul
        ## Paypal
        case 'paypal_cart_checkout':
            if (defined('MODULE_PAYMENT_PAYPALCART_STATUS') && MODULE_PAYMENT_PAYPALCART_STATUS == 'True') {
                require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
                $paypal_cart = new PayPalPayment('paypalcart');
                $paypal_cart->payment_redirect(true);
            }
            break;
    }
}
Ejemplo n.º 3
0
        include_once DIR_WS_LANGUAGES . $order->info['language'] . '/modules/payment/paypallink.php';
        // confirmed
        if (isset($_GET['PayerID']) && $_GET['PayerID'] != '' && isset($_GET['token']) && $_GET['token'] != '' && isset($_GET['paymentId']) && $_GET['paymentId'] != '' && $_GET['paymentId'] == $_SESSION['paypal']['paymentId']) {
            $_SESSION['paypal']['PayerID'] = $_GET['PayerID'];
            $insert_id = (int) $_GET['oID'];
            $paypal->complete_cart();
            if (isset($_SESSION['customer_id'])) {
                $messageStack->add_session('paypallink', MODULE_PAYMENT_PAYPALLINK_TEXT_COMPLETED);
                xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'info=1&order_id=' . (int) $_GET['oID'], 'SSL'));
            } else {
                $messageStack->add_session('logoff', MODULE_PAYMENT_PAYPALLINK_TEXT_COMPLETED);
                xtc_redirect(xtc_href_link(FILENAME_LOGOFF, 'info=1', 'SSL'));
            }
        } else {
            if (!isset($_GET['payment_error'])) {
                $redirect = $paypal->payment_redirect(false, true, true);
                xtc_redirect($redirect);
            } else {
                if (isset($_SESSION['customer_id'])) {
                    $messageStack->add_session('paypallink', MODULE_PAYMENT_PAYPALLINK_TEXT_ERROR_MESSAGE);
                    xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'info=2&order_id=' . (int) $_GET['oID'], 'SSL'));
                } else {
                    $messageStack->add_session('logoff', MODULE_PAYMENT_PAYPALLINK_TEXT_ERROR_MESSAGE);
                    xtc_redirect(xtc_href_link(FILENAME_LOGOFF, 'info=2', 'SSL'));
                }
            }
        }
    } else {
        die('Direct Access to this location is not allowed.');
    }
} else {