Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -1139,9 +1139,14 @@ |
1140 | 1140 | */ |
1141 | 1141 | protected function stage_returnto( $type = 'request' ) { |
1142 | 1142 | if ( $type === 'request' ) { |
1143 | | - // Add order ID to the returnto URL |
1144 | | - $queryArray = array( 'order_id' => $this->postdata['order_id'] ); |
1145 | | - $this->postdata['returnto'] = wfAppendQuery( $this->postdata['returnto'], $queryArray ); |
| 1143 | + // Add order ID to the returnto URL, only if it's not already there. |
| 1144 | + //TODO: This needs to be more robust (like actually pulling the |
| 1145 | + //qstring keys, resetting the values, and putting it all back) |
| 1146 | + //but for now it'll keep us alive. |
| 1147 | + if ( !strpos( $this->postdata['returnto'], 'order_id' ) ){ |
| 1148 | + $queryArray = array( 'order_id' => $this->postdata['order_id'] ); |
| 1149 | + $this->postdata['returnto'] = wfAppendQuery( $this->postdata['returnto'], $queryArray ); |
| 1150 | + } |
1146 | 1151 | } |
1147 | 1152 | } |
1148 | 1153 | |
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -32,6 +32,8 @@ |
33 | 33 | } |
34 | 34 | } else if ( $this->gateway == 'globalcollect' ) { |
35 | 35 | $gatewayObj = new GlobalCollectAdapter(); |
| 36 | + //I have NO IDEA how this worked before you were explicitly adding the data here. |
| 37 | + $gatewayObj->addData( $this->donationData ); |
36 | 38 | switch ( $method ) { |
37 | 39 | // TODO: add other payment methods |
38 | 40 | case 'cc': |
Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -262,7 +262,8 @@ |
263 | 263 | 'optout', |
264 | 264 | 'anonymous', |
265 | 265 | 'language', |
266 | | - 'contribution_tracking_id', //sort of... |
| 266 | + 'contribution_tracking_id', //sort of... |
| 267 | + 'currency' |
267 | 268 | ); |
268 | 269 | return $fields; |
269 | 270 | } |
— | — | @@ -280,11 +281,26 @@ |
281 | 282 | $this->setNormalizedOptOuts(); |
282 | 283 | $this->setLanguage(); |
283 | 284 | $this->handleContributionTrackingID(); |
| 285 | + $this->setCurrencyCode(); |
284 | 286 | array_walk( $this->normalized, array( $this, 'sanitizeInput' ) ); |
285 | 287 | } |
286 | 288 | } |
287 | 289 | |
288 | 290 | /** |
| 291 | + * normalizeAndSanitize helper function |
| 292 | + * Setting the currency code correctly. |
| 293 | + */ |
| 294 | + function setCurrencyCode() { |
| 295 | + global $wgRequest; |
| 296 | + if ( !$this->isSomething('currency') ){ |
| 297 | + $code = $wgRequest->getVal('currency', null); |
| 298 | + if (!is_null($code)){ |
| 299 | + $this->setVal('currency', $code); |
| 300 | + } |
| 301 | + } |
| 302 | + } |
| 303 | + |
| 304 | + /** |
289 | 305 | * normalizeAndSanitize helper function. |
290 | 306 | * Assures that if no contribution_tracking_id is present, a row is created |
291 | 307 | * in the Contribution tracking table, and that row is assigned to the |