r105643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105642‎ | r105643 | r105644 >
Date:02:54, 9 December 2011
Author:khorn
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/activemq_stomp/activemq_stomp.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
@@ -6,7 +6,7 @@
77
88 $IP = getenv( 'MW_INSTALL_PATH' );
99 if ( $IP === false ) {
10 - $IP = dirname( _FILE_ ) . '/../..';
 10+ $IP = dirname( _FILE_ ) . '/../../../..';
1111 }
1212
1313 //If you get errors on this next line, set (and export) your MW_INSTALL_PATH var.
@@ -62,21 +62,23 @@
6363 $this->handleStompAntiMessages();
6464 $this->adapter->log( 'Removed ' . $this->removed_message_count . ' messages and antimessages.' );
6565
66 - //Pull a batch of CC orphans, keeping in mind that Things May Have Happened in the small slice of time since we handled the antimessages.
67 - $orphans = $this->getStompOrphans();
68 - while ( count( $orphans ) && $this->keepGoing() ){
69 - //..do stuff.
70 - foreach ( $orphans as $correlation_id => $orphan ) {
71 - //process
72 - if ( $this->rectifyOrphan( $orphan ) ){
73 - $this->addStompCorrelationIDToAckBucket( $correlation_id );
74 - $this->handled_ids[$correlation_id] = 'rectified';
75 - } else {
76 - $this->handled_ids[$correlation_id] = 'error';
 66+ if ( $this->keepGoing() ){
 67+ //Pull a batch of CC orphans, keeping in mind that Things May Have Happened in the small slice of time since we handled the antimessages.
 68+ $orphans = $this->getStompOrphans();
 69+ while ( count( $orphans ) && $this->keepGoing() ){
 70+ //..do stuff.
 71+ foreach ( $orphans as $correlation_id => $orphan ) {
 72+ //process
 73+ if ( $this->rectifyOrphan( $orphan ) ){
 74+ $this->addStompCorrelationIDToAckBucket( $correlation_id );
 75+ $this->handled_ids[$correlation_id] = 'rectified';
 76+ } else {
 77+ $this->handled_ids[$correlation_id] = 'error';
 78+ }
7779 }
 80+ $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding.
 81+ $orphans = $this->getStompOrphans();
7882 }
79 - $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding.
80 - $orphans = $this->getStompOrphans();
8183 }
8284
8385 $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding.
@@ -159,6 +161,7 @@
160162 echo 'The STOMP message ' . $message->headers['message-id'] . " has no correlation ID!\n";
161163 }
162164 }
 165+ $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding.
163166 $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 );
164167 }
165168 $this->addStompCorrelationIDToAckBucket( false, true ); //this just acks everything that's waiting for it.
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
___________________________________________________________________
Modified: svn:mergeinfo
166169 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php:r105640
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -1134,23 +1134,17 @@
11351135 if ( $is_orphan ){
11361136 //save stats.
11371137 if (!isset($this->orphanstats) || !isset( $this->orphanstats[$original_status_code] ) ){
1138 - $this->orphanstats[$original_status_code] = 0;
 1138+ $this->orphanstats[$original_status_code] = 1;
11391139 } else {
11401140 $this->orphanstats[$original_status_code] += 1;
1141 - }
1142 -
1143 - if ( $original_status_code > 70 && !$gotCVV ){
1144 - $problemflag = true;
1145 - $problemmessage = "Unable to retrieve orphan cvv/avs results (Communication problem?).";
1146 - }
1147 -
 1141+ }
11481142 }
11491143 if (!$order_status_results){
11501144 $problemflag = true;
11511145 $problemmessage = "We don't have a Transaction WMF Status after doing a GET_ORDERSTATUS.";
11521146 }
11531147 switch ( $order_status_results ){
1154 - case 'failed' :
 1148+ case 'failed' :
11551149 case 'revised' :
11561150 $add_antimessage = true;
11571151 $cancelflag = true; //makes sure we don't try to confirm.
@@ -1160,6 +1154,11 @@
11611155 $problemmessage = "GET_ORDERSTATUS reports that the payment is already complete.";
11621156 $add_antimessage = true;
11631157 break;
 1158+ case 'pending' :
 1159+ if ( $is_orphan && !$gotCVV ){
 1160+ $problemflag = true;
 1161+ $problemmessage = "Unable to retrieve orphan cvv/avs results (Communication problem?).";
 1162+ }
11641163 }
11651164 }
11661165
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
___________________________________________________________________
Modified: svn:mergeinfo
11671166 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r105640
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/activemq_stomp/activemq_stomp.php
@@ -230,7 +230,9 @@
231231 'fee' => '0',
232232 'gross' => $transaction['amount'],
233233 'net' => $transaction['amount'],
234 - 'date' => $transaction['date'],
 234+ //the following int casting fixes an issue that is more in Drupal/CiviCRM than here.
 235+ //The code there should also be fixed.
 236+ 'date' => ( int ) $transaction['date'],
235237 );
236238
237239 return $message;
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/activemq_stomp/activemq_stomp.php
___________________________________________________________________
Modified: svn:mergeinfo
238240 Merged /trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php:r105640,105642

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105640More command line orphan stomp maintenance tweaks.khorn02:20, 9 December 2011
r105642Adding an important comment. followup r105640khorn02:28, 9 December 2011

Status & tagging log