Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-authorizenet
Model
Directpost
Response.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Authorizenet\Model\Directpost
;
7
8
use
Magento\Authorizenet\Model\Response
as
AuthorizenetResponse
;
9
use
Magento\Framework\Encryption\Helper\Security
;
10
14
class
Response
extends
AuthorizenetResponse
15
{
25
public
function
generateHash
($merchantMd5, $merchantApiLogin,
$amount
, $transactionId)
26
{
27
if
(!
$amount
) {
28
$amount
=
'0.00'
;
29
}
30
31
return
strtoupper(md5($merchantMd5 . $merchantApiLogin . $transactionId .
$amount
));
32
}
33
41
public
function
isValidHash
($merchantMd5, $merchantApiLogin)
42
{
43
$hash = $this->
generateHash
($merchantMd5, $merchantApiLogin, $this->getXAmount(), $this->getXTransId());
44
45
return
Security::compareStrings($hash, $this->
getData
(
'x_MD5_Hash'
));
46
}
47
53
public
function
isApproved
()
54
{
55
return
$this->getXResponseCode() ==
\Magento\Authorizenet\Model\Directpost::RESPONSE_CODE_APPROVED
;
56
}
57
}
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
Magento\Authorizenet\Model\Directpost\Response\isApproved
isApproved()
Definition:
Response.php:53
Magento\Framework\DataObject\getData
getData($key='', $index=null)
Definition:
DataObject.php:119
Magento\Authorizenet\Model\Directpost
Definition:
RequestTest.php:6
Magento\Authorizenet\Model\Response
Definition:
Factory.php:6
Magento\Authorizenet\Model\Directpost\Response\isValidHash
isValidHash($merchantMd5, $merchantApiLogin)
Definition:
Response.php:41
$amount
$amount
Definition:
order.php:14
Magento\Framework\Encryption\Helper\Security
Definition:
Security.php:17
Magento\Authorizenet\Model\Directpost\Response\generateHash
generateHash($merchantMd5, $merchantApiLogin, $amount, $transactionId)
Definition:
Response.php:25
Magento\Authorizenet\Model\Authorizenet\RESPONSE_CODE_APPROVED
const RESPONSE_CODE_APPROVED
Definition:
Authorizenet.php:39