Skip to content

Commit

Permalink
Release 1.0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoEigenmannCW committed Nov 21, 2018
1 parent b7510c6 commit 6107a29
Show file tree
Hide file tree
Showing 43 changed files with 1,856 additions and 66 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ This repository contains the PrestaShop PostFinance Checkout payment module that

## Documentation

* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.14/docs/en/documentation.html)
* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.15/docs/en/documentation.html)

## License

Please see the [license file](https://github.com/pfpayments/prestashop-1.7/blob/1.0.14/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/prestashop-1.7/blob/1.0.15/LICENSE) for more information.

## Other PrestaShop Versions

Expand Down
4 changes: 2 additions & 2 deletions controllers/front/return.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function postProcess()

return;
case 'failure':
self::process_failure($order);
self::processFailure($order);

return;
default:
Expand Down Expand Up @@ -74,7 +74,7 @@ private function processSuccess(Order $order)
);
}

private function process_failure(Order $order)
private function processFailure(Order $order)
{
$transactionService = PostFinanceCheckout_Service_Transaction::instance();
$transactionService->waitForTransactionState(
Expand Down
6 changes: 3 additions & 3 deletions controllers/front/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PostFinanceCheckoutWebhookModuleFrontController extends ModuleFrontControl
public $ssl = true;


public function handle_webhook_errors($errno, $errstr, $errfile, $errline)
public function handleWebhookErrors($errno, $errstr, $errfile, $errline)
{
$fatal = E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE;
if ($errno & $fatal) {
Expand All @@ -31,9 +31,9 @@ public function postProcess()
//the webhook is marked as failed.
header('HTTP/1.1 500 Internal Server Error');
$webhookService = PostFinanceCheckout_Service_Webhook::instance();
set_error_handler(array($this, 'handle_webhook_errors'));
set_error_handler(array($this, 'handleWebhookErrors'));
try {
$requestBody = trim(file_get_contents("php://input"));
$requestBody = trim(Tools::file_get_contents("php://input"));

$parsed = Tools::jsonDecode($requestBody);
if ($parsed == false) {
Expand Down
8 changes: 8 additions & 0 deletions docs/en/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ table td[class*="col-"],table th[class*="col-"] {
font-size: 0.875rem;
}

.table-of-contents > .nav > li > .nav > li > .nav > li > a {
padding-left: 2rem;
}

.table-of-contents > .nav > li > .nav > li > .nav > li > a .item-title {
font-size: 0.75rem;
}

.table-of-contents > .nav > li.active > .nav {
display: block;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/prestashop-1.7/releases/tag/1.0.14/">
<a href="https://github.com/pfpayments/prestashop-1.7/releases/tag/1.0.15/">
Source
</a>
</li>
Expand Down Expand Up @@ -50,7 +50,7 @@ <h1>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/pfpayments/prestashop-1.7/releases/tag/1.0.14/">Download</a> the module.</p>
<p><a href="https://github.com/pfpayments/prestashop-1.7/releases/tag/1.0.15/">Download</a> the module.</p>
</li>
<li>
<p>Extract the files and upload them to your store&#8217;s root directory using FTP/SSH.</p>
Expand Down
10 changes: 5 additions & 5 deletions inc/AbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1399,20 +1399,20 @@ public function hookActionAdminControllerSetMedia($arr)
{
if (Tools::strtolower(Tools::getValue('controller')) == 'adminorders') {
$this->context->controller->addJS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/js/admin/jAlert.min.js'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/js/admin/jAlert.min.js'
);
$this->context->controller->addJS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/js/admin/order.js'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/js/admin/order.js'
);
$this->context->controller->addCSS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/css/admin/order.css'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/css/admin/order.css'
);
$this->context->controller->addCSS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/css/admin/jAlert.css'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/css/admin/jAlert.css'
);
}
$this->context->controller->addJS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/js/admin/general.js'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/js/admin/general.js'
);
}

Expand Down
2 changes: 1 addition & 1 deletion inc/OrderStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static function createOrderState($key)
$state->unremovable = 1;
$state->module_name = 'postfinancecheckout';
$state->add();
$source = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'logo'.DIRECTORY_SEPARATOR.$config['image'].'.gif';
$source = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'view/img/logo'.DIRECTORY_SEPARATOR.$config['image'].'.gif';
$destination = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'os'.DIRECTORY_SEPARATOR.(int) $state->id.'.gif';
copy($source, $destination);
self::setOrderStatusId($key, $state->id);
Expand Down
14 changes: 10 additions & 4 deletions inc/Service/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,16 @@ public function getPossiblePaymentMethods(Cart $cart)
if (! isset(self::$possiblePaymentMethodCache[$currentCartId]) ||
self::$possiblePaymentMethodCache[$currentCartId] == null) {
$transaction = $this->getTransactionFromCart($cart);
$paymentMethods = $this->getTransactionService()->fetchPossiblePaymentMethods(
$transaction->getLinkedSpaceId(),
$transaction->getId()
);
try{
$paymentMethods = $this->getTransactionService()->fetchPossiblePaymentMethods(
$transaction->getLinkedSpaceId(),
$transaction->getId()
);
} catch (\WhitelabelMachineName\Sdk\ApiException $e) {
self::$possiblePaymentMethodCache[$currentCartId] = array();
throw $e;
}

$methodConfigurationService = PostFinanceCheckout_Service_MethodConfiguration::instance();
foreach ($paymentMethods as $paymentMethod) {
$methodConfigurationService->updateData($paymentMethod);
Expand Down
10 changes: 5 additions & 5 deletions postfinancecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
$this->author = 'Customweb GmbH';
$this->bootstrap = true;
$this->need_instance = 0;
$this->version = '1.0.14';
$this->version = '1.0.15';
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
parent::__construct();
}
Expand Down Expand Up @@ -209,11 +209,11 @@ public function hookActionFrontControllerSetMedia($arr)
if ($this->context->controller->php_self == 'order') {
$this->context->controller->registerStylesheet(
'postfinancecheckout-checkut-css',
'modules/' . $this->name . '/css/frontend/checkout.css'
'modules/' . $this->name . '/view/css/frontend/checkout.css'
);
$this->context->controller->registerJavascript(
'postfinancecheckout-checkout-js',
'modules/' . $this->name . '/js/frontend/checkout.js'
'modules/' . $this->name . '/view/js/frontend/checkout.js'
);
Media::addJsDef(
array(
Expand Down Expand Up @@ -247,7 +247,7 @@ public function hookActionFrontControllerSetMedia($arr)
if ($this->context->controller->php_self == 'order-detail') {
$this->context->controller->registerJavascript(
'postfinancecheckout-checkout-js',
'modules/' . $this->name . '/js/frontend/orderdetail.js'
'modules/' . $this->name . '/view/js/frontend/orderdetail.js'
);
}
}
Expand All @@ -256,7 +256,7 @@ public function hookActionAdminControllerSetMedia($arr)
{
parent::hookActionAdminControllerSetMedia($arr);
$this->context->controller->addCSS(
__PS_BASE_URI__ . 'modules/' . $this->name . '/css/admin/general.css'
__PS_BASE_URI__ . 'modules/' . $this->name . '/view/css/admin/general.css'
);
}

Expand Down
21 changes: 21 additions & 0 deletions translations/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* PostFinance Checkout Prestashop
*
* This Prestashop module enables to process payments with PostFinance Checkout (https://www.postfinance.ch).
*
* @author customweb GmbH (http://www.customweb.com/)
* @copyright 2017 - 2018 customweb GmbH
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
*/


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;
45 changes: 45 additions & 0 deletions views/css/admin/general.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* PostFinance Checkout Prestashop
*
* This Prestashop module enables to process payments with PostFinance Checkout (https://www.postfinance.ch).
*
* @author customweb GmbH (http://www.customweb.com/)
* @copyright 2017 - 2018 customweb GmbH
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
*/
#postfinancecheckout_manual_notif_wrapper div{
margin-left: 20px;
margin-right: 20px;
}

.postfinancecheckout-component > ul {
padding: 0;
margin: 0;
}
.postfinancecheckout-component, .postfinancecheckout-component > ul, .postfinancecheckout-component > ul > li {
display: flex !important;
align-items: stretch;
}

.postfinancecheckout-component > ul > li > a {
display: flex;
align-items: center;
}

.postfinancecheckout-icon-bullhorn-svg {
display: none;
}

.postfinancecheckout-component .postfinancecheckout-icon-bullhorn-svg {
display: block;
width: 18px;
height: 18px;
}

.postfinancecheckout-component #postfinancecheckout_manual_notif .postfinancecheckout_manual_notif::after {
display: none;
}

.postfinancecheckout-component #postfinancecheckout_manual_notif_number_wrapper{
display:none;
}
21 changes: 21 additions & 0 deletions views/css/admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* PostFinance Checkout Prestashop
*
* This Prestashop module enables to process payments with PostFinance Checkout (https://www.postfinance.ch).
*
* @author customweb GmbH (http://www.customweb.com/)
* @copyright 2017 - 2018 customweb GmbH
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
*/


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;
Loading

0 comments on commit 6107a29

Please sign in to comment.