Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | showStep3(); // Open the 3rd section |
142 | 142 | var language = 'en'; // default value is English |
143 | 143 | var matches = document.location.href.match(/uselang=(\w+)/i); // fine the real language |
144 | | - if ( matches[1] ) { |
| 144 | + if ( matches && matches[1] ) { |
145 | 145 | language = matches[1]; |
146 | 146 | } |
147 | 147 | var sendData = { |
— | — | @@ -162,26 +162,28 @@ |
163 | 163 | 'format': 'json' |
164 | 164 | }; |
165 | 165 | $.ajax( { |
166 | | - 'url': mw.util.wikiScript( 'api' ), |
| 166 | + 'url': mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?', |
167 | 167 | 'data': sendData, |
168 | 168 | 'dataType': 'json', |
169 | 169 | 'type': 'GET', |
170 | 170 | 'success': function( data ) { |
171 | | - if ( data.result.errors ) { |
172 | | - var errors = new Array(); |
173 | | - $.each( data.result.errors, function( index, value ) { |
174 | | - alert( value ); // Show them the error |
175 | | - $( "#paymentContinue" ).show(); // Show continue button in 2nd section |
176 | | - showStep2(); // Switch back to 2nd section of form |
177 | | - } ); |
178 | | - } else { |
179 | | - if ( data.result.formaction ) { |
180 | | - $( '#payment' ).empty(); |
181 | | - // Insert the iframe into the form |
182 | | - $( '#payment' ).append( |
183 | | - '<iframe src="'+data.result.formaction+'" width="318" height="300" frameborder="0"></iframe>' |
184 | | - ); |
185 | | - |
| 171 | + if ( typeof data.result !== 'undefined' ) { |
| 172 | + if ( data.result.errors ) { |
| 173 | + var errors = new Array(); |
| 174 | + $.each( data.result.errors, function( index, value ) { |
| 175 | + alert( value ); // Show them the error |
| 176 | + $( "#paymentContinue" ).show(); // Show continue button in 2nd section |
| 177 | + showStep2(); // Switch back to 2nd section of form |
| 178 | + } ); |
| 179 | + } else { |
| 180 | + if ( data.result.formaction ) { |
| 181 | + $( '#payment' ).empty(); |
| 182 | + // Insert the iframe into the form |
| 183 | + $( '#payment' ).append( |
| 184 | + '<iframe src="'+data.result.formaction+'" width="318" height="300" frameborder="0"></iframe>' |
| 185 | + ); |
| 186 | + |
| 187 | + } |
186 | 188 | } |
187 | 189 | } |
188 | 190 | } |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | } |
23 | 23 | |
24 | 24 | $method = $this->donationData['payment_method']; |
| 25 | + $submethod = $this->donationData['payment_submethod']; |
25 | 26 | |
26 | 27 | if ( $this->gateway == 'payflowpro' ) { |
27 | 28 | $gatewayObj = new PayflowProAdapter(); |
— | — | @@ -78,6 +79,10 @@ |
79 | 80 | $this->getResult()->addValue( 'data', 'result', $result ); |
80 | 81 | */ |
81 | 82 | } |
| 83 | + |
| 84 | + public function isReadMode() { |
| 85 | + return false; |
| 86 | + } |
82 | 87 | |
83 | 88 | public function getAllowedParams() { |
84 | 89 | return array( |
— | — | @@ -99,6 +104,7 @@ |
100 | 105 | 'expiration' => $this->defineParam( false ), |
101 | 106 | 'cvv' => $this->defineParam( false ), |
102 | 107 | 'payment_method' => $this->defineParam( false ), |
| 108 | + 'payment_submethod' => $this->defineParam( false ), |
103 | 109 | 'language' => $this->defineParam( false ), |
104 | 110 | 'order_id' => $this->defineParam( false ), |
105 | 111 | ); |
— | — | @@ -161,6 +167,7 @@ |
162 | 168 | 'expiration' => 'Expiration date', |
163 | 169 | 'cvv' => 'CVV security code', |
164 | 170 | 'payment_method' => 'Payment method to use', |
| 171 | + 'payment_submethod' => 'Payment submethod to use', |
165 | 172 | 'language' => 'Language code', |
166 | 173 | 'order_id' => 'Order ID (if a donation has already been started)', |
167 | 174 | ); |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -92,7 +92,13 @@ |
93 | 93 | $this->normalizeAndSanitize(); |
94 | 94 | |
95 | 95 | //TODO: test with _cache_ on. |
96 | | - if ( !empty( $this->normalized ) && ( $this->getVal( 'numAttempt' ) == '0' && ((!$this->getVal( 'utm_source_id' ) == false ) || is_null($this->getVal( '_cache_' )) ) ) ) { |
| 96 | +// if ( !empty( $this->normalized ) && |
| 97 | +// ( $this->getVal( 'numAttempt' ) == '0' && |
| 98 | +// ((!$this->getVal( 'utm_source_id' ) == false ) || |
| 99 | +// is_null($this->getVal( '_cache_' )) ) ) ) { |
| 100 | +// error_log('about to save contribution tracking from an initial populate: ' . $this->getVal('contribution_tracking_id')); |
| 101 | + |
| 102 | + if (!$this->isSomething( 'contribution_tracking_id' )){ |
97 | 103 | $this->saveContributionTracking(); |
98 | 104 | } |
99 | 105 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface |
___________________________________________________________________ |
Modified: svn:mergeinfo |
100 | 106 | Merged /trunk/extensions/DonationInterface:r101056,101071-101072,101099 |