Skip to content

Commit

Permalink
Release 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoEigenmannCW committed Sep 5, 2018
1 parent 7313949 commit 188bf8b
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 118 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.8/docs/en/documentation.html)
* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.9/docs/en/documentation.html)

## License

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

## Other PrestaShop Versions

Expand Down
192 changes: 108 additions & 84 deletions docs/en/documentation.html

Large diffs are not rendered by default.

Binary file added docs/en/resource/prestashop-1.7-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/resource/prestashop-1.7-refund1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/resource/prestashop-1.7-refund2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/resource/prestashop-1.7-void.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/en/resource/state_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions inc/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public static function migrateDb()
}
foreach (static::getMigrations() as $version => $functionName) {
if (version_compare($currentVersion, $version, '<')) {
Wallee_Helper::startDBTransaction();
PostFinanceCheckout_Helper::startDBTransaction();
try{
call_user_func(array(
get_called_class(),
$functionName
));
Configuration::updateGlobalValue(self::CK_DB_VERSION, $version);
Wallee_Helper::commitDBTransaction();
PostFinanceCheckout_Helper::commitDBTransaction();
}
catch(Exception $e){
Wallee_Helper::rollbackDBTransaction();
PostFinanceCheckout_Helper::rollbackDBTransaction();
throw $e;
}
$currentVersion = $version;
Expand Down
107 changes: 82 additions & 25 deletions inc/AbstractModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,24 @@ protected function handleSaveDownload()
return $output;
}

protected function handleSaveSpaceViewId()
{
$output = "";
if (Tools::isSubmit('submit' . $this->name . '_space_view_id')) {
if (!$this->context->shop->isFeatureActive() || $this->context->shop->getContext() == Shop::CONTEXT_SHOP) {
Configuration::updateValue(self::CK_SPACE_VIEW_ID,
Tools::getValue(self::CK_SPACE_VIEW_ID));
$output .= $this->displayConfirmation($this->l('Settings updated'));
}
else {
$refresh = false;
$output .= $this->displayError(
$this->l('You can not store the configuration for all Shops or a Shop Group.'));
}
}
return $output;
}

protected function handleSaveOrderStatus()
{
$output = "";
Expand All @@ -453,6 +471,8 @@ protected function handleSaveOrderStatus()
return $output;
}



protected function getFormHelper()
{
$helper = new HelperForm();
Expand Down Expand Up @@ -515,7 +535,6 @@ protected function displayForm()
$this->l('The Authentication Key needs to be configured globally.') . '</b>'
);


$spaceIdConfig = array(
'type' => 'text',
'label' => $this->l('Space Id'),
Expand All @@ -524,16 +543,7 @@ protected function displayForm()
'col' => 3,
'lang' => false
);


$spaceViewIdConfig = array(
'type' => 'text',
'label' => $this->l('Space View Id'),
'name' => self::CK_SPACE_VIEW_ID,
'col' => 3,
'lang' => false
);


$spaceIdInfo = array(
'type' => 'html',
'name' => 'IGNORE',
Expand All @@ -542,15 +552,7 @@ protected function displayForm()
'</b>'
);

$spaceViewIdInfo = array(
'type' => 'html',
'name' => 'IGNORE',
'col' => 3,
'html_content' => '<b>' .
$this->l('The Space View Id needs to be configured per shop.') . '</b>'
);

$generalInputs = array($spaceIdConfig, $userIdConfig, $userPwConfig, $spaceViewIdConfig);
$generalInputs = array($spaceIdConfig, $userIdConfig, $userPwConfig);
$buttons = array(
array(
'title' => $this->l('Save'),
Expand All @@ -563,10 +565,10 @@ protected function displayForm()

if ($this->context->shop->isFeatureActive()) {
if ($this->context->shop->getContext() == Shop::CONTEXT_ALL) {
$generalInputs = array($spaceIdInfo, $userIdConfig, $userPwConfig, $spaceViewIdInfo);
$generalInputs = array($spaceIdInfo, $userIdConfig, $userPwConfig);
}
elseif ($this->context->shop->getContext() == Shop::CONTEXT_SHOP) {
$generalInputs = array($spaceIdConfig, $userIdInfo, $userPwInfo, $spaceViewIdConfig);
$generalInputs = array($spaceIdConfig, $userIdInfo, $userPwInfo);
array_unshift($buttons,
array(
'title' => $this->l('Save All'),
Expand All @@ -577,7 +579,7 @@ protected function displayForm()
));
}
else {
$generalInputs = array_merge($spaceIdInfo, $userIdInfo, $userPwInfo, $spaceViewIdInfo);
$generalInputs = array_merge($spaceIdInfo, $userIdInfo, $userPwInfo);
$buttons = array();
}
}
Expand Down Expand Up @@ -838,6 +840,53 @@ protected function getDownloadConfigValues()
return $values;
}

protected function getSpaceViewIdForm()
{


$spaceViewIdConfig = array(
array(
'type' => 'text',
'label' => $this->l('Space View Id'),
'name' => self::CK_SPACE_VIEW_ID,
'col' => 3,
'lang' => false
));

return array(
'legend' => array(
'title' => $this->l('Space View Id Settings')
),
'input' => $spaceViewIdConfig,
'buttons' => array(
array(
'title' => $this->l('Save All'),
'class' => 'pull-right',
'type' => 'input',
'icon' => 'process-icon-save',
'name' => 'submit' . $this->name . '_all'
),
array(
'title' => $this->l('Save'),
'class' => 'pull-right',
'type' => 'input',
'icon' => 'process-icon-save',
'name' => 'submit' . $this->name . '_space_view_id'
)
)
);
}

protected function getSpaceViewIdConfigValues()
{
$values = array();
if (!$this->context->shop->isFeatureActive() || $this->context->shop->getContext() == Shop::CONTEXT_SHOP) {
$values[self::CK_SPACE_VIEW_ID] = Configuration::get(self::CK_SPACE_VIEW_ID);
}

return $values;
}

protected function getOrderStatusForm()
{
$orderStates = OrderState::getOrderStates($this->context->language->id);
Expand Down Expand Up @@ -1094,8 +1143,7 @@ public static function startRecordingMailMessages()
*/
public static function stopRecordingMailMessages()
{
self::$recordMailMessages = false;

self::$recordMailMessages = false;
return self::$recordedMailMessages;
}

Expand Down Expand Up @@ -1149,6 +1197,15 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid,
$specificPrice->save();
}

// Copy messages to new cart
$messageCollection = new PrestaShopCollection('Message');
$messageCollection->where('id_cart', '=', (int) $id_cart);
foreach($messageCollection->getResults() as $message){
$duplicateMessage = $message->duplicateObject();
$duplicateMessage->id_cart = $cart->id;
$duplicateMessage->save();
}

$methodConfiguration = null;
if (strpos($payment_method, "postfinancecheckout_") === 0) {
$id = substr($payment_method, strpos($payment_method, "_") + 1);
Expand Down
7 changes: 5 additions & 2 deletions postfinancecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
*/

define('POSTFINANCECHECKOUT_VERSION', '1.0.8');
define('POSTFINANCECHECKOUT_VERSION', '1.0.9');

require_once (__DIR__ . DIRECTORY_SEPARATOR . 'postfinancecheckout_autoloader.php');
require_once (__DIR__ . DIRECTORY_SEPARATOR . 'postfinancecheckout-sdk' . DIRECTORY_SEPARATOR .
Expand Down Expand Up @@ -61,6 +61,7 @@ public function getContent()
$output .= $this->handleSaveEmail();
$output .= $this->handleSaveFeeItem();
$output .= $this->handleSaveDownload();
$output .= $this->handleSaveSpaceViewId();
$output .= $this->handleSaveOrderStatus();
$output .= $this->displayHelpButtons();
return $output . $this->displayForm();
Expand All @@ -85,14 +86,16 @@ protected function getConfigurationForms()
$this->getEmailForm(),
$this->getFeeForm(),
$this->getDocumentForm(),
$this->getSpaceViewIdForm(),
$this->getOrderStatusForm()
);
}

protected function getConfigurationValues()
{
return array_merge($this->getApplicationConfigValues(), $this->getEmailConfigValues(),
$this->getFeeItemConfigValues(), $this->getDownloadConfigValues(),
$this->getFeeItemConfigValues(), $this->getDownloadConfigValues(),
$this->getSpaceViewIdConfigValues(),
$this->getOrderStatusConfigValues());
}

Expand Down
3 changes: 2 additions & 1 deletion translations/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_92b9914705fe9e0773abc6d1dfbb5731'] = 'Die Benutzer ID muss global konfiguriert werden.';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_13277e91101a921fc21dcd6551411c03'] = 'Der Authentication Key muss global konfiguriert werden.';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_cb5bcc209d3e29cbc4a844a02e42002c'] = 'Space ID';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_1775eac569f3b5d4e199e2277ae3c30f'] = 'Space View ID';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_36ad6b64a5b0c0ddb13ae00e53099323'] = 'Die Space ID muss pro Shop konfiguriert sein.';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_8e63a761d52552f09e8ff1f8a4680c0b'] = 'Sie Space View ID muss pro Shop konfiguriert werden.';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern';
Expand All @@ -93,6 +92,8 @@
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_8e17feef2ad87bf2b01bf37bfc13391d'] = 'Lieferschein Download';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_2a8fce24dc089ed8b6db1fc8aa13c9fe'] = 'Den Kunden den Download des %s Lieferscheins gewähren';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_d5336ac96357700b21d24e951edfc4ec'] = 'Dokumenteinstellungen';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_1775eac569f3b5d4e199e2277ae3c30f'] = 'Space View ID';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_a7207f492b891f72241abe0f34ea05c8'] = 'Space View ID Settings';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_c094c5aafadf881fcff04062c7a99605'] = 'Fehlgeschlagener Status';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_6f3118f0c57baab9fd0da2b3e6a2559c'] = 'Status der Bestellung falls die Transaktion im fehlgschlagenen Status ist.';
$_MODULE['<{postfinancecheckout}prestashop>abstractmodule_56472f4aac3e6d691078856fbd5de587'] = 'Autorisierter Status';
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/admin_help_buttons.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
<div class="alert alert-info">
<img src="../modules/postfinancecheckout/logo.png" style="float:left; margin-right:15px;" height="50">
<p><strong>{l s='This module requires an %s account.' sprintf='PostFinance Checkout' mod='postfinancecheckout'}</strong></p>
<p><a class="btn btn-default" href="https://www.postfinance-checkout.ch/user/signup" target="_blank">{l s='Sign Up' mod='postfinancecheckout'}</a> <a class="btn btn-default" href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.8/docs/en/documentation.html" target="_blank">{l s='Documentation' mod='postfinancecheckout'}</a></p>
<p><a class="btn btn-default" href="https://www.postfinance-checkout.ch/user/signup" target="_blank">{l s='Sign Up' mod='postfinancecheckout'}</a> <a class="btn btn-default" href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.9/docs/en/documentation.html" target="_blank">{l s='Documentation' mod='postfinancecheckout'}</a></p>
</div>

0 comments on commit 188bf8b

Please sign in to comment.