// MERGE with 1.4 r7770
This commit is contained in:
@@ -39,6 +39,3 @@ $_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] =
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Die bestellungen müssen mit der gleichen Währung wie Ihr Verkäufer-Konto eingestelltwerden. Warenkörbe in anderen Währungen werden umgerechnet, wenn der Kunde mit diesem Modul bezahlen möchte.';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Bezahlen Sie mit GoogleCheckout';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Verpackung';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Versandkosten';
|
||||
|
||||
?>
|
||||
@@ -39,4 +39,3 @@ $_MODULE['<{gcheckout}prestashop>gcheckout_dba727a9adc372723baef4533a7fc9da'] =
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_0d46d15f70a7cfa670545b308c022840'] = 'Les commandes doivent être passées en utilisant la même devise que celle indiquée dans votre compte marchand. Les paniers utilisant d\'autres devises seront convertis si l\'utilisateur décide de payer par le biais de ce module.';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_8dd85f4218069de952672fe3180dacdb'] = 'Payer par GoogleCheckout';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_ba794350deb07c0c96fe73bd12239059'] = 'Emballage';
|
||||
$_MODULE['<{gcheckout}prestashop>gcheckout_9f06b28a40790c4c4df5739bce3c1eb0'] = 'Frais de port';
|
||||
|
||||
@@ -30,7 +30,7 @@ if (!defined('_CAN_LOAD_FILES_'))
|
||||
|
||||
class GCheckout extends PaymentModule
|
||||
{
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'gcheckout';
|
||||
$this->tab = 'payments_gateways';
|
||||
@@ -49,7 +49,7 @@ class GCheckout extends PaymentModule
|
||||
$this->warning = $this->l('No currency set for this module');
|
||||
}
|
||||
|
||||
function install()
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() OR !$this->registerHook('payment') OR
|
||||
!$this->registerHook('paymentReturn') OR
|
||||
@@ -62,7 +62,7 @@ class GCheckout extends PaymentModule
|
||||
return true;
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
public function uninstall()
|
||||
{
|
||||
return (parent::uninstall() AND
|
||||
Configuration::deleteByName('GCHECKOUT_MERCHANT_ID') AND
|
||||
@@ -72,7 +72,7 @@ class GCheckout extends PaymentModule
|
||||
Configuration::deleteByName('GCHECKOUT_NO_SHIPPING'));
|
||||
}
|
||||
|
||||
function getContent()
|
||||
public function getContent()
|
||||
{
|
||||
global $currentIndex, $cookie;
|
||||
|
||||
@@ -93,6 +93,12 @@ class GCheckout extends PaymentModule
|
||||
Configuration::updateValue('GCHECKOUT_LOGS', 1);
|
||||
else
|
||||
Configuration::updateValue('GCHECKOUT_LOGS', 0);
|
||||
|
||||
if (Tools::getValue('gcheckout_no_shipping'))
|
||||
Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 1);
|
||||
else
|
||||
Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 0);
|
||||
|
||||
if (!sizeof($errors))
|
||||
Tools::redirectAdmin($currentIndex.'&configure=gcheckout&token='.Tools::getValue('token').'&conf=4');
|
||||
foreach ($errors as $error)
|
||||
@@ -103,6 +109,11 @@ class GCheckout extends PaymentModule
|
||||
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="'.__PS_BASE_URI__.'modules/gcheckout/logo.gif" />'.$this->l('Settings').'</legend>
|
||||
<p>
|
||||
<div class="warn">
|
||||
'.$this->l('The API version used by this module is 2.0').'
|
||||
</div>
|
||||
</p>
|
||||
<p>'.$this->l('Use the sandbox to test out the module then you can use the real mode if no problems arise. Remember to change your merchant key and ID according to the mode.').'</p>
|
||||
<label>
|
||||
'.$this->l('Mode').'
|
||||
@@ -113,6 +124,11 @@ class GCheckout extends PaymentModule
|
||||
<option value="sandbox"'.(Configuration::get('GCHECKOUT_MODE') == 'sandbox' ? ' selected="selected"' : '').'>'.$this->l('Sandbox').' </option>
|
||||
</select>
|
||||
</div>
|
||||
<p>'.$this->l('Don\'t forget to specify the currency used in the Payment tabs under the currency section').'</p>
|
||||
<label>
|
||||
'.$this->l('Currency').'
|
||||
</label>
|
||||
'.$this->getCurrency()->iso_code.'
|
||||
<p>'.$this->l('You can find these keys in your Google Checkout account > Settings > Integration. Sandbox and real mode both have these keys.').'</p>
|
||||
<label>
|
||||
'.$this->l('Merchant ID').'
|
||||
@@ -156,7 +172,7 @@ class GCheckout extends PaymentModule
|
||||
return $html;
|
||||
}
|
||||
|
||||
function hookPayment($params)
|
||||
public function hookPayment($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
return;
|
||||
@@ -167,18 +183,17 @@ class GCheckout extends PaymentModule
|
||||
return $this->display(__FILE__, 'payment.tpl');
|
||||
}
|
||||
|
||||
function hookPaymentReturn($params)
|
||||
public function hookPaymentReturn($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
return;
|
||||
return $this->display(__FILE__, 'payment_return.tpl');
|
||||
}
|
||||
|
||||
function preparePayment()
|
||||
public function preparePayment()
|
||||
{
|
||||
global $smarty, $cart, $cookie;
|
||||
|
||||
|
||||
require_once(dirname(__FILE__).'/library/googlecart.php');
|
||||
require_once(dirname(__FILE__).'/library/googleitem.php');
|
||||
require_once(dirname(__FILE__).'/library/googleshipping.php');
|
||||
@@ -212,8 +227,11 @@ class GCheckout extends PaymentModule
|
||||
utf8_decode($voucher['description']), 1, '-'.$voucher['value_real']));
|
||||
|
||||
if (!Configuration::get('GCHECKOUT_NO_SHIPPING'))
|
||||
$googleCart->AddShipping(new GooglePickUp($this->l('Shipping costs'),
|
||||
{
|
||||
$carrier = new Carrier((int)($cart->id_carrier), (int)($cookie->id_lang));
|
||||
$googleCart->AddShipping(new GoogleFlatRateShipping(utf8_decode($carrier->name),
|
||||
$cart->getOrderShippingCost($cart->id_carrier)));
|
||||
}
|
||||
|
||||
$googleCart->SetEditCartUrl(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order.php');
|
||||
$googleCart->SetContinueShoppingUrl(Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'order-confirmation.php');
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -70,23 +70,19 @@ if(!$status)
|
||||
*
|
||||
*/
|
||||
|
||||
switch ($root) {
|
||||
case "request-received": {
|
||||
switch ($root)
|
||||
{
|
||||
case "request-received":
|
||||
break;
|
||||
}
|
||||
case "error": {
|
||||
case "error":
|
||||
break;
|
||||
}
|
||||
case "diagnosis": {
|
||||
case "diagnosis":
|
||||
break;
|
||||
}
|
||||
case "checkout-redirect": {
|
||||
case "checkout-redirect":
|
||||
break;
|
||||
}
|
||||
case "merchant-calculation-callback": {
|
||||
case "merchant-calculation-callback":
|
||||
break;
|
||||
}
|
||||
case "new-order-notification": {
|
||||
case "new-order-notification":
|
||||
// secure_cart[0] => id_cart
|
||||
// secure_cart[1] => secure_key
|
||||
|
||||
@@ -97,31 +93,28 @@ switch ($root) {
|
||||
unset($cart);
|
||||
|
||||
$orderTotal = (float)($data[$root]['order-total']['VALUE']);
|
||||
$gcheckout->validateOrder((int)$secure_cart[0], _PS_OS_PAYMENT_, (float)$orderTotal,
|
||||
$gcheckout->validateOrder((int)$secure_cart[0], Configuration::get('PS_OS_PAYMENT'), (float)$orderTotal,
|
||||
$gcheckout->displayName, NULL, array(), NULL, false, $secure_cart[1]);
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
case "order-state-change-notification": {
|
||||
case "order-state-change-notification":
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
case "charge-amount-notification": {
|
||||
case "charge-amount-notification":
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
case "chargeback-amount-notification": {
|
||||
case "chargeback-amount-notification":
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
case "refund-amount-notification": {
|
||||
case "refund-amount-notification":
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
case "risk-information-notification": {
|
||||
case "risk-information-notification":
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
case 'authorization-amount-notification':
|
||||
$Gresponse->SendAck();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
$Gresponse->SendBadRequestStatus("Invalid or not supported Message");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user