Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js |
— | — | @@ -171,7 +171,9 @@ |
172 | 172 | if ( data.result.errors ) { |
173 | 173 | var errors = new Array(); |
174 | 174 | $.each( data.result.errors, function( index, value ) { |
175 | | - alert( 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 |
176 | 178 | } ); |
177 | 179 | } else { |
178 | 180 | if ( data.result.formaction ) { |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -499,7 +499,14 @@ |
500 | 500 | $message = $childnode->nodeValue; |
501 | 501 | } |
502 | 502 | } |
503 | | - $errors[$code] = $message; |
| 503 | + |
| 504 | + // If we have a localized version of the error message, output that |
| 505 | + if ( substr( wfMsg( 'globalcollect_gateway-response-'.$code ), 0, 4 ) === '<' ) { |
| 506 | + $errors[$code] = $message; |
| 507 | + } else { |
| 508 | + $errors[$code] = wfMsg( 'globalcollect_gateway-response-'.$code ); |
| 509 | + } |
| 510 | + |
504 | 511 | } |
505 | 512 | return $errors; |
506 | 513 | } |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.i18n.php |
— | — | @@ -12,6 +12,10 @@ |
13 | 13 | $messages['en'] = array( |
14 | 14 | 'globalcollectgateway' => 'Make your donation now', |
15 | 15 | 'globalcollect_gateway-desc' => 'GlobalCollect payment processing', |
| 16 | + 'globalcollect_gateway-response-9130' => 'Invalid country.', |
| 17 | + 'globalcollect_gateway-response-9140' => 'Invalid currency.', |
| 18 | + 'globalcollect_gateway-response-9150' => 'Invalid language.', |
| 19 | + 'globalcollect_gateway-response-400530' => 'Invalid payment method.', |
16 | 20 | 'globalcollect_gateway-response-default' => 'There was an error processing your transaction. |
17 | 21 | Please try again later.', |
18 | 22 | ); |
— | — | @@ -22,5 +26,9 @@ |
23 | 27 | $messages['qqq'] = array( |
24 | 28 | 'globalcollectgateway' => '{{Identical|Support Wikimedia}}', |
25 | 29 | 'globalcollect_gateway-desc' => '{{desc}}', |
| 30 | + 'globalcollect_gateway-response-9130' => 'Error message for invalid country.', |
| 31 | + 'globalcollect_gateway-response-9140' => 'Error message for invalid currency.', |
| 32 | + 'globalcollect_gateway-response-9150' => 'Error message for invalid language.', |
| 33 | + 'globalcollect_gateway-response-400530' => 'Error message for invalid payment method, for example, not a valid credit card type.', |
26 | 34 | 'globalcollect_gateway-response-default' => 'Error message if something went wrong on our side.', |
27 | 35 | ); |