Index: trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | |
8 | 8 | $IP = getenv( 'MW_INSTALL_PATH' ); |
9 | 9 | if ( $IP === false ) { |
10 | | - $IP = dirname( _FILE_ ) . '/../..'; |
| 10 | + $IP = dirname( _FILE_ ) . '/../../../..'; |
11 | 11 | } |
12 | 12 | |
13 | 13 | //If you get errors on this next line, set (and export) your MW_INSTALL_PATH var. |
— | — | @@ -62,21 +62,23 @@ |
63 | 63 | $this->handleStompAntiMessages(); |
64 | 64 | $this->adapter->log( 'Removed ' . $this->removed_message_count . ' messages and antimessages.' ); |
65 | 65 | |
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 | + } |
77 | 79 | } |
| 80 | + $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding. |
| 81 | + $orphans = $this->getStompOrphans(); |
78 | 82 | } |
79 | | - $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding. |
80 | | - $orphans = $this->getStompOrphans(); |
81 | 83 | } |
82 | 84 | |
83 | 85 | $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding. |
— | — | @@ -159,6 +161,7 @@ |
160 | 162 | echo 'The STOMP message ' . $message->headers['message-id'] . " has no correlation ID!\n"; |
161 | 163 | } |
162 | 164 | } |
| 165 | + $this->addStompCorrelationIDToAckBucket( false, true ); //ack all outstanding. |
163 | 166 | $antimessages = stompFetchMessages( 'cc-limbo', $selector, 1000 ); |
164 | 167 | } |
165 | 168 | $this->addStompCorrelationIDToAckBucket( false, true ); //this just acks everything that's waiting for it. |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -1153,23 +1153,17 @@ |
1154 | 1154 | if ( $is_orphan ){ |
1155 | 1155 | //save stats. |
1156 | 1156 | if (!isset($this->orphanstats) || !isset( $this->orphanstats[$original_status_code] ) ){ |
1157 | | - $this->orphanstats[$original_status_code] = 0; |
| 1157 | + $this->orphanstats[$original_status_code] = 1; |
1158 | 1158 | } else { |
1159 | 1159 | $this->orphanstats[$original_status_code] += 1; |
1160 | | - } |
1161 | | - |
1162 | | - if ( $original_status_code > 70 && !$gotCVV ){ |
1163 | | - $problemflag = true; |
1164 | | - $problemmessage = "Unable to retrieve orphan cvv/avs results (Communication problem?)."; |
1165 | | - } |
1166 | | - |
| 1160 | + } |
1167 | 1161 | } |
1168 | 1162 | if (!$order_status_results){ |
1169 | 1163 | $problemflag = true; |
1170 | 1164 | $problemmessage = "We don't have a Transaction WMF Status after doing a GET_ORDERSTATUS."; |
1171 | 1165 | } |
1172 | 1166 | switch ( $order_status_results ){ |
1173 | | - case 'failed' : |
| 1167 | + case 'failed' : |
1174 | 1168 | case 'revised' : |
1175 | 1169 | $add_antimessage = true; |
1176 | 1170 | $cancelflag = true; //makes sure we don't try to confirm. |
— | — | @@ -1179,6 +1173,11 @@ |
1180 | 1174 | $problemmessage = "GET_ORDERSTATUS reports that the payment is already complete."; |
1181 | 1175 | $add_antimessage = true; |
1182 | 1176 | break; |
| 1177 | + case 'pending' : |
| 1178 | + if ( $is_orphan && !$gotCVV ){ |
| 1179 | + $problemflag = true; |
| 1180 | + $problemmessage = "Unable to retrieve orphan cvv/avs results (Communication problem?)."; |
| 1181 | + } |
1183 | 1182 | } |
1184 | 1183 | } |
1185 | 1184 | |
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | 'fee' => '0', |
232 | 232 | 'gross' => $transaction['amount'], |
233 | 233 | 'net' => $transaction['amount'], |
234 | | - 'date' => $transaction['date'], |
| 234 | + 'date' => ( int ) $transaction['date'], |
235 | 235 | ); |
236 | 236 | |
237 | 237 | return $message; |