Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Release 1.2.35
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralbala committed May 17, 2023
1 parent 17d8ca6 commit a7038ca
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 38 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ This repository contains the PrestaShop PostFinance Checkout payment module that

## Documentation

* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.6/1.2.37/docs/en/documentation.html)
* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.6/1.2.35/docs/en/documentation.html)

## Support

Support queries can be issued on the [PostFinance Checkout support site](https://www.postfinance.ch/en/business/support.html).

## License

Please see the [license file](https://github.com/pfpayments/prestashop-1.6/blob/1.2.37/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/prestashop-1.6/blob/1.2.35/LICENSE) for more information.

## Other PrestaShop Versions

Expand Down
4 changes: 2 additions & 2 deletions docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/prestashop-1.6/releases/tag/1.2.37/">
<a href="https://github.com/pfpayments/prestashop-1.6/releases/tag/1.2.35/">
Source
</a>
</li>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h1>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/pfpayments/prestashop-1.6/releases/tag/1.2.37/">Download</a> the module.</p>
<p><a href="https://github.com/pfpayments/prestashop-1.6/releases/tag/1.2.35/">Download</a> the module.</p>
</li>
<li>
<p>Login to the backend of your PrestsShop store.</p>
Expand Down
5 changes: 1 addition & 4 deletions inc/Backend/Defaultstrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,7 @@ public function getRefundTotal(array $parsedData)

public function isVoucherOnlyPostFinanceCheckout(Order $order, array $postData)
{
if (method_exists('PostFinanceCheckoutVersionadapter', 'isVoucherOnlyPostFinanceCheckout')) {
return PostFinanceCheckoutVersionadapter::isVoucherOnlyPostFinanceCheckout($postData);
}
return FALSE;
return PostFinanceCheckoutVersionadapter::isVoucherOnlyPostFinanceCheckout($postData);
}

public function isCancelRequest(Order $order, array $postData)
Expand Down
4 changes: 2 additions & 2 deletions inc/Basemodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static function installHooks(PostFinanceCheckout $module)
$module->registerHook('displayAdminOrderMain') && $module->registerHook('displayAdminOrderTabLink') &&
$module->registerHook('displayBackOfficeHeader') && $module->registerHook('displayOrderDetail') &&
$module->registerHook('actionProductCancel') && $module->registerHook('postFinanceCheckoutSettingsChanged') &&
$module->registerHook('actionOrderSlipAdd');
$module->registerHook('actionAfterUpdateCancelProductFormHandler');
}

public static function installConfigurationValues()
Expand Down Expand Up @@ -1843,7 +1843,7 @@ public static function hookDisplayBackOfficeHeader(PostFinanceCheckout $module,
}
self::handleVoucherAddRequest($module);
self::handleVoucherDeleteRequest($module);
self::handleRefundRequest($module);
// self::handleRefundRequest($module);
self::handleCancelProductRequest($module);
}

Expand Down
2 changes: 1 addition & 1 deletion inc/Exception/Incompleteconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PostFinanceCheckoutExceptionIncompleteconfig extends Exception
* @param Throwable|null $previous
* The previously thrown exception.
*/
public function __construct($message = "The configuration is not complete", $code = 0, Throwable $previous = null) {
public function __construct($message = "The configuration is not complete", int $code = 0, ?Throwable $previous = null) {
parent::__construct($message, $code, $previous);
}
}
21 changes: 7 additions & 14 deletions inc/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

class PostFinanceCheckoutHelper
{
protected static $shop_system = 'x-meta-shop-system';
protected static $shop_system_version = 'x-meta-shop-system-version';
protected static $shop_system_and_version = 'x-meta-shop-system-and-version';
public const SHOP_SYSTEM = 'x-meta-shop-system';
public const SHOP_SYSTEM_VERSION = 'x-meta-shop-system-version';
public const SHOP_SYSTEM_AND_VERSION = 'x-meta-shop-system-and-version';

private static $apiClient;

Expand Down Expand Up @@ -675,18 +675,11 @@ public static function getMaxExecutionTime()
protected static function getDefaultHeaderData()
{
$shop_version = _PS_VERSION_;
$version_array = explode('.', $shop_version, 3);
if (count($version_array) < 2) {
// The format in _PS_VERSION_ has changed and it's unknown to us.
return [];

}
$major_version = current($version_array);
$minor_version = next($version_array);
[$major_version, $minor_version, $_] = explode('.', $shop_version, 3);
return [
self::$shop_system => 'prestashop',
self::$shop_system_version => $shop_version,
self::$shop_system_and_version => 'prestashop-' . $major_version . '.' . $minor_version,
self::SHOP_SYSTEM => 'prestashop',
self::SHOP_SYSTEM_VERSION => $shop_version,
self::SHOP_SYSTEM_AND_VERSION => 'prestashop-' . $major_version . '.' . $minor_version,
];
}
}
19 changes: 19 additions & 0 deletions inc/Service/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ public function getRefundByExternalId($spaceId, $externalId)
}
}

/**
* Executes the refund, saving it in the database (via database transaction)
* and then sending the refund information to the portal.
*
* @param Order $order
* @param array $parsedParameters
* @return void
*
* @see hookActionProductCancel
*/
public function executeRefund(Order $order, array $parsedParameters)
{
$currentRefundJob = null;
Expand Down Expand Up @@ -177,6 +187,15 @@ protected function sendRefund($refundJobId)
}
}

/**
* This functionality is called from a webhook, triggered by the portal.
* Updates the status of the order in the shop.
*
* @param [type] $refundJobId
* @return void
*
* @see PostFinanceCheckoutWebhookRefund::process
*/
public function applyRefundToShop($refundJobId)
{
$refundJob = new PostFinanceCheckoutModelRefundjob($refundJobId);
Expand Down
11 changes: 0 additions & 11 deletions inc/Versionadapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,4 @@ public static function getAdminOrderTemplate()
{
return 'views/templates/admin/hook/admin_order.tpl';
}

/**
* Returns true if the refund is only voucher, not required to be sent to PostFinanceCheckout.
*
* @param [] $postData
* @return boolean
*/
public static function isVoucherOnlyPostFinanceCheckout($postData)
{
return isset($postData['generateDiscountRefund']) && ! isset($postData['postfinancecheckout_offline']);
}
}
2 changes: 1 addition & 1 deletion postfinancecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct()
$this->author = 'Customweb GmbH';
$this->bootstrap = true;
$this->need_instance = 0;
$this->version = '1.2.37';
$this->version = '1.2.35';
$this->displayName = 'PostFinance Checkout';
$this->description = $this->l('This PrestaShop module enables to process payments with %s.');
$this->description = sprintf($this->description, 'PostFinance Checkout');
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 @@ -10,5 +10,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://checkout.postfinance.ch/en-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.6/1.2.37/docs/en/documentation.html" target="_blank">{l s='Documentation' mod='postfinancecheckout'}</a></p>
<p><a class="btn btn-default" href="https://checkout.postfinance.ch/en-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.6/1.2.35/docs/en/documentation.html" target="_blank">{l s='Documentation' mod='postfinancecheckout'}</a></p>
</div>

0 comments on commit a7038ca

Please sign in to comment.