Skip to content

Commit

Permalink
m2.2 support (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkong87 authored Apr 27, 2021
1 parent c32eee1 commit c336cf4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Block/Payment/Cancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public function __construct(
) {
parent::__construct($context);
}
}
}
24 changes: 2 additions & 22 deletions Controller/Payment/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\Exception\LocalizedException;
use Magento\Checkout\Model\Session;
use Magento\Quote\Api\CartManagementInterface;
Expand All @@ -14,7 +11,7 @@
use Magento\Sales\Api\OrderManagementInterface as OrderManagement;
use Affirm\Telesales\Model\Adminhtml\Checkout as AffirmCheckout;

class Confirm extends Action implements CsrfAwareActionInterface
class Confirm extends Action
{
const CHECKOUT_STATUS_CONFIRMED = 'confirmed';
/**
Expand Down Expand Up @@ -42,24 +39,7 @@ public function __construct(
$this->logger = $logger;
}

/**
* @inheritDoc
*/
public function createCsrfValidationException(
RequestInterface $request
): ?InvalidRequestException {
return null;
}

/**
* @inheritDoc
*/
public function validateForCsrf(RequestInterface $request): ?bool
{
return true;
}

/**
/**
* @inheritDoc
*/
public function execute()
Expand Down
24 changes: 2 additions & 22 deletions Controller/Payment/Decline.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Checkout\Model\Session;
use Magento\Quote\Api\CartManagementInterface;
use Magento\Quote\Api\CartRepositoryInterface;
use Magento\Sales\Model\OrderFactory;
use Magento\Sales\Api\OrderManagementInterface as OrderManagement;
use Affirm\Telesales\Model\Adminhtml\Checkout as AffirmCheckout;

class Decline extends Action implements CsrfAwareActionInterface
class Decline extends Action
{
const CHECKOUT_STATUS_NOT_APPROVED = 'not_approved';
/**
Expand Down Expand Up @@ -41,24 +38,7 @@ public function __construct(
$this->logger = $logger;
}

/**
* @inheritDoc
*/
public function createCsrfValidationException(
RequestInterface $request
): ?InvalidRequestException {
return null;
}

/**
* @inheritDoc
*/
public function validateForCsrf(RequestInterface $request): ?bool
{
return true;
}

/**
/**
* @inheritDoc
*/
public function execute()
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "affirm/magento2-telesales",
"description": "Affirm Telesales extension for the Magento 2 https://www.affirm.com/",
"type": "magento2-module",
"version": "1.0.2",
"version": "1.0.3",
"license": [
"BSD-3-Clause"
],
Expand Down
4 changes: 2 additions & 2 deletions etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0.2"?>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Affirm_Telesales" setup_version="1.2.1">
<module name="Affirm_Telesales" setup_version="1.0.3">
<sequence>
<module name="Astound_Affirm"/>
<module name="Magento_Store"/>
Expand Down

0 comments on commit c336cf4

Please sign in to comment.