jenkins-bot has submitted this change and it was merged.

Change subject: Fail on any unrecognized CVV return codes
......................................................................


Fail on any unrecognized CVV return codes

And log a warning.

Cherry-picked 3cd38258731873e5 to deployment and deleted tests.

Bug: T96393
Change-Id: I3a971a41ad00cc43873dc95471277ad651e45470
---
M globalcollect_gateway/globalcollect.adapter.php
M worldpay_gateway/worldpay.adapter.php
2 files changed, 13 insertions(+), 2 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index 74a8776..13dfb32 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -2381,13 +2381,19 @@
         * determine if we want to fail the transaction ourselves or not.
         */
        public function getCVVResult(){
-               if ( is_null( $this->getData_Unstaged_Escaped( 'cvv_result' ) ) 
){
+               $from_processor = $this->getData_Unstaged_Escaped( 'cvv_result' 
);
+               if ( is_null( $from_processor ) ){
                        return null;
                }
 
                $cvv_map = $this->getGlobal( 'CvvMap' );
 
-               $result = $cvv_map[$this->getData_Unstaged_Escaped( 
'cvv_result' )];
+               if ( !isset( $cvv_map[$from_processor] ) ) {
+                       $this->logger->warning( "Unrecognized cvv_result 
'$from_processor'" );
+                       return false;
+               }
+
+               $result = $cvv_map[$from_processor];
                return $result;
 
        }
diff --git a/worldpay_gateway/worldpay.adapter.php 
b/worldpay_gateway/worldpay.adapter.php
index db315d0..0aa87c8 100644
--- a/worldpay_gateway/worldpay.adapter.php
+++ b/worldpay_gateway/worldpay.adapter.php
@@ -1088,6 +1088,11 @@
 
                $cvv_map = $this->getGlobal( 'CvvMap' );
 
+               if ( !isset( $cvv_map[$cvv_result] ) ) {
+                       $this->logger->warning( "Unrecognized cvv_result 
'$cvv_result'" );
+                       return false;
+               }
+
                $result = $cvv_map[$cvv_result];
                return $result;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/204836
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a971a41ad00cc43873dc95471277ad651e45470
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to