Skip to content

Commit b22eb3c

Browse files
committed
MAGETWO-63910: Create infrastructure for mapper in Payment module
- Refactored code according to code review.
1 parent d4223c5 commit b22eb3c

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

app/code/Magento/Braintree/Model/AvsPaymentVerification.php renamed to app/code/Magento/Braintree/Model/AvsEmsCodeMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @see https://developers.braintreepayments.com/reference/response/transaction
1717
* @see http://www.emsecommerce.net/avs_cvv2_response_codes.htm
1818
*/
19-
class AvsPaymentVerification implements PaymentVerificationInterface
19+
class AvsEmsCodeMapper implements PaymentVerificationInterface
2020
{
2121
/**
2222
* List of mapping AVS codes

app/code/Magento/Braintree/Model/CvvPaymentVerification.php renamed to app/code/Magento/Braintree/Model/CvvEmsMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @see https://developers.braintreepayments.com/reference/response/transaction
1717
* @see http://www.emsecommerce.net/avs_cvv2_response_codes.htm
1818
*/
19-
class CvvPaymentVerification implements PaymentVerificationInterface
19+
class CvvEmsMapper implements PaymentVerificationInterface
2020
{
2121
/**
2222
* List of mapping CVV codes

app/code/Magento/Braintree/etc/config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<masked_fields>cvv,number</masked_fields>
4141
<privateInfoKeys>avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</privateInfoKeys>
4242
<paymentInfoKeys>cc_type,cc_number,avsPostalCodeResponseCode,avsStreetAddressResponseCode,cvvResponseCode,processorAuthorizationCode,processorResponseCode,processorResponseText,liabilityShifted,liabilityShiftPossible,riskDataId,riskDataDecision</paymentInfoKeys>
43-
<avs_ems_adapter>Magento\Braintree\Model\AvsPaymentVerification</avs_ems_adapter>
44-
<cvv_ems_adapter>Magento\Braintree\Model\CvvPaymentVerification</cvv_ems_adapter>
43+
<avs_ems_adapter>Magento\Braintree\Model\AvsEmsCodeMapper</avs_ems_adapter>
44+
<cvv_ems_adapter>Magento\Braintree\Model\CvvEmsMapper</cvv_ems_adapter>
4545
</braintree>
4646
<braintree_paypal>
4747
<model>BraintreePayPalFacade</model>

app/code/Magento/Payment/Api/PaymentVerificationInterface.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,21 @@
1010
/**
1111
* Payment provider codes verification interface.
1212
*
13+
* Custom payment methods might implement this interface to provide
14+
* specific mapping for payment methods, like AVS or CVV verification.
15+
* The payment methods can map payment method info from internal sources,
16+
* like additional information, to specific international codes.
17+
*
1318
* @api
1419
*/
1520
interface PaymentVerificationInterface
1621
{
1722
/**
1823
* Gets payment provider verification code.
19-
* Returns null if payment method does not support verification.
24+
* Returns null if verification cannot be obtained by payment method.
2025
*
21-
* @return string|null
26+
* @param OrderPaymentInterface $orderPayment
27+
* @return string
2228
*/
2329
public function getCode(OrderPaymentInterface $orderPayment);
2430
}

0 commit comments

Comments
 (0)