Skip to content

Commit

Permalink
Sofort 8.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mketronet committed Mar 19, 2018
1 parent 096ad49 commit d42b799
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 56 deletions.
58 changes: 58 additions & 0 deletions -files --deleted -z | xargs -0 git rm
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
diff --git a/README.md b/README.md
index 0e0d962..db7bc5c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@

This repository contains the sources & documentation for the module tronet/trosofortueberweisung.

-This file gives you a quick briefing about the module. A more detailed description is available in the file `/docs/readme_en.pdf`.
+This file gives you a quick briefing about the module. A more detailed description is available in the file `/docs/readme_de.pdf`.

## DESCRIPTION

@@ -20,39 +20,23 @@ The SOFORT AG charges transaction fees for using the service.
## Prerequirements

* A merchant account at the SOFORT AG. You can create one [here](https://www.sofort.com/eng-DE/verkaeufer/su/e-payment-sofort-ueberweisung/)
-* An installed OXID eShop >=6.0.0-RC.2
+* An installed OXID eShop 6.0.x

## Install

Install the `tronet/trosofortueberweisung` package using [composer](https://getcomposer.org/):
-```
-{
- "require": {
- "tronet/trosofortueberweisung": "^8.0.1"
- }
-}
-```
-
-When the `tronet/trosofortueberweisung` package is installed following dependencies
-are resolved:
-
-* `sofort/sofortlib-php` v3.3.0. See [sofort/sofortlib-php on GitHub](https://github.com/sofort/sofortlib-php)
+composer require tronet/trosofortueberweisung:^8.0

## Update

-You can update SOFORT Überweisung and it's dependencies by running `php composer update`.
+You can update SOFORT Überweisung and its dependencies by running `composer update`.

## Supported OXID eShop versions

-Latest stable SOFORT module release: 7.0.3<br/>
-Currently in development: 8.0.1
-
|Module version| supported OXID eShop version
|:------------:|:---------------------------:
-|8.0.1 | 6.0.0-RC.2
-|7.0.3 | 4.7 - 4.10
-
-For older versions and how to update to newer versions see the documentation file `/docs/readme_en.pdf`.
+|8.0.2 | 6.0
+|7.0.4 | 4.7 - 4.10

## FAQ

34 changes: 34 additions & 0 deletions Application/Model/TrosofortueberweisungBasketItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Tronet\Trosofortueberweisung\Application\Model;

use OxidEsales\Eshop\Application\Model\BasketItem;

/**
* @link http://www.tro.net
* @copyright (c) tronet GmbH 2018
* @author tronet GmbH
*
* @since 8.0.2
* @version 8.0.2
*/
class TrosofortueberweisungBasketItem extends TrosofortueberweisungBasketItem_parent
{
/**
* Lade $this->_oArticle mit einem oxarticle-Objekt statt einem oxorderarticle-Objekt
*
* @author tronet GmbH
* @since 8.0.2
* @version 8.0.2
*/
protected function _setFromOrderArticle($oOrderArticle)
{
parent::_setFromOrderArticle($oOrderArticle);

if ($oOrderArticle->getTroUseArticleInsteadOfOrderArticle())
{
$this->_oArticle = $oOrderArticle->getArticle();
$this->setStockCheckStatus(false);
}
}
}
42 changes: 37 additions & 5 deletions Application/Model/TrosofortueberweisungOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use OxidEsales\Eshop\Application\Model\Basket;
use OxidEsales\Eshop\Application\Model\Order;
use OxidEsales\Eshop\Application\Model\OrderArticle;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Application\Model\UserPayment;
use OxidEsales\Eshop\Application\Model\Payment;
Expand All @@ -21,8 +22,8 @@
* @copyright (c) tronet GmbH 2018
* @author tronet GmbH
*
* @since 7.0.0
* @version 8.0.1
* @since 8.0.0
* @version 8.0.2
*/
class TrosofortueberweisungOrder extends TrosofortueberweisungOrder_parent
{
Expand Down Expand Up @@ -58,17 +59,45 @@ class TrosofortueberweisungOrder extends TrosofortueberweisungOrder_parent
*
* @author tronet GmbH
* @since 8.0.0
* @version 8.0.0
* @version 8.0.2
*/
public function getTroOrderBasket($blStockCheck = true)
public function getTroOrderBasket($blTroUseArticleInsteadOfOrderArticle = true)
{
$oBasket = $this->_getOrderBasket($blStockCheck);
$this->_addOrderArticlesToBasket($oBasket, $this->getOrderArticles(true));
if ($blTroUseArticleInsteadOfOrderArticle)
{
$this->_troAddArticlesFromOrderToBasket($oBasket, $this->getOrderArticles(true));
}
else
{
$this->_addOrderArticlesToBasket($oBasket, $this->getOrderArticles(true));
}
$oBasket->calculateBasket(true);

return $oBasket;
}

/**
* Lädt oxarticle statt oxorderarticles Objekte in das oxbasket-Objekt
* Bassiert auf oxorder._addOrderArticlesToBasket()
*
* @author tronet GmbH
* @since 8.0.2
* @version 8.0.2
*/
protected function _troAddArticlesFromOrderToBasket($oBasket, $aOrderArticles)
{
// if no order articles, return empty basket
if (count($aOrderArticles) > 0) {

//adding order articles to basket
foreach ($aOrderArticles as $oOrderArticle) {
$oOrderArticle->setTroUseArticleInsteadOfOrderArticle();
$oBasket->addOrderArticleToBasket($oOrderArticle);
}
}
}

/**
* @param Basket $oBasket basket object
* @param UserPayment $oUserPayment user payment object
Expand Down Expand Up @@ -200,6 +229,9 @@ public function troContinueFinalizeOrder(Basket $oBasket, $oUser)
throw $exception;
}

// Reset: Lade nun oxorderarticles statt oxarticles in das oxbasket-Objekt
$oBasket = $this->getTroOrderBasket(false);

// Call the original finalizeOrder method. In case the method is extended by other modules,
// this makes sure those features are executed as well.
$iRet2 = $this->finalizeOrder($oBasket, $oUser, true);
Expand Down
49 changes: 49 additions & 0 deletions Application/Model/TrosofortueberweisungOrderArticle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace Tronet\Trosofortueberweisung\Application\Model;

use OxidEsales\Eshop\Application\Model\OrderArticle;

/**
* @link http://www.tro.net
* @copyright (c) tronet GmbH 2018
* @author tronet GmbH
*
* @since 8.0.2
* @version 8.0.2
*/
class TrosofortueberweisungOrderArticle extends TrosofortueberweisungOrderArticle_parent
{
/**
* @var string $_blTroUseArticleInsteadOfOrderArticle
*
* @author tronet GmbH
* @since 8.0.2
* @version 8.0.2
*/
protected $_blTroUseArticleInsteadOfOrderArticle = null;

/**
* setter für $_blTroUseArticleInsteadOfOrderArticle
*
* @author tronet GmbH
* @since 8.0.2
* @version 8.0.2
*/
public function setTroUseArticleInsteadOfOrderArticle()
{
$this->_blTroUseArticleInsteadOfOrderArticle = true;
}

/**
* getter für $_blTroUseArticleInsteadOfOrderArticle
*
* @author tronet GmbH
* @since 8.0.2
* @version 8.0.2
*/
public function getTroUseArticleInsteadOfOrderArticle()
{
return $this->_blTroUseArticleInsteadOfOrderArticle;
}
}
40 changes: 23 additions & 17 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,29 @@
*CHANGED: Order gets finalized even if the shopuser quits after paying at Sofort.
*ADDED: Script to start by cronjob to delete all abandoned orders

==7.0.4==
*FIXED: Bug, Module-Settings-Name was longer than 32 characters which Oxid < 4.9 cannot handle
*FIXED: Bug, imgaes couldn't be rendered in emails

==8.0.0==
* CHANGED: Directory structure
* CHANGED: SOFORT Lib is now included using Composer
* CHANGED: adjustments to OXID eShop v6 standard
* CHANGED: Replace umlauts can now be overridden in case it does not work on a specific system
* ADDED: Notification controller may be used to fetch & update orders according to the current SOFORT status
* UPDATED: to SOFORT Lib v3.3.0
* UPDATED: phpDoc
* DROPPED: directory /tronet/trosofortueberweisung/library/payment/
* DROPPED: directory /tronet/trosofortueberweisung/library/core/
* DROPPED: Update routine itself. Use Composer instead
* DROPPED: Backwards compatibility for older versions in regards of language files
* FIXED: Decimals of prices and comma were not properly displayed in gateway reason
* FIXED: Order date were not updated accordingly when using browsers back button
*CHANGED: Logo of SOFORT is fetched from SOFORT server all the time
*CHANGED: Replace umlauts can now be overridden in case it does not work on a specific system
*ADDED: Notification controller may be used to fetch & update orders according to the current SOFORT status
*UPDATED: to SOFORT Lib v3.3.0
*UPDATED: phpDoc
*DROPPED: directory /tronet/trosofortueberweisung/library/payment/
*DROPPED: directory /tronet/trosofortueberweisung/library/core/
*DROPPED: Update routine itself. Use Composer instead
*CHANGED: adjustments to OXID eShop v6 standard
*DROPPED: Backwards compatibility for older versions in regards of language files
*FIXED: Decimals of prices and comma were not properly displayed in gateway reason
*FIXED: Order date were not updated accordingly when using browsers back button

==8.0.1==
* CHANGED: Order gets finalized even if the shopuser quits after paying at Sofort.
* ADDED: Script to start by cronjob to delete all abandoned orders
* UPDATED: to SOFORT Lib v3.*
* UPDATED: to SOFORT Api v2.0
*CHANGED: Order gets finalized even if the shopuser quits after paying at Sofort.
*ADDED: Script to start by cronjob to delete all abandoned orders
*UPDATED: to SOFORT Lib v3.*
*UPDATED: to SOFORT Api v2.0

==8.0.2==
*FIXED: Bug, imgaes couldn't be rendered in emails
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repository contains the sources & documentation for the module tronet/trosofortueberweisung.

This file gives you a quick briefing about the module. A more detailed description is available in the file `/docs/readme_en.pdf`.
This file gives you a quick briefing about the module. A more detailed description is available in the file `/docs/readme_de.pdf`.

## DESCRIPTION

Expand All @@ -20,39 +20,23 @@ The SOFORT AG charges transaction fees for using the service.
## Prerequirements

* A merchant account at the SOFORT AG. You can create one [here](https://www.sofort.com/eng-DE/verkaeufer/su/e-payment-sofort-ueberweisung/)
* An installed OXID eShop >=6.0.0-RC.2
* An installed OXID eShop 6.0.x

## Install

Install the `tronet/trosofortueberweisung` package using [composer](https://getcomposer.org/):
```
{
"require": {
"tronet/trosofortueberweisung": "^8.0.1"
}
}
```

When the `tronet/trosofortueberweisung` package is installed following dependencies
are resolved:

* `sofort/sofortlib-php` v3.3.0. See [sofort/sofortlib-php on GitHub](https://github.com/sofort/sofortlib-php)
composer require tronet/trosofortueberweisung:^8.0

## Update

You can update SOFORT Überweisung and it's dependencies by running `php composer update`.
You can update SOFORT Überweisung and its dependencies by running `composer update`.

## Supported OXID eShop versions

Latest stable SOFORT module release: 7.0.3<br/>
Currently in development: 8.0.1

|Module version| supported OXID eShop version
|:------------:|:---------------------------:
|8.0.1 | 6.0.0-RC.2
|7.0.3 | 4.7 - 4.10

For older versions and how to update to newer versions see the documentation file `/docs/readme_en.pdf`.
|8.0.2 | 6.0
|7.0.4 | 4.7 - 4.10

## FAQ

Expand Down
Binary file modified docs/readme_de.pdf
Binary file not shown.
10 changes: 0 additions & 10 deletions library/about-library.txt

This file was deleted.

6 changes: 4 additions & 2 deletions metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @author tronet GmbH
*
* @since 8.0.0
* @version 8.0.2
*/
$sMetadataVersion = '2.0';

Expand All @@ -25,7 +26,7 @@
'en' => 'Sofort. by tronet',
],
'thumbnail' => "out/img/logo_sofort.php?language=be_{$troCurrentLanguageAbbreviation}&columns=250&rows=55",
'version' => '8.0.1',
'version' => '8.0.2',
'author' => 'tronet GmbH',
'email' => 'integration@sofort.com',
'url' => 'https://www.tronet.media/',
Expand Down Expand Up @@ -76,12 +77,13 @@
'tronet_trosofortueberweisung_admin_trosofortueberweisunglistcontroller' => \Tronet\Trosofortueberweisung\Application\Controller\Admin\TrosofortueberweisungListController::class,
'tronet_trosofortueberweisung_admin_trosofortueberweisungmaincontroller' => \Tronet\Trosofortueberweisung\Application\Controller\Admin\TrosofortueberweisungMainController::class,
'tronet_trosofortueberweisung_admin_trosofortueberweisungordernotificationcontroller' => \Tronet\Trosofortueberweisung\Application\Controller\Admin\TrosofortueberweisungOrderNotificationController::class,
'tronet_trosofortueberweisung_admin_trosofortueberweisungupdatecontroller' => \Tronet\Trosofortueberweisung\Application\Controller\Admin\TrosofortueberweisungUpdateController::class,
],
'extend' => [
// Model
\OxidEsales\Eshop\Application\Model\PaymentGateway::class => \Tronet\Trosofortueberweisung\Application\Model\TrosofortueberweisungPaymentGateway::class,
\OxidEsales\Eshop\Application\Model\Order::class => \Tronet\Trosofortueberweisung\Application\Model\TrosofortueberweisungOrder::class,
\OxidEsales\Eshop\Application\Model\OrderArticle::class => \Tronet\Trosofortueberweisung\Application\Model\TrosofortueberweisungOrderArticle::class,
\OxidEsales\Eshop\Application\Model\BasketItem::class => \Tronet\Trosofortueberweisung\Application\Model\TrosofortueberweisungBasketItem::class,

// Controller - FE
\OxidEsales\Eshop\Application\Controller\OrderController::class => \Tronet\Trosofortueberweisung\Application\Controller\TrosofortueberweisungOrderController::class,
Expand Down

0 comments on commit d42b799

Please sign in to comment.