Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -57,7 +57,9 @@ |
58 | 58 | 'card_type' => $wgRequest->getText( 'card_type' ), |
59 | 59 | 'expiration' => $wgRequest->getText( 'mos' ) . substr( $wgRequest->getText( 'year' ), 2, 2 ), |
60 | 60 | 'cvv' => $wgRequest->getText( 'cvv' ), |
61 | | - 'currency' => $wgRequest->getVal( 'currency_code' ), |
| 61 | + //Leave both of these here. |
| 62 | + 'currency' => $wgRequest->getVal( 'currency' ), |
| 63 | + 'currency_code' => $wgRequest->getVal( 'currency_code' ), |
62 | 64 | 'payment_method' => $wgRequest->getText( 'payment_method', 'cc' ), |
63 | 65 | 'payment_submethod' => $wgRequest->getText( 'payment_submethod', null ), // Used by GlobalCollect for payment types |
64 | 66 | 'issuer_id' => $wgRequest->getText( 'issuer_id' ), |
— | — | @@ -312,12 +314,27 @@ |
313 | 315 | */ |
314 | 316 | function setCurrencyCode() { |
315 | 317 | global $wgRequest; |
316 | | - if ( !$this->isSomething('currency') ){ |
317 | | - $code = $wgRequest->getVal('currency', null); |
318 | | - if (!is_null($code)){ |
319 | | - $this->setVal('currency', $code); |
320 | | - } |
| 318 | + |
| 319 | + //at this point, we can have either currency, or currency_code. |
| 320 | + //-->>currency_code has the authority!<<-- |
| 321 | + $currency = false; |
| 322 | + |
| 323 | + if ( $this->isSomething( 'currency_code' ) ) { |
| 324 | + $currency = $this->getVal( 'currency_code' ); |
| 325 | + } elseif ( $this->isSomething( 'currency' ) ) { |
| 326 | + $currency = $this->getVal( 'currency' ); |
321 | 327 | } |
| 328 | + |
| 329 | + if ( $currency ){ |
| 330 | + //set them both. |
| 331 | + $this->setVal( 'currency_code', $currency ); |
| 332 | + $this->setVal( 'currency', $currency ); |
| 333 | + } else { |
| 334 | + //we want these unset if neither of them was anything, so things |
| 335 | + //using this data know to use their own defaults. |
| 336 | + $this->expunge( 'currency_code' ); |
| 337 | + $this->expunge( 'currency' ); |
| 338 | + } |
322 | 339 | } |
323 | 340 | |
324 | 341 | /** |