if ($A['active'] == 0 && SEC_hasRights('paypal.admin')) {
    $product->set_var('active', '<strong><font color="red">' . $LANG_PAYPAL_1['active'] . '</font></strong><br/>');
} else {
    $product->set_var('active', '');
}
$product->set_var('short_description', PLG_replacetags($A['short_description']));
if ($A['item_id'] != '' && $_PAY_CONF['display_item_id'] == 1) {
    $product->set_var('item_id', '<p class="product-item-id">' . $A['item_id'] . '</p>');
} else {
    $product->set_var('item_id', '');
}
$product->set_var('description', PLG_replacetags($A['description']));
$product->set_var('price_label', $LANG_PAYPAL_1['price_label']);
$product->set_var('display_price', '');
$product->set_var('price2', PAYPAL_productPrice($A));
$product->set_var('price', number_format(PAYPAL_productPrice($A), $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']));
$product->set_var(array('price_ref' => '', 'discount' => ''));
if ($A['price_ref'] != '' && $A['price_ref'] != 0) {
    $product->set_var('price_ref', '<span class="price_deleted">' . number_format($A['price_ref'], $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']) . '</span>');
}
if ($A['discount_a'] != '' && $A['discount_a'] != 0) {
    $product->set_var('discount', '<span class="price_promo">-' . number_format($A['discount_a'], $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']) . $_PAY_CONF['currency'] . '</span>');
    $product->set_var('price_ref', '<span class="price_deleted">' . number_format($A['price'], $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']) . '</span>');
} else {
    if ($A['discount_p'] != '' && $A['discount_p'] != 0) {
        $product->set_var('discount', '<span class="price_promo">-' . number_format($A['discount_p'], $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']) . '%' . ' </span>');
        $product->set_var('price_ref', '<span class="price_deleted">' . number_format($A['price'], $_CONF['decimal_count'], $_CONF['decimal_separator'], $_CONF['thousand_separator']) . '</span>');
    }
}
//Weight
if ($A['shipping_type'] == 0) {
Example #2
0
paypal_access_check('paypal.user');
$valid_process = true;
$item_id = $_POST['item_number'];
$item_price = $_POST['amount'];
$paypalURL = 'https://' . $_PAY_CONF['paypalURL'] . '/cgi-bin/webscr?cmd=_xclick';
/* MAIN */
$display .= PAYPAL_siteHeader();
$display .= paypal_user_menu();
session_start();
$_SESSION["user_id"] = $_USER['uid'];
$_SESSION["item_id"] = $_POST['item_number'];
$A = DB_fetchArray(DB_query("SELECT * FROM {$_TABLES['paypal_products']} WHERE id = '{$item_id}' LIMIT 1"));
if ($A['type'] == 'recurrent') {
    require_once $_CONF['path'] . 'plugins/paypal/proversion/paypalfunctions.php';
    $_SESSION["group_id"] = $A['add_to_group'];
    $_SESSION["Payment_Amount"] = PAYPAL_productPrice($A);
    $_SESSION["BILLINGDESCRIPTION"] = $A['name'];
    $_SESSION["BILLINGPERIOD"] = $A['duration_type'];
    // Day, Week, SemiMonth, Month, Year. For SemiMonth, billing is done on the 1st and 15th of each month.
    $_SESSION["BILLINGFREQUENCY"] = $A['duration'];
    //The combination of billing frequency and billing period must be less than or equal to one year. For example, if the billing cycle is Month, the maximum value for billing frequency is 12. Similarly, if the billing cycle is Week, the maximum value for billing frequency is 52. Note If the billing period is SemiMonth, the billing frequency must be 1.
    $_SESSION["BILLINGAMT"] = $A['billingamt'];
    //Billing amount for each billing cycle during this payment period. This amount does not include shipping and tax amounts.
    //$_SESSION["INITAMT"] = PAYPAL_productPrice($A);
    $_SESSION["currencyCodeType"] = $_PAY_CONF['currency'];
    $_SESSION["paymentType"] = "Sale";
    //Sale, Authorization, Order;
    //'------------------------------------
    //' The returnURL is the location where buyers return to when a
    //' payment has been succesfully authorized.
    //'------------------------------------
Example #3
0
$vars = array('msg' => 'text', 'shipping' => 'text');
paypal_filterVars($vars, $_REQUEST);
/* valid price, access and active product only */
$items = array();
$i = 1;
$quantities = array();
$valid_prices = true;
foreach ($cart->get_contents() as $item) {
    $realid = PAYPAL_realId($item['id']);
    $item_id = $realid[0];
    $items[$i] = $item['id'];
    $namesfromcart[$i] = $item['name'];
    $quantities[$i] = $item['qty'];
    $item_price[$i] = $item['price'];
    $A = DB_fetchArray(DB_query("SELECT * FROM {$_TABLES['paypal_products']} WHERE id = '{$item_id}' LIMIT 1"));
    if ($item_price[$i] != PAYPAL_productPrice($A) || !SEC_hasAccess2($A) || $A['active'] != '1') {
        $valid_prices = false;
    }
    $i++;
}
if ($valid_prices !== true) {
    echo COM_refresh($_CONF['site_url'] . '/index.php');
    exit;
}
//Main
// EMPTY THE CART
$cart->empty_cart();
$display .= PAYPAL_siteHeader();
$display .= paypal_user_menu();
switch ($_REQUEST['mode']) {
    default: