allow possibility for payment module to return a response
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
namespace Thelia\Core\Event\Order;
|
||||
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Core\HttpFoundation\Response;
|
||||
use Thelia\Model\Order;
|
||||
|
||||
class OrderEvent extends ActionEvent
|
||||
@@ -39,6 +40,11 @@ class OrderEvent extends ActionEvent
|
||||
protected $status = null;
|
||||
protected $deliveryRef = null;
|
||||
|
||||
/**
|
||||
* @var Response
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* @param Order $order
|
||||
*/
|
||||
@@ -206,4 +212,28 @@ class OrderEvent extends ActionEvent
|
||||
{
|
||||
return $this->deliveryRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Response $response
|
||||
* @return $this
|
||||
*/
|
||||
public function setResponse(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function hasResponse()
|
||||
{
|
||||
return null !== $this->response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
namespace Thelia\Core\Event\Order;
|
||||
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Core\HttpFoundation\Response;
|
||||
use Thelia\Model\Order;
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,11 @@ class OrderPaymentEvent extends ActionEvent
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
/**
|
||||
* @var \Thelia\Core\HttpFoundation\Response
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
public function __construct(Order $order) {
|
||||
$this->order = $order;
|
||||
}
|
||||
@@ -49,4 +55,29 @@ class OrderPaymentEvent extends ActionEvent
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Thelia\Core\HttpFoundation\Response $response
|
||||
*/
|
||||
public function setResponse(Response $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Thelia\Core\HttpFoundation\Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function hasResponse()
|
||||
{
|
||||
return null !== $this->response;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -253,26 +253,6 @@ class Session extends BaseSession
|
||||
return $this->get("thelia.order");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Order $order
|
||||
* @return $this
|
||||
*/
|
||||
public function setProcessedOrder(Order $order)
|
||||
{
|
||||
$this->set('thelia.order.processed', $order);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an order already processed, usefull for payment modules
|
||||
* @return Order
|
||||
*/
|
||||
public function getProcessedOrder()
|
||||
{
|
||||
return $this->get('thelia.order.processed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set consumed coupons by the Customer
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user