-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from OXID-eSales/bugfix/PSPAYPAL-784-error-af…
…ter-paypal-express Bugfix/pspaypal 784 error after paypal express
- Loading branch information
Showing
7 changed files
with
83 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
* See LICENSE file for license details. | ||
*/ | ||
|
||
use OxidEsales\Eshop\Application\Component\BasketComponent; | ||
use OxidEsales\Eshop\Application\Component\UserComponent; | ||
use OxidEsales\Eshop\Application\Controller\OrderController; | ||
use OxidEsales\Eshop\Application\Controller\PaymentController; | ||
|
@@ -20,6 +21,7 @@ | |
use OxidEsales\Eshop\Core\InputValidator; | ||
use OxidEsales\Eshop\Core\ShopControl; | ||
use OxidEsales\Eshop\Core\ViewConfig; | ||
use OxidSolutionCatalysts\PayPal\Component\BasketComponent as PayPalBasketComponent; | ||
use OxidSolutionCatalysts\PayPal\Component\UserComponent as PayPalUserComponent; | ||
use OxidSolutionCatalysts\PayPal\Controller\Admin\PayPalConfigController; | ||
use OxidSolutionCatalysts\PayPal\Controller\Admin\PayPalOrderController; | ||
|
@@ -56,7 +58,7 @@ | |
'en' => 'Use of the online payment service from PayPal. Documentation: <a href="https://docs.oxid-esales.com/modules/paypal-checkout/en/latest/" target="_blank">PayPal Checkout</a>' | ||
], | ||
'thumbnail' => 'out/img/paypal.png', | ||
'version' => '1.3.7', | ||
'version' => '1.3.9-rc.1', | ||
'author' => 'OXID eSales AG', | ||
'url' => 'https://www.oxid-esales.com', | ||
'email' => '[email protected]', | ||
|
@@ -73,6 +75,7 @@ | |
OrderController::class => PayPalFrontEndOrderController::class, | ||
PaymentController::class => PayPalPaymentController::class, | ||
UserComponent::class => PayPalUserComponent::class, | ||
BasketComponent::class => PayPalBasketComponent::class, | ||
OrderMain::class => PayPalOrderMainController::class, | ||
OrderOverview::class => PayPalOrderOverviewController::class, | ||
State::class => PayPalState::class | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
namespace OxidSolutionCatalysts\PayPal\Component; | ||
|
||
use OxidEsales\Eshop\Core\Registry; | ||
use OxidSolutionCatalysts\PayPal\Core\PayPalSession; | ||
|
||
/** | ||
* @mixin \OxidEsales\Eshop\Application\Component\BasketComponent | ||
*/ | ||
class BasketComponent extends BasketComponent_parent | ||
{ | ||
/** | ||
* @param $sProductId | ||
* @param $dAmount | ||
* @param $aSel | ||
* @param $aPersParam | ||
* @param $blOverride | ||
* @return mixed | ||
*/ | ||
public function changeBasket( | ||
$sProductId = null, | ||
$dAmount = null, | ||
$aSel = null, | ||
$aPersParam = null, | ||
$blOverride = true | ||
) { | ||
$this->resetExpressOrderAndShowError(); | ||
return parent::changeBasket($sProductId, $dAmount, $aSel, $aPersParam, $blOverride); | ||
} | ||
|
||
/** | ||
* @param $sProductId | ||
* @param $dAmount | ||
* @param $aSel | ||
* @param $aPersParam | ||
* @param $blOverride | ||
* @return mixed | ||
*/ | ||
public function toBasket($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false) | ||
{ | ||
$this->resetExpressOrderAndShowError(); | ||
return parent::toBasket($sProductId, $dAmount, $aSel, $aPersParam, $blOverride); | ||
} | ||
|
||
/** | ||
* Resets the session if the user has previously authorized a payment | ||
* with PayPal Express and is now adding or changing an item to the basket. | ||
* @return void | ||
*/ | ||
protected function resetExpressOrderAndShowError() { | ||
if (PayPalSession::isPayPalExpressOrderActive()) { | ||
PayPalSession::unsetPayPalOrderId(); | ||
Registry::getSession()->getBasket()->setPayment(null); | ||
Registry::getUtilsView()->addErrorToDisplay('OSCPAYPAL_KILL_EXPRESS_SESSION_REASON'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters