Пример #1
0
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
chdir('../../../../');
require 'includes/application_top.php';
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
    $snapshot = array('page' => 'ext/modules/payment/paypal/express.php', 'mode' => $request_type, 'get' => $HTTP_GET_VARS, 'post' => $HTTP_POST_VARS);
    $navigation->set_snapshot($snapshot);
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($cart->count_contents() < 1) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
require 'includes/modules/payment/paypal_express.php';
$paypal_express = new paypal_express();
if (!$paypal_express->check() || !$paypal_express->enabled) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {
    $api_url = 'https://api-3t.paypal.com/nvp';
    $paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout';
} else {
    $api_url = 'https://api-3t.sandbox.paypal.com/nvp';
    $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout';
}
if (!tep_session_is_registered('sendto')) {
    tep_session_register('sendto');
    $sendto = $customer_default_address_id;
}
if (!tep_session_is_registered('billto')) {
Пример #2
0
  Copyright (c) 2009 osCommerce

  Released under the GNU General Public License
*/
chdir('../../../../');
require 'includes/application_top.php';
require DIR_WS_LANGUAGES . $language . '/modules/payment/paypal_express.php';
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT;
// initialize variables if the customer is not logged in
if (!tep_session_is_registered('customer_id')) {
    $customer_id = 0;
    $customer_default_address_id = 0;
}
require 'includes/modules/payment/paypal_express.php';
$paypal_express = new paypal_express();
if (!$paypal_express->check() || !$paypal_express->enabled) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
if (!tep_session_is_registered('sendto')) {
    tep_session_register('sendto');
    $sendto = $customer_default_address_id;
}
if (!tep_session_is_registered('billto')) {
    tep_session_register('billto');
    $billto = $customer_default_address_id;
}
// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
if (!tep_session_is_registered('cartID')) {
    tep_session_register('cartID');
  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/
chdir('../../../../');
require 'includes/application_top.php';
require DIR_WS_LANGUAGES . $language . '/modules/payment/paypal_express.php';
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT;
// initialize variables if the customer is not logged in
if (!tep_session_is_registered('customer_id')) {
    $customer_id = 0;
    $customer_default_address_id = 0;
}
require 'includes/modules/payment/paypal_express.php';
$paypal_express = new paypal_express();
if (!$paypal_express->check() || !$paypal_express->enabled) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'));
}
if (!tep_session_is_registered('sendto')) {
    if (tep_session_is_registered('customer_id')) {
        $sendto = $customer_default_address_id;
    } else {
        $country = tep_get_countries(STORE_COUNTRY, true);
        $sendto = array('firstname' => '', 'lastname' => '', 'company' => '', 'street_address' => '', 'suburb' => '', 'postcode' => '', 'city' => '', 'zone_id' => STORE_ZONE, 'zone_name' => tep_get_zone_name(STORE_COUNTRY, STORE_ZONE, ''), 'country_id' => STORE_COUNTRY, 'country_name' => $country['countries_name'], 'country_iso_code_2' => $country['countries_iso_code_2'], 'country_iso_code_3' => $country['countries_iso_code_3'], 'address_format_id' => tep_get_address_format_id(STORE_COUNTRY));
    }
}
if (!tep_session_is_registered('billto')) {
    $billto = $sendto;
}
// register a random ID in the session to check throughout the checkout procedure
Пример #4
0
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2009 osCommerce

  Released under the GNU General Public License
*/
chdir('../../../../');
require 'includes/application_top.php';
require '../includes/modules/payment/paypal_express.php';
if (isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'test') {
    if (defined(MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS)) {
        $paypal_express = new paypal_express();
        $params = array('CURRENCYCODE' => DEFAULT_CURRENCY, 'AMT' => '1.00');
        $response_array = $paypal_express->setExpressCheckout($params);
        if ($response_array['ACK'] == 'Success' || $response_array['ACK'] == 'SuccessWithWarning') {
            echo '<h1>Success!</h1>';
            if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {
                echo '<p>The PayPal Express Checkout credentials have been set up correctly for live production use.</p>';
            } else {
                echo '<p>The PayPal Express Checkout credentials have been set up correctly for the sandbox environment.</p>';
            }
        } else {
            echo '<h1>Failure!</h1>';
            if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {
                echo '<p>The PayPal Express Checkout credentials are not set up correctly for live production use.</p>';
            } else {
                echo '<p>The PayPal Express Checkout credentials are not set up correctly for the sandbox environment.</p>';
Пример #5
0
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
    if ($cart->get_content_type() != 'physical') {
        $snapshot = array('page' => 'ext/modules/payment/paypal/express.php', 'mode' => $request_type, 'get' => $HTTP_GET_VARS, 'post' => $HTTP_POST_VARS);
        $navigation->set_snapshot($snapshot);
        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    $customer_id = 0;
    $customer_default_address_id = 0;
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($cart->count_contents() < 1) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
require 'includes/modules/payment/paypal_express.php';
$paypal_express = new paypal_express();
if (!$paypal_express->check() || !$paypal_express->enabled) {
    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
if (!tep_session_is_registered('sendto')) {
    tep_session_register('sendto');
    $sendto = $customer_default_address_id;
}
if (!tep_session_is_registered('billto')) {
    tep_session_register('billto');
    $billto = $customer_default_address_id;
}
// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
if (!tep_session_is_registered('cartID')) {
    tep_session_register('cartID');