jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381918 )

Change subject: Fix missing order status
......................................................................


Fix missing order status

When GlobalCollect's processResponse message encounters an error,
it bails out before unstaging things, so getData..('gateway_status')
returns null.

Restores the old logic for the GlobalCollect adapter but still uses
the unstaged stuff for the Ingenico child adapter.

Bug: T176355
Change-Id: I2321827d6b8d7240f3a4f804dbd48f24b80c2b63
---
M globalcollect_gateway/globalcollect.adapter.php
M ingenico_gateway/ingenico.adapter.php
2 files changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index a117d60..7059d6e 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -668,7 +668,7 @@
 
                        $order_status_results = false;
                        if ( !$cancelflag && !$problemflag ) {
-                               $statusCode = $this->getData_Unstaged_Escaped( 
'gateway_status' );
+                               $statusCode = $this->getStatusCode( 
$this->getTransactionData() );
                                if ( $statusCode ) {
                                        if ( is_null( $original_status_code ) ) 
{
                                                $original_status_code = 
$statusCode;
@@ -1790,4 +1790,11 @@
        protected function approvePayment() {
                return $this->do_transaction( 'SET_PAYMENT' );
        }
+
+       protected function getStatusCode( $txnData ) {
+               if ( isset( $txnData['STATUSID'] ) ) {
+                       return $txnData['STATUSID'];
+               }
+               return null;
+       }
 }
diff --git a/ingenico_gateway/ingenico.adapter.php 
b/ingenico_gateway/ingenico.adapter.php
index f582548..ac1f792 100644
--- a/ingenico_gateway/ingenico.adapter.php
+++ b/ingenico_gateway/ingenico.adapter.php
@@ -268,4 +268,8 @@
        protected function approvePayment() {
                return $this->do_transaction( 'approvePayment' );
        }
+
+       protected function getStatusCode( $txnData ) {
+               return $this->getData_Unstaged_Escaped( 'gateway_status' );
+       }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2321827d6b8d7240f3a4f804dbd48f24b80c2b63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Mepps <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to