コード例 #1
0
        $smarty->assign('SHIPPING_METHOD', $order->info['shipping_method']);
    }
}
$order_total = $order->getTotalData($order->info['order_id']);
$smarty->assign('order_data', $order->getOrderData($order->info['order_id']));
$smarty->assign('order_total', $order_total['data']);
// Payment Method
if ($order->info['payment_method'] != '' && $order->info['payment_method'] != 'no_payment') {
    include DIR_WS_LANGUAGES . '/' . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_method'] . '.php';
    $smarty->assign('PAYMENT_METHOD', constant('MODULE_PAYMENT_' . strtoupper($order->info['payment_method']) . '_TEXT_TITLE'));
}
## PayPal
if ($order->info['payment_method'] == 'paypallink' || $order->info['payment_method'] == 'paypalpluslink') {
    require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
    $paypal = new PayPalPayment($order->info['payment_method']);
    if ($paypal->get_config('MODULE_PAYMENT_' . strtoupper($order->info['payment_method']) . '_USE_ACCOUNT') == 1) {
        $button = $paypal->create_paypal_link($order->info['order_id']);
        if ($button != '') {
            $smarty->assign('PAYPAL_LINK', sprintf(constant('MODULE_PAYMENT_' . strtoupper($order->info['payment_method']) . '_TEXT_SUCCESS'), $button));
        }
        if ($messageStack->size($order->info['payment_method']) > 0) {
            $smarty->assign('info_message', $messageStack->output($order->info['payment_method']));
        }
    }
}
// Order History
$history_block = '';
//DokuMan - 2010-09-18 - set undefined variable
$statuses_query = xtc_db_query("-- /account_history_info.php\n                                SELECT os.orders_status_name,\n                                       osh.date_added,\n                                       osh.comments,\n                                       osh.comments_sent\n                                FROM " . TABLE_ORDERS_STATUS . " os,\n                                     " . TABLE_ORDERS_STATUS_HISTORY . " osh\n                                WHERE osh.orders_id = '" . $order->info['order_id'] . "'\n                                  AND osh.customer_notified = 1\n                                  AND osh.orders_status_id = os.orders_status_id\n                                  AND os.language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                ORDER BY osh.date_added");
while ($statuses = xtc_db_fetch_array($statuses_query)) {
    $history_block .= xtc_date_short($statuses['date_added']) . '&nbsp;<strong>' . $statuses['orders_status_name'] . '</strong>&nbsp;' . (empty($statuses['comments']) || empty($statuses['comments_sent']) ? '&nbsp;' : nl2br(encode_htmlspecialchars($statuses['comments']))) . '<br />';
コード例 #2
0
<?php

/* -----------------------------------------------------------------------------------------
   $Id$

   modified eCommerce Shopsoftware
   http://www.modified-shop.org

   Copyright (c) 2009 - 2013 [www.modified-shop.org]
   -----------------------------------------------------------------------------------------
   Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/
require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
$paypal_cart = new PayPalPayment('paypalcart');
if ($paypal_cart->enabled === true && $paypal_cart->get_config('MODULE_PAYMENT_' . strtoupper($paypal_cart->code) . '_SHOW_PRODUCT') == '1') {
    $info_smarty->assign('ADD_CART_BUTTON_PAYPAL', $paypal_cart->product_checkout_button());
}
$paypal_installment = new PayPalPayment('paypalinstallment');
require_once DIR_FS_INC . 'xtc_get_countries.inc.php';
$country = xtc_get_countriesList(isset($_SESSION['country']) ? $_SESSION['country'] : (isset($_SESSION['customer_country_id']) ? $_SESSION['customer_country_id'] : STORE_COUNTRY), true);
if ($paypal_installment->enabled === true && $country['countries_iso_code_2'] == 'DE') {
    $amount = $xtPrice->xtcGetPrice($product->data['products_id'], false, 1, $product->data['products_tax_class_id'], $product->data['products_price']);
    $presentment = $paypal_installment->get_presentment_details($amount, $_SESSION['currency'], $country['countries_iso_code_2'], 'product', true);
    $info_smarty->assign('PAYPAL_INSTALLMENT', $presentment);
}
コード例 #3
0
           $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",
   "useraction": "continue",
   "showLoadingIndicator": "true",
   "showPuiOnSandbox": "true"
 });
 </script>' . "\n";
       $smarty->assign('javascript', $javascript);
       if (isset($_GET['payment_error'])) {
           $error = $paypal->get_error();
           $smarty->assign('error', $error['error']);
       }
       $cancel_link = xtc_href_link(FILENAME_LOGOFF, '', 'SSL');
コード例 #4
0
if (isset($_GET['checkout']) && $_SESSION['payment'] == 'paypalplus') {
    echo '<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js" type="text/javascript"></script>' . "\n";
    echo '<script type="text/javascript">PAYPAL.apps.PPP.doCheckout();</script>' . "\n";
} elseif (isset($_SESSION['paypal']['approval'])) {
    require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
    $selection = get_third_party_payments();
    $paypal = new PayPalPayment('paypalplus');
    $module = array();
    if (ACTIVATE_GIFT_SYSTEM == 'true') {
        require_once DIR_WS_CLASSES . 'order_total.php';
        $order_total_modules = new order_total();
        $credit_selection = $order_total_modules->credit_selection();
    }
    if (!isset($credit_selection) || !is_array($credit_selection) || count($credit_selection) < 1) {
        for ($i = 0, $n = sizeof($selection); $i < $n; $i++) {
            $description = $paypal->get_config(strtoupper($selection[$i]['id'] . '_' . $_SESSION['language_code']));
            $module[] = array('redirectUrl' => $paypal->encode_utf8($paypal->link_encoding(xtc_href_link('callback/paypal/paypalplus_redirect.php', 'payment=' . $selection[$i]['id'], 'SSL'))), 'methodName' => $paypal->encode_utf8(strip_tags($selection[$i]['module'])), 'description' => $paypal->encode_utf8($description != '' ? $description : strip_tags($selection[$i]['description'])));
        }
    }
    $country_query = xtc_db_query("SELECT c.countries_iso_code_2\n                                   FROM " . TABLE_COUNTRIES . " c\n                                   JOIN " . TABLE_ADDRESS_BOOK . " ab\n                                        ON c.countries_id = ab.entry_country_id\n                                           AND address_book_id = '" . $_SESSION['customer_default_address_id'] . "'");
    $country = xtc_db_fetch_array($country_query);
    echo '<div id="ppplus"></div>';
    echo '<script type="text/javascript">
  var ppp = PAYPAL.apps.PPP({	
  "approvalUrl": "' . $_SESSION['paypal']['approval'] . '",
  "placeholder": "ppplus",
  "mode": "' . $paypal->get_config('PAYPAL_MODE') . '",
  "language": "' . $_SESSION['language_code'] . '_' . $country['countries_iso_code_2'] . '",
  "country": "' . $country['countries_iso_code_2'] . '",
  "buttonLocation": "outside",
  "preselection": "paypal",
コード例 #5
0
// include needed functions
require_once DIR_FS_INC . 'get_external_content.inc.php';
// include needed classes
require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
// get request
$request_input = get_external_content('php://input', 3, false);
// get params
parse_str($request_input, $request);
$request['cmd'] = '_notify-validate';
// set payment
$paypal = new PayPalPayment('paypal');
// get transaction
$transaction = $paypal->get_transaction($request['txn_id']);
// set endpoint
$paypal_url = "https://www.paypal.com/cgi-bin/webscr";
if ($paypal->get_config('PAYPAL_MODE') == 'sandbox') {
    $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
// validate
$ch = curl_init($paypal_url);
if ($ch === false) {
    header("HTTP/1.0 404 Not Found");
    header("Status: 404 Not Found");
    exit;
}
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($request, '', '&'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
コード例 #6
0
   $Id$

   modified eCommerce Shopsoftware
   http://www.modified-shop.org

   Copyright (c) 2009 - 2013 [www.modified-shop.org]
   -----------------------------------------------------------------------------------------
   Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/
chdir('../../');
include 'includes/application_top.php';
// include needed functions
require_once DIR_FS_INC . 'get_external_content.inc.php';
// include needed classes
require_once DIR_FS_EXTERNAL . 'paypal/classes/PayPalPayment.php';
$request_json = get_external_content('php://input', 3, false);
$request = json_decode($request_json, true);
$check_query = xtc_db_query("SELECT p.orders_id,\n                                    o.orders_status\n                               FROM " . TABLE_PAYPAL_PAYMENT . " p\n                               JOIN " . TABLE_ORDERS . " o\n                                    ON o.orders_id = p.orders_id\n                              WHERE p.payment_id = '" . xtc_db_input($request['resource']['parent_payment']) . "'");
if (xtc_db_num_rows($check_query) > 0) {
    $check = xtc_db_fetch_array($check_query);
    $paypal = new PayPalPayment('paypal');
    $orders_status_id = $paypal->get_config($request['event_type']);
    if ($orders_status_id < 0) {
        $orders_status_id = $check['orders_status'];
    }
    $paypal->update_order($request['summary'], $orders_status_id, $check['orders_id']);
} else {
    // order is missing
    header("HTTP/1.0 404 Not Found");
    header("Status: 404 Not Found");
}