-
Notifications
You must be signed in to change notification settings - Fork 0
/
AuthBlock.php
54 lines (45 loc) · 1.3 KB
/
AuthBlock.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Cardinity\Magento\Block;
class AuthBlock extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\ObjectManagerInterface $objectManager,
array $data = []
) {
parent::__construct(
$context,
$data
);
$this->_urlBuilder = $context->getUrlBuilder();
$this->_objectManager = $objectManager;
}
public function getAuth3dsLevel()
{
if($this->_getAuthModel()->getThreeDSecureV2Needed() == true){
return "v2";
}elseif($this->_getAuthModel()->getThreeDSecureNeeded() == true){
return "v1";
}
}
public function getAuthUrl()
{
return $this->_getAuthModel()->getUrl();
}
public function getAuthData()
{
return $this->_getAuthModel()->getData();
}
public function getRealOrderId()
{
return $this->_getAuthModel()->getRealOrderId();
}
public function getCallbackUrl()
{
return $this->_urlBuilder->getUrl('cardinity/payment/callback', ['_secure' => true]);
}
private function _getAuthModel()
{
return $this->_objectManager->create('Cardinity\Magento\Model\AuthModel');
}
}