Index: trunk/extensions/DonationInterface/extras/minfraud/minfraud.body.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | public function can_bypass_minfraud() { |
114 | 114 | // if the data bits data_hash and action are not set, we need to hit minFraud |
115 | 115 | $localdata = $this->gateway_adapter->getData_Raw(); |
116 | | - if ( !strlen( $localdata['data_hash'] ) || !strlen( $localdata['action'] ) ) { |
| 116 | + if ( !isset($localdata['data_hash']) || !strlen( $localdata['data_hash'] ) || !isset($localdata['action']) || !strlen( $localdata['action'] ) ) { |
117 | 117 | return FALSE; |
118 | 118 | } |
119 | 119 | |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
— | — | @@ -9,8 +9,13 @@ |
10 | 10 | |
11 | 11 | class GlobalCollectOrphanRectifier extends Maintenance { |
12 | 12 | function execute(){ |
| 13 | + |
| 14 | + $max_per_execute = 50; |
| 15 | + |
| 16 | + |
13 | 17 | |
14 | 18 | //load in and chunk the list of XML. Phase 1: From a file |
| 19 | + //MUST include contribution_tracking id! |
15 | 20 | |
16 | 21 | //for each chunk, load it into a GC adapter, and have it parse as if it were a response. |
17 | 22 | |
— | — | @@ -19,11 +24,21 @@ |
20 | 25 | //(Note: This should only work if we're sitting at one of the designated statuses) |
21 | 26 | |
22 | 27 | $data = array( |
23 | | - 'test' => 'something', |
24 | | - 'othertest' => 'otherthing' |
| 28 | + 'order_id' => '1052864192', |
| 29 | + 'i_order_id' => '1052864192', |
| 30 | + 'city' => '', |
| 31 | + 'state' => '', |
| 32 | + 'zip' => '', |
| 33 | + 'country' => 'US', |
| 34 | + 'email' => '', |
| 35 | + 'card_num' => '', |
| 36 | + |
25 | 37 | ); |
26 | 38 | |
| 39 | + //we may need to unset some hooks out here. Like... recaptcha. Makes no sense. |
27 | 40 | $adapter = new GlobalCollectAdapter(array('external_data' => $data)); |
| 41 | + error_log("\n\n\n"); |
| 42 | + $results = $adapter->do_transaction('Confirm_CreditCard'); |
28 | 43 | } |
29 | 44 | } |
30 | 45 | |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -1017,22 +1017,49 @@ |
1018 | 1018 | $addme[$ourkey] = $tmp; |
1019 | 1019 | } |
1020 | 1020 | } |
1021 | | - if ( count( $addme ) ){ |
| 1021 | + |
| 1022 | + $post_status_check = false; |
| 1023 | + if ( count( $addme ) ){ //nothing unusual here. |
1022 | 1024 | $this->addData( $addme ); |
| 1025 | + $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': '; |
| 1026 | + $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' ); |
| 1027 | + $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' ); |
| 1028 | + self::log( $logmsg ); |
| 1029 | + } else { //this is an orphan transaction. |
| 1030 | + $this->staged_data['order_id'] = $this->staged_data['i_order_id']; |
| 1031 | + $post_status_check = true; |
1023 | 1032 | } |
1024 | | - $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': '; |
1025 | | - $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' ); |
1026 | | - $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' ); |
1027 | | - self::log( $logmsg ); |
1028 | 1033 | |
1029 | 1034 | $status_result = $this->do_transaction( 'GET_ORDERSTATUS' ); |
1030 | 1035 | |
1031 | | - //error_log( "GET_ORDERSTATUS result: " . $status_result ); |
1032 | | - |
1033 | 1036 | $cancelflag = false; //this will denote the thing we're trying to do with the donation attempt |
1034 | 1037 | $problemflag = false; //this will get set to true, if we can't continue and need to give up and just log the hell out of it. |
1035 | 1038 | $problemmessage = ''; //to be used in conjunction with the flag. |
| 1039 | + |
1036 | 1040 | |
| 1041 | + if ( $post_status_check ){ |
| 1042 | + if ( array_key_exists('data', $status_result) ) { |
| 1043 | + foreach ( $pull_vars as $theirkey => $ourkey) { |
| 1044 | + if ( array_key_exists($theirkey, $status_result['data']) ) { |
| 1045 | + $addme[$ourkey] = $status_result['data'][$theirkey]; |
| 1046 | + } |
| 1047 | + } |
| 1048 | + } |
| 1049 | + |
| 1050 | + if ( count( $addme ) ){ |
| 1051 | + $this->addData( $addme ); |
| 1052 | + $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': '; |
| 1053 | + $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' ); |
| 1054 | + $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' ); |
| 1055 | + self::log( $logmsg ); |
| 1056 | + $this->runPreProcessHooks(); |
| 1057 | + $status_result['action'] = $this->getValidationAction(); |
| 1058 | + } else { |
| 1059 | + $problemflag = true; //nothing to be done. |
| 1060 | + $problemmessage = "Unable to retrieve orphan cvv/avs results (Communication problem?)."; |
| 1061 | + } |
| 1062 | + } |
| 1063 | + |
1037 | 1064 | //we filtered |
1038 | 1065 | if ( array_key_exists( 'action', $status_result ) && $status_result['action'] != 'process' ){ |
1039 | 1066 | $cancelflag = true; |
— | — | @@ -1055,7 +1082,11 @@ |
1056 | 1083 | case 'revised' : |
1057 | 1084 | $cancelflag = true; //makes sure we don't try to confirm. |
1058 | 1085 | break; |
1059 | | - } |
| 1086 | + case 'complete' : |
| 1087 | + $problemflag = true; //nothing to be done. |
| 1088 | + $problemmessage = "GET_ORDERSTATUS reports that the payment is already complete."; |
| 1089 | + break; |
| 1090 | + } |
1060 | 1091 | } |
1061 | 1092 | |
1062 | 1093 | //if we got here with no problemflag, |