Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -739,7 +739,14 @@ |
740 | 740 | */ |
741 | 741 | protected function stage_returnto( $type = 'request' ) { |
742 | 742 | if ( $type === 'request' ) { |
743 | | - $this->postdata['returnto'] = $this->postdata['returnto'] . '?' . wfArrayToCGI( array( 'order_id' => $this->postdata['order_id'] ) ); |
| 743 | + // Add order ID to the returnto URL, only if it's not already there. |
| 744 | + //TODO: This needs to be more robust (like actually pulling the |
| 745 | + //qstring keys, resetting the values, and putting it all back) |
| 746 | + //but for now it'll keep us alive. |
| 747 | + if ( !strpos( $this->postdata['returnto'], 'order_id' ) ){ |
| 748 | + $queryArray = array( 'order_id' => $this->postdata['order_id'] ); |
| 749 | + $this->postdata['returnto'] = wfAppendQuery( $this->postdata['returnto'], $queryArray ); |
| 750 | + } |
744 | 751 | } |
745 | 752 | } |
746 | 753 | |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -244,6 +244,29 @@ |
245 | 245 | unset( $this->normalized[$key] ); |
246 | 246 | } |
247 | 247 | } |
| 248 | + |
| 249 | + /** |
| 250 | + * Returns an array of all the fields that get re-calculated during a |
| 251 | + * normalizeAndSanitize. |
| 252 | + * This will most likely be used on the outside when in the process of |
| 253 | + * adding data. |
| 254 | + * @return array An array of values matching all recauculated fields. |
| 255 | + */ |
| 256 | + function getCalculatedFields() { |
| 257 | + $fields = array( |
| 258 | + 'utm_source', |
| 259 | + 'amount', |
| 260 | + 'order_id', |
| 261 | + 'i_order_id', |
| 262 | + 'gateway', |
| 263 | + 'optout', |
| 264 | + 'anonymous', |
| 265 | + 'language', |
| 266 | + 'contribution_tracking_id', //sort of... |
| 267 | + 'currency' |
| 268 | + ); |
| 269 | + return $fields; |
| 270 | + } |
248 | 271 | |
249 | 272 | function normalizeAndSanitize() { |
250 | 273 | if ( !empty( $this->normalized ) ) { |
— | — | @@ -254,11 +277,26 @@ |
255 | 278 | $this->setNormalizedOptOuts(); |
256 | 279 | $this->setLanguage(); |
257 | 280 | $this->handleContributionTrackingID(); |
| 281 | + $this->setCurrencyCode(); |
258 | 282 | array_walk( $this->normalized, array( $this, 'sanitizeInput' ) ); |
259 | 283 | } |
260 | 284 | } |
261 | 285 | |
262 | 286 | /** |
| 287 | + * normalizeAndSanitize helper function |
| 288 | + * Setting the currency code correctly. |
| 289 | + */ |
| 290 | + function setCurrencyCode() { |
| 291 | + global $wgRequest; |
| 292 | + if ( !$this->isSomething('currency') ){ |
| 293 | + $code = $wgRequest->getVal('currency', null); |
| 294 | + if (!is_null($code)){ |
| 295 | + $this->setVal('currency', $code); |
| 296 | + } |
| 297 | + } |
| 298 | + } |
| 299 | + |
| 300 | + /** |
263 | 301 | * normalizeAndSanitize helper function. |
264 | 302 | * Assures that if no contribution_tracking_id is present, a row is created |
265 | 303 | * in the Contribution tracking table, and that row is assigned to the |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface |
___________________________________________________________________ |
Modified: svn:mergeinfo |
266 | 304 | Merged /trunk/extensions/DonationInterface:r102011-102012 |