Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -80,6 +80,7 @@ |
81 | 81 | if ( $this->adapter->action == 'process' ) { |
82 | 82 | $this->fnPayflowDisplayResults( $result ); |
83 | 83 | } |
| 84 | + $this->displayResultsForDebug( $result ); |
84 | 85 | } |
85 | 86 | } else { |
86 | 87 | // Display form for the first time |
— | — | @@ -117,25 +118,31 @@ |
118 | 119 | |
119 | 120 | // if approved, display results and send transaction to the queue |
120 | 121 | if ( $errorCode == '1' ) { |
121 | | - self::log( $oid . " " . $i_oid . " Transaction approved.", LOG_DEBUG ); |
122 | | - $this->fnPayflowDisplayApprovedResults( $data, $responseArray, $responseMsg ); |
| 122 | + $this->log( $oid . " " . $i_oid . " Transaction approved.", LOG_DEBUG ); |
| 123 | + $this->fnPayflowDisplayApprovedResults( $data, $responseMsg ); |
123 | 124 | // give user a second chance to enter incorrect data |
124 | 125 | } elseif ( ( $errorCode == '3' ) && ( $data['numAttempt'] < '5' ) ) { |
125 | | - self::log( $oid . " " . $i_oid . " Transaction unsuccessful (invalid info).", LOG_DEBUG ); |
| 126 | + $this->log( $oid . " " . $i_oid . " Transaction unsuccessful (invalid info).", LOG_DEBUG ); |
126 | 127 | // pass responseMsg as an array key as required by displayForm |
127 | 128 | $this->errors['retryMsg'] = $responseMsg; |
128 | 129 | $this->fnPayflowDisplayForm( $data, $this->errors ); |
129 | 130 | // if declined or if user has already made two attempts, decline |
130 | 131 | } elseif ( ( $errorCode == '2' ) || ( $data['numAttempt'] >= '3' ) ) { |
131 | | - self::log( $oid . " " . $i_oid . " Transaction declined.", LOG_DEBUG ); |
| 132 | + $this->log( $oid . " " . $i_oid . " Transaction declined.", LOG_DEBUG ); |
132 | 133 | $this->fnPayflowDisplayDeclinedResults( $responseMsg ); |
133 | 134 | } elseif ( ( $errorCode == '4' ) ) { |
134 | | - self::log( $oid . " " . $i_oid . " Transaction unsuccessful.", LOG_DEBUG ); |
| 135 | + $this->log( $oid . " " . $i_oid . " Transaction unsuccessful.", LOG_DEBUG ); |
135 | 136 | $this->fnPayflowDisplayOtherResults( $responseMsg ); |
136 | 137 | } elseif ( ( $errorCode == '5' ) ) { |
137 | | - self::log( $oid . " " . $i_oid . " Transaction pending.", LOG_DEBUG ); |
138 | | - $this->fnPayflowDisplayPending( $data, $responseArray, $responseMsg ); |
| 138 | + $this->log( $oid . " " . $i_oid . " Transaction pending.", LOG_DEBUG ); |
| 139 | + $this->fnPayflowDisplayPending( $data, $responseMsg ); |
| 140 | + } elseif ( ( $errorCode == '1000000' ) ) { //TODO: This is temporary until we can decide on the actual error codes WE control. |
| 141 | + $this->log( $oid . " " . $i_oid . " Transaction unsuccessful (communication failure).", LOG_DEBUG ); |
| 142 | + $this->fnPayflowDisplayOtherResults( $responseMsg ); |
| 143 | + $this->errors['retryMsg'] = $responseMsg; |
| 144 | + $this->fnPayflowDisplayForm( $data, $this->errors ); |
139 | 145 | } |
| 146 | + $this->displayResultsForDebug( $result ); |
140 | 147 | } |
141 | 148 | |
142 | 149 | /** |
— | — | @@ -144,19 +151,9 @@ |
145 | 152 | * @param $data Array: array of posted data from form |
146 | 153 | * @param $responseMsg String: message supplied by getResults function |
147 | 154 | */ |
148 | | - function fnPayflowDisplayApprovedResults( $data, $responseArray, $responseMsg ) { |
| 155 | + function fnPayflowDisplayApprovedResults( $data, $responseMsg ) { |
149 | 156 | global $wgOut, $wgExternalThankYouPage; |
150 | 157 | |
151 | | - $transaction = $this->prepareStompTransaction( $data, $responseArray, $responseMsg ); |
152 | | - |
153 | | - /** |
154 | | - * hook to call stomp functions |
155 | | - * |
156 | | - * Sends transaction to Stomp-based queueing service, |
157 | | - * eg ActiveMQ |
158 | | - */ |
159 | | - wfRunHooks( 'gwStomp', array( $transaction ) ); |
160 | | - |
161 | 158 | if ( $wgExternalThankYouPage ) { |
162 | 159 | $wgOut->redirect( $wgExternalThankYouPage . "/" . $data['language'] ); |
163 | 160 | } else { |
— | — | @@ -200,23 +197,14 @@ |
201 | 198 | * @param $responseMsg String: message supplied by getResults function |
202 | 199 | */ |
203 | 200 | function fnPayflowDisplayOtherResults( $responseMsg ) { |
204 | | - global $wgOut; |
205 | | - |
206 | | - // general decline message |
207 | | - $declinedDefault = wfMsg( 'php-response-declined' ); |
208 | | - |
209 | | - // display response message |
210 | | - $wgOut->addHTML( '<h3 class="response_message">' . $declinedDefault . ' ' . $responseMsg . '</h3>' ); |
| 201 | + //I have collapsed it like this because the contents were identical. |
| 202 | + //TODO: Determine if we need to be switching on anything else in the display here. |
| 203 | + $this->fnPayflowDisplayDeclinedResults( $responseMsg ); |
211 | 204 | } |
212 | 205 | |
213 | | - function fnPayflowDisplayPending( $data, $responseArray, $responseMsg ) { |
| 206 | + function fnPayflowDisplayPending( $responseMsg ) { |
214 | 207 | global $wgOut; |
215 | 208 | |
216 | | - $transaction = $this->prepareStompTransaction( $data, $responseArray, $responseMsg ); |
217 | | - |
218 | | - // hook to call stomp functions |
219 | | - wfRunHooks( 'gwPendingStomp', array( $transaction ) ); |
220 | | - |
221 | 209 | $thankyou = wfMsg( 'payflowpro_gateway-thankyou' ); |
222 | 210 | |
223 | 211 | // display response message |
Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -32,15 +32,15 @@ |
33 | 33 | |
34 | 34 | |
35 | 35 | // set defaults, these should be assigned in LocalSettings.php |
36 | | -$wgPayflowProURL = 'https://payflowpro.paypal.com'; |
37 | | -$wgPayflowProTestingURL = 'https://pilot-payflowpro.paypal.com'; // Payflow testing URL |
| 36 | +$wgPayflowProGatewayURL = 'https://payflowpro.paypal.com'; |
| 37 | +$wgPayflowProGatewayTestingURL = 'https://pilot-payflowpro.paypal.com'; // Payflow testing URL |
38 | 38 | |
39 | 39 | $wgPayFlowProGatewayCSSVersion = 1; |
40 | 40 | |
41 | | -$wgPayflowProPartnerID = ''; // PayPal or original authorized reseller |
42 | | -$wgPayflowProVendorID = ''; // paypal merchant login ID |
43 | | -$wgPayflowProUserID = ''; // if one or more users are set up, authorized user ID, else same as VENDOR |
44 | | -$wgPayflowProPassword = ''; // merchant login password |
| 41 | +$wgPayflowProGatewayPartnerID = ''; // PayPal or original authorized reseller |
| 42 | +$wgPayflowProGatewayVendorID = ''; // paypal merchant login ID |
| 43 | +$wgPayflowProGatewayUserID = ''; // if one or more users are set up, authorized user ID, else same as VENDOR |
| 44 | +$wgPayflowProGatewayPassword = ''; // merchant login password |
45 | 45 | // a boolean to determine if we're in testing mode |
46 | 46 | $wgPayflowProGatewayTest = FALSE; |
47 | 47 | |
Index: branches/fundraising/extensions/DonationInterface/extras/minfraud/ccfd/HTTPBase.php |
— | — | @@ -158,6 +158,9 @@ |
159 | 159 | $datetime = fgets( $fh, 1024 ); |
160 | 160 | $datetime = rtrim( $datetime ); |
161 | 161 | fclose( $fh ); |
| 162 | + } else { |
| 163 | + //otherwise, this thing complains loudly when the file doesn't exist. |
| 164 | + $datetime = time(); |
162 | 165 | } |
163 | 166 | |
164 | 167 | // if the ip addresses expired or don't exist then |
Index: branches/fundraising/extensions/DonationInterface/extras/minfraud/minfraud.body.php |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | } |
272 | 272 | |
273 | 273 | static function onValidate( &$gateway_adapter ) { |
274 | | - $gateway_adapter->debugarray[] = "Running an onValidate hook!"; |
| 274 | + $gateway_adapter->debugarray[] = "minfraud onValidate hook!"; |
275 | 275 | return self::singleton( $gateway_adapter )->validate(); |
276 | 276 | } |
277 | 277 | |
Index: branches/fundraising/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | public $recap_err; |
19 | 19 | |
20 | 20 | public function __construct( &$gateway_adapter ) { |
21 | | - parent::__construct( &$gateway_adapter ); |
| 21 | + parent::__construct( $gateway_adapter ); |
22 | 22 | |
23 | 23 | //stash all the vars that reCaptcha is going to need in a global just for it. |
24 | 24 | //I know this is vaguely unpleasant, but it's the quickest way back to zero. |
— | — | @@ -77,8 +77,12 @@ |
78 | 78 | $form_class = $this->gateway_adapter->getFormClass(); |
79 | 79 | |
80 | 80 | //hmm. Looking at this now, makes me want to say |
81 | | - //TODO: Refactor the Form Class constructors. Again. |
82 | | - $form_obj = new $form_class( $this->gateway_adapter->getData(), $this->gateway_adapter->getValidationErrors(), $this->gateway_adapter); |
| 81 | + //TODO: Refactor the Form Class constructors. Again. Because the next three lines of code anger me deeply. |
| 82 | + //#1 - all three things are clearly in the gateway adapter, and we're passing that already. |
| 83 | + //#2 - I have to stuff them in variables because Form wants parameters by reference. |
| 84 | + $data = $this->gateway_adapter->getData(); |
| 85 | + $erros = $this->gateway_adapter->getValidationErrors(); |
| 86 | + $form_obj = new $form_class( $data, $errors, $this->gateway_adapter ); |
83 | 87 | |
84 | 88 | // set the captcha HTML to use in the form |
85 | 89 | $form_obj->setCaptchaHTML( $captcha_html ); |
— | — | @@ -102,12 +106,12 @@ |
103 | 107 | } |
104 | 108 | |
105 | 109 | static function onChallenge( &$gateway_adapter ) { |
106 | | - return self::singleton( &$gateway_adapter )->challenge(); |
| 110 | + return self::singleton( $gateway_adapter )->challenge(); |
107 | 111 | } |
108 | 112 | |
109 | 113 | static function singleton( &$gateway_adapter ) { |
110 | 114 | if ( !self::$instance ) { |
111 | | - self::$instance = new self( &$gateway_adapter ); |
| 115 | + self::$instance = new self( $gateway_adapter ); |
112 | 116 | } |
113 | 117 | return self::$instance; |
114 | 118 | } |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | |
356 | 356 | // expose a hook for external handling of trxns ready for processing |
357 | 357 | wfRunHooks( 'GatewayProcess', array( &$this ) ); //don't think anybody is using this yet, but you could! |
358 | | - |
| 358 | + |
359 | 359 | $this->dataObj->updateContributionTracking( defined( 'OWA' ) ); |
360 | 360 | if ( $this->getCommunicationType() === 'xml' ) { |
361 | 361 | $this->getStopwatch( "buildRequestXML" ); |
— | — | @@ -365,7 +365,6 @@ |
366 | 366 | } |
367 | 367 | |
368 | 368 | if ( $this->getCommunicationType() === 'namevalue' ) { |
369 | | - $namevalue = $this->postdata; |
370 | 369 | //buildRequestNameValueString() |
371 | 370 | $this->getStopwatch( "buildRequestNameValueString" ); |
372 | 371 | $namevalstring = $this->buildRequestNameValueString(); |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $me = get_called_class(); |
45 | 45 | parent::__construct( $me ); |
46 | 46 | $this->errors = $this->getPossibleErrors(); |
| 47 | + $this->setFormClass(); |
47 | 48 | } |
48 | 49 | |
49 | 50 | /** |
— | — | @@ -406,7 +407,10 @@ |
407 | 408 | } |
408 | 409 | |
409 | 410 | function displayResultsForDebug( $results ) { |
410 | | - global $wgOut; |
| 411 | + global $wgOut, $wgDonationInterfaceDisplayDebug; |
| 412 | + if ( $wgDonationInterfaceDisplayDebug !== true ){ |
| 413 | + return; |
| 414 | + } |
411 | 415 | $wgOut->addHTML( $results['message'] ); |
412 | 416 | |
413 | 417 | if ( !empty( $results['errors'] ) ) { |
— | — | @@ -552,7 +556,7 @@ |
553 | 557 | return $usd_amount; |
554 | 558 | } |
555 | 559 | |
556 | | - public static function log( $msg, $log_level=LOG_INFO ) { |
| 560 | + public function log( $msg, $log_level=LOG_INFO ) { |
557 | 561 | $this->adapter->log( $msg, $log_level ); |
558 | 562 | } |
559 | 563 | |