XenoRyet has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350277 )

Change subject: WIP Ingenico server timeout fix
......................................................................

WIP Ingenico server timeout fix

Recognize the error code and just try again.

Bug: T157832
Change-Id: I4f496ca1655a09f0f6be4a405b0a8dbf93a4364b
---
M gateway_common/gateway.adapter.php
M globalcollect_gateway/globalcollect.adapter.php
2 files changed, 25 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/77/350277/1

diff --git a/gateway_common/gateway.adapter.php 
b/gateway_common/gateway.adapter.php
index c65e6f3..59c0633 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -920,18 +920,27 @@
                        $retval = $this->do_transaction_internal( $transaction, 
$retryVars );
 
                        if ( !empty( $retryVars ) ) {
-                               // TODO: Add more intelligence here. Right now 
we just assume it's the order_id
+                               // TODO: Add more intelligence here. Right now 
timeout is the only one specifically
+                               // handled, all other cases we just assume it's 
the order_id
                                // and that it is totally OK to just reset it 
and reroll.
+                               switch( $retryVars ) {
+                                       case 'timeout' :
+                                               // Just retry without changing 
anything.
+                                               $this->logger->info( "Repeating 
transaction for timeout" );
+                                               break;
 
-                               $this->logger->info( "Repeating transaction on 
request for vars: " . implode( ',', $retryVars ) );
+                                       default :
+                                               $this->logger->info( "Repeating 
transaction on request for vars: " . implode( ',', $retryVars ) );
 
-                               // Force regen of the order_id
-                               $this->regenerateOrderID();
+                                                       // Force regen of the 
order_id
+                                               $this->regenerateOrderID();
 
-                               // Pull anything changed from dataObj
-                               $this->unstaged_data = 
$this->dataObj->getDataEscaped();
-                               $this->staged_data = $this->unstaged_data;
-                               $this->stageData();
+                                                       // Pull anything 
changed from dataObj
+                                               $this->unstaged_data = 
$this->dataObj->getDataEscaped();
+                                               $this->staged_data = 
$this->unstaged_data;
+                                               $this->stageData();
+                                               break;
+                               }
                        }
 
                } while ( ( !empty( $retryVars ) ) && ( ++$retryCount < 
$loopCount ) );
diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index 3527c96..b253c79 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -1427,6 +1427,14 @@
                                        //say something painful here.
                                        $errMsg = 'Blocking validation problems 
with this payment. Investigation required! '
                                                                . "Original 
error: '$messageFromProcessor'.  Our data: " . $this->getLogDebugJSON();
+
+                               case 11000400 :  //Ingenico internal timeout, 
just try again as-is.
+                                       $retryVars[] = 'timeout';
+                                       $this->logger->error( 'Server Timeout, 
retrying.' );
+                                       $retErrCode = $errCode;
+                                       $retErrMsg = $errMsg;
+                                       break;
+
                                default:
                                        $this->logger->error( __FUNCTION__ . " 
Error $errCode : $errMsg" );
                                        break;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f496ca1655a09f0f6be4a405b0a8dbf93a4364b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: XenoRyet <dkozlow...@wikimedia.org>

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

Reply via email to