Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Payflow Class Reference
Inheritance diagram for Payflow:
Action AbstractAction ActionInterface Redirect CancelPayment Form ReturnUrl SilentPost CancelPayment Form ReturnUrl SilentPost

Public Member Functions

 __construct (\Magento\Framework\App\Action\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Paypal\Model\PayflowlinkFactory $payflowModelFactory, \Magento\Paypal\Helper\Checkout $checkoutHelper, \Psr\Log\LoggerInterface $logger, \Magento\Sales\Api\PaymentFailuresInterface $paymentFailures=null)
 
- Public Member Functions inherited from Action
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getActionFlag ()
 
- Public Member Functions inherited from AbstractAction
 __construct (Context $context)
 
 dispatch (RequestInterface $request)
 
 getRequest ()
 
 getResponse ()
 
- Public Member Functions inherited from ActionInterface
 execute ()
 

Protected Member Functions

 _cancelPayment ($errorMsg='')
 
- Protected Member Functions inherited from Action
 _forward ($action, $controller=null, $module=null, array $params=null)
 
 _redirect ($path, $arguments=[])
 

Protected Attributes

 $_checkoutSession
 
 $_orderFactory
 
 $_logger
 
 $_payflowModelFactory
 
 $_checkoutHelper
 
 $_redirectBlockName = 'payflow.link.iframe'
 
- Protected Attributes inherited from Action
 $_objectManager
 
 $_sessionNamespace
 
 $_eventManager
 
 $_actionFlag
 
 $_redirect
 
 $_view
 
 $_url
 
 $messageManager
 
- Protected Attributes inherited from AbstractAction
 $_request
 
 $_response
 
 $resultRedirectFactory
 
 $resultFactory
 

Additional Inherited Members

- Data Fields inherited from ActionInterface
const FLAG_NO_DISPATCH = 'no-dispatch'
 
const FLAG_NO_POST_DISPATCH = 'no-postDispatch'
 
const FLAG_NO_DISPATCH_BLOCK_EVENT = 'no-beforeGenerateLayoutBlocksDispatch'
 
const PARAM_NAME_BASE64_URL = 'r64'
 
const PARAM_NAME_URL_ENCODED = 'uenc'
 

Detailed Description

Payflow Checkout Controller

Definition at line 11 of file Payflow.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Action\Context  $context,
\Magento\Checkout\Model\Session  $checkoutSession,
\Magento\Sales\Model\OrderFactory  $orderFactory,
\Magento\Paypal\Model\PayflowlinkFactory  $payflowModelFactory,
\Magento\Paypal\Helper\Checkout  $checkoutHelper,
\Psr\Log\LoggerInterface  $logger,
\Magento\Sales\Api\PaymentFailuresInterface  $paymentFailures = null 
)
Parameters
\Magento\Framework\App\Action\Context$context
\Magento\Checkout\Model\Session$checkoutSession
\Magento\Sales\Model\OrderFactory$orderFactory
\Magento\Paypal\Model\PayflowlinkFactory$payflowModelFactory
\Magento\Paypal\Helper\Checkout$checkoutHelper
\Psr\Log\LoggerInterface$logger
\Magento\Sales\Api\PaymentFailuresInterface | null$paymentFailures

Definition at line 58 of file Payflow.php.

66  {
67  parent::__construct($context);
68 
69  $this->_checkoutSession = $checkoutSession;
70  $this->_orderFactory = $orderFactory;
71  $this->_logger = $logger;
72  $this->_payflowModelFactory = $payflowModelFactory;
73  $this->_checkoutHelper = $checkoutHelper;
74  $this->paymentFailures = $paymentFailures ?: $this->_objectManager->get(
75  \Magento\Sales\Api\PaymentFailuresInterface::class
76  );
77  }
$logger

Member Function Documentation

◆ _cancelPayment()

_cancelPayment (   $errorMsg = '')
protected

Cancel order, return quote to customer

Parameters
string$errorMsg
Returns
false|string

Definition at line 85 of file Payflow.php.

86  {
87  $errorMsg = trim(strip_tags($errorMsg));
88  $order = $this->_checkoutSession->getLastRealOrder();
89  if ($order->getId()) {
90  $this->paymentFailures->handle((int)$order->getQuoteId(), $errorMsg);
91  }
92 
93  $gotoSection = false;
94  $this->_checkoutHelper->cancelCurrentOrder($errorMsg);
95  if ($this->_checkoutSession->restoreQuote()) {
96  //Redirect to payment step
97  $gotoSection = 'paymentMethod';
98  }
99 
100  return $gotoSection;
101  }
$order
Definition: order.php:55

Field Documentation

◆ $_checkoutHelper

$_checkoutHelper
protected

Definition at line 36 of file Payflow.php.

◆ $_checkoutSession

$_checkoutSession
protected

Definition at line 16 of file Payflow.php.

◆ $_logger

$_logger
protected

Definition at line 26 of file Payflow.php.

◆ $_orderFactory

$_orderFactory
protected

Definition at line 21 of file Payflow.php.

◆ $_payflowModelFactory

$_payflowModelFactory
protected

Definition at line 31 of file Payflow.php.

◆ $_redirectBlockName

$_redirectBlockName = 'payflow.link.iframe'
protected

Definition at line 42 of file Payflow.php.


The documentation for this class was generated from the following file: