Skip to content

Commit

Permalink
v1.3.0 Reimplemented M2.3 combatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
hilrob committed May 23, 2019
1 parent eaba52d commit c1baa7f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 63 deletions.
22 changes: 21 additions & 1 deletion Controller/Webhooks/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@

namespace Iways\PayPalPlus\Controller\Webhooks;

use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\Exception\LocalizedException;

/**
* Unified IPN controller for all supported PayPal methods
*/
class Index extends \Magento\Framework\App\Action\Action
class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
{
/**
* @var \Psr\Log\LoggerInterface
Expand All @@ -36,6 +38,24 @@ class Index extends \Magento\Framework\App\Action\Action
*/
protected $_apiFactory;

/**
* @param \Magento\Framework\App\RequestInterface $request
* @return bool|null
*/
public function validateForCsrf(\Magento\Framework\App\RequestInterface $request): ?bool
{
return true;
}

/**
* @param \Magento\Framework\App\RequestInterface $request
* @return InvalidRequestException|null
*/
public function createCsrfValidationException(\Magento\Framework\App\RequestInterface $request): ?InvalidRequestException
{
return null;
}

/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Iways\PayPalPlus\Model\Webhook\EventFactory $webhookEventFactory
Expand Down
42 changes: 0 additions & 42 deletions Controller/Webhooks/Twothree.php

This file was deleted.

14 changes: 0 additions & 14 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,6 @@ public function handleException(\Exception $e)
*/
public function getWebhooksUrl()
{
$version = $this->productMetaData->getVersion();
if (version_compare($version, '2.3.0', '>=')) {
return str_replace(
'http://',
'https://',
$this->_getUrl(
'paypalplus/webhooks/twothree/',
[
'_forced_secure' => true,
'_nosid' => true,
]
)
);
}
return str_replace(
'http://',
'https://',
Expand Down
9 changes: 9 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
==== 1.3.0 ====
Reimplemented M2.3 combatibility
Removed M2.0 M2.1 M2.2 compatibility
Note:
M2.0 M2.1 M2.2 will be supported with v1.2.X upgrades.

==== 1.2.4 ====
Removed 2.3 compatibility due to problems with PHP 7.0 and M2.2.6 and the CsrfValidation in M2.3

==== 1.2.3 ====
Renamed PayPal-Plus to PayPal PLUS

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{"type": "composer", "url": "https://repo.magento.com/"}
],
"require": {
"php": "~7.0.0|~7.1.0|~7.2.0",
"php": "~7.1.0|~7.2.0",
"paypal/rest-api-sdk-php": "^1.6",
"magento/module-paypal": "100.0.*|100.1.*|100.2.*|100.3.*"
"magento/module-paypal": "100.3.*"
},
"authors": [
{
Expand All @@ -19,7 +19,7 @@
}
],
"type": "magento2-module",
"version": "1.2.3",
"version": "1.3.0",
"license": [
"OSL-3.0"
],
Expand Down
6 changes: 3 additions & 3 deletions marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
{ "type": "composer", "url": "https://packagist.org" }
],
"require": {
"php": "~7.0.0|~7.1.0|~7.2.0",
"php": "~7.1.0|~7.2.0",
"paypal/rest-api-sdk-php": "^1.6",
"magento/module-paypal": "100.0.*|100.1.*|100.2.*|100.3.*"
"magento/module-paypal": "100.3.*"
},
"authors": [
{
Expand All @@ -18,7 +18,7 @@
}
],
"type": "magento2-module",
"version": "1.2.3",
"version": "1.3.0",
"license": [
"OSL-3.0"
],
Expand Down

0 comments on commit c1baa7f

Please sign in to comment.