Skip to content

Commit

Permalink
Release 1.0.33
Browse files Browse the repository at this point in the history
  • Loading branch information
sbossert committed Nov 25, 2019
1 parent 4e463f0 commit d02bc0d
Show file tree
Hide file tree
Showing 275 changed files with 419 additions and 550 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ This repository contains the OpenCart PostFinance Checkout payment module that

## Documentation

* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/opencart-2.3/1.0.32/docs/en/documentation.html)
* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/opencart-2.3/1.0.33/docs/en/documentation.html)

## License

Please see the [license file](https://github.com/pfpayments/opencart-2.3/blob/1.0.32/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/opencart-2.3/blob/1.0.33/LICENSE) for more information.
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/opencart-2.3/releases/tag/1.0.32/">
<a href="https://github.com/pfpayments/opencart-2.3/releases/tag/1.0.33/">
Source
</a>
</li>
Expand All @@ -48,7 +48,7 @@ <h1>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><a href="https://github.com/pfpayments/opencart-2.3/releases/tag/1.0.32/">Download</a> the extension.</p>
<p><a href="https://github.com/pfpayments/opencart-2.3/releases/tag/1.0.33/">Download</a> the extension.</p>
</li>
<li>
<p>Extract the files and upload the content of the <code>Upload</code> directory into the root directory of your store using FTP/SSH.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public function index(){
die();
}

\PostFinanceCheckout\Entity\Cron::cleanUpCronDB($this->registry);

try {
\PostFinanceCheckoutHelper::instance($this->registry)->dbTransactionStart();
$result = \PostFinanceCheckout\Entity\Cron::setProcessing($this->registry, $security_token);
Expand Down
28 changes: 28 additions & 0 deletions upload/system/library/postfinancecheckout/entity/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,32 @@ public static function getCurrentSecurityTokenForPendingCron(\Registry $registry
return false;
}
}

/**
* Removes all cron jobs older than 1 day which are completed (success / error)
* @param \Registry $registry
* @return boolean
*/
public static function cleanUpCronDB(\Registry $registry)
{
try {
$db = $registry->get('db');
\PostFinanceCheckoutHelper::instance($registry)->dbTransactionStart();
$success = self::STATE_SUCCESS;
$error = self::STATE_ERROR;
$table = DB_PREFIX . self::getTableName();
$cutoff = new \DateTime();
$cutoff->add(new \DateInterval('P1D'));
$cutoff = $cutoff->format('Y-m-d H:i:s');
$query = "DELETE FROM $table WHERE `state`='$error' OR `state`='$success' AND `date_completed`<'$cutoff';";

self::query($query, $db);
\PostFinanceCheckoutHelper::instance($registry)->dbTransactionCommit();
return true;
}
catch (\Exception $e) {
\PostFinanceCheckoutHelper::instance($registry)->dbTransactionRollback();
return false;
}
}
}
11 changes: 9 additions & 2 deletions upload/system/library/postfinancecheckout/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,10 @@ public function isValidOrder($order_id){
* which should be applied.
* @param string $message
* @param boolean $notify
* @param boolean $force If the history should be added even if status is still the same.
* @throws Exception
*/
public function addOrderHistory($order_id, $status, $message = '', $notify = false){
public function addOrderHistory($order_id, $status, $message = '', $notify = false, $force = false){
$this->log(__METHOD__ . " (ID: $order_id, Status: $status, Message: $message, Notify: $notify");
if ($this->isAdmin()) {
$this->log('Called addOrderHistory from admin context - unsupported.', self::LOG_ERROR);
Expand All @@ -538,7 +539,13 @@ public function addOrderHistory($order_id, $status, $message = '', $notify = fal
$status = $this->registry->get('config')->get($status);
}
$this->registry->get('load')->model('checkout/order');
$this->registry->get('model_checkout_order')->addOrderHistory($order_id, $status, $message, $notify);
$model = $this->registry->get('model_checkout_order');
$order = $model->getOrder($order_id);
if($order['status'] !== $status || $force) {
$model->addOrderHistory($order_id, $status, $message, $notify);
} else {
$this->log("Skipped adding order history, same status & !force.");
}
}

public function ensurePaymentCode(array $order_info, \PostFinanceCheckout\Sdk\Model\Transaction $transaction){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


/**
* Autoload function.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postfinancecheckout/sdk",
"version": "2.0.4",
"version": "2.0.5",
"description": "PostFinance Checkout SDK for PHP",
"keywords": [
"postfinancecheckout",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk;

use PostFinanceCheckout\Sdk\ApiException;
Expand Down Expand Up @@ -55,7 +54,7 @@ final class ApiClient {
*
* @var string
*/
private $userAgent = 'PHP-Client/2.0.4/php';
private $userAgent = 'PHP-Client/2.0.5/php';

/**
* The path to the certificate authority file.
Expand Down Expand Up @@ -136,8 +135,8 @@ public function __construct($userId, $applicationKey) {

$this->certificateAuthority = dirname(__FILE__) . '/ca-bundle.crt';
$this->serializer = new ObjectSerializer();
//$this->isDebuggingEnabled() ? $this->serializer->enableDebugging() : $this->serializer->disableDebugging();
//$this->serializer->setDebugFile($this->getDebugFile());
$this->isDebuggingEnabled() ? $this->serializer->enableDebugging() : $this->serializer->disableDebugging();
$this->serializer->setDebugFile($this->getDebugFile());
}

/**
Expand Down Expand Up @@ -332,7 +331,7 @@ public function enableDebugging() {
*/
public function disableDebugging() {
$this->enableDebugging = false;
//$this->serializer->disableDebugging();
$this->serializer->disableDebugging();
return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk;

use \Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,6 +18,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk;

/**
Expand Down Expand Up @@ -81,7 +80,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'PostFinanceCheckout\Sdk/2.0.4/php';
protected $userAgent = 'PostFinanceCheckout\Sdk/2.0.5/php';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -389,8 +388,8 @@ public static function toDebugReport()
$report = 'PHP SDK (PostFinanceCheckout\Sdk) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 2.0.4' . PHP_EOL;
$report .= ' SDK Package Version: 2.0.4' . PHP_EOL;
$report .= ' OpenAPI Spec Version: 2.0.5' . PHP_EOL;
$report .= ' SDK Package Version: 2.0.5' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,6 +18,7 @@
*/



namespace PostFinanceCheckout\Sdk;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

use \Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

use PostFinanceCheckout\Sdk\Http\ConnectionException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

use PostFinanceCheckout\Sdk\ObjectSerializer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

use PostFinanceCheckout\Sdk\ApiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Http;

use PostFinanceCheckout\Sdk\Http\ConnectionException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SDK
*
* This library allows to interact with the payment service.
* SDK: 2.0.4
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +17,7 @@
* limitations under the License.
*/


namespace PostFinanceCheckout\Sdk\Model;

use \ArrayAccess;
Expand Down
Loading

0 comments on commit d02bc0d

Please sign in to comment.