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-paypal
Model
Payflow
CvvEmsCodeMapper.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Model\Payflow
;
7
8
use
Magento\Payment\Api\PaymentVerificationInterface
;
9
use
Magento\Paypal\Model\Config
;
10
use
Magento\Paypal\Model\Info
;
11
use
Magento\Sales\Api\Data\OrderPaymentInterface
;
12
20
class
CvvEmsCodeMapper
implements
PaymentVerificationInterface
21
{
27
private
static
$notProvidedCode =
'P'
;
28
34
private
static
$cvvMap = [
35
'Y'
=>
'M'
,
36
'N'
=>
'N'
37
];
38
46
public
function
getCode
(
OrderPaymentInterface
$orderPayment)
47
{
48
if
($orderPayment->
getMethod
() !==
Config::METHOD_PAYFLOWPRO
) {
49
throw
new \InvalidArgumentException(
50
'The "'
. $orderPayment->
getMethod
() .
'" does not supported by Payflow CVV mapper.'
51
);
52
}
53
54
$additionalInfo = $orderPayment->
getAdditionalInformation
();
55
if
(empty($additionalInfo[
Info::PAYPAL_CVV2MATCH
])) {
56
return
self::$notProvidedCode;
57
}
58
59
$cvv = $additionalInfo[
Info::PAYPAL_CVV2MATCH
];
60
61
return
isset(self::$cvvMap[$cvv]) ? self::$cvvMap[$cvv] : self::$notProvidedCode;
62
}
63
}
Magento\Paypal\Model\Payflow\CvvEmsCodeMapper
Definition:
CvvEmsCodeMapper.php:20
Magento\Paypal\Model\Info\PAYPAL_CVV2MATCH
const PAYPAL_CVV2MATCH
Definition:
Info.php:259
Magento\Sales\Api\Data\OrderPaymentInterface
Definition:
OrderPaymentInterface.php:17
Magento\Payment\Api\PaymentVerificationInterface
Definition:
PaymentVerificationInterface.php:24
Magento\Paypal\Model\Config\METHOD_PAYFLOWPRO
const METHOD_PAYFLOWPRO
Definition:
Config.php:66
Magento\Paypal\Model\Info
Definition:
Info.php:16
Magento\Paypal\Model\Payflow\CvvEmsCodeMapper\getCode
getCode(OrderPaymentInterface $orderPayment)
Definition:
CvvEmsCodeMapper.php:46
Magento\Sales\Api\Data\OrderPaymentInterface\getMethod
getMethod()
Magento\Sales\Api\Data\OrderPaymentInterface\getAdditionalInformation
getAdditionalInformation()
Magento\Paypal\Model\Payflow
Magento\Paypal\Model\Config