Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html |
— | — | @@ -177,6 +177,7 @@ |
178 | 178 | <legend>Payment</legend> |
179 | 179 | <div class="step-content"> |
180 | 180 | <div class="stuff"> |
| 181 | + <div id="card-errors"></div> |
181 | 182 | <table> |
182 | 183 | <tr> |
183 | 184 | <td class="label"> |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/lightbox1.css |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | } |
197 | 197 | .step-content { |
198 | 198 | padding: 20px; |
199 | | - height: 260px; |
| 199 | + height: 280px; |
200 | 200 | } |
201 | 201 | |
202 | 202 | #steps form fieldset{ |
— | — | @@ -285,4 +285,12 @@ |
286 | 286 | bottom: 25px; |
287 | 287 | right: 25px; |
288 | 288 | margin: 0 !important; |
| 289 | +} |
| 290 | +#steps #card-errors { |
| 291 | + font-size: 13px; |
| 292 | + line-height: 15px; |
| 293 | + color: #cc0000; |
| 294 | +} |
| 295 | +#steps #card-errors .error-msg { |
| 296 | + margin-bottom: 1em; |
289 | 297 | } |
\ No newline at end of file |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js |
— | — | @@ -109,6 +109,10 @@ |
110 | 110 | } |
111 | 111 | |
112 | 112 | function finalSubmit() { |
| 113 | + |
| 114 | + // Reset the error display |
| 115 | + $( '#card-errors' ).empty(); |
| 116 | + |
113 | 117 | var formErrors = false; |
114 | 118 | for( var i = 1; i <= fieldsetCount; ++i ) { |
115 | 119 | var error = validateStep(i); |
— | — | @@ -158,16 +162,18 @@ |
159 | 163 | 'url': mw.util.wikiScript( 'api' ), |
160 | 164 | 'data': sendData, |
161 | 165 | 'dataType': 'json', |
162 | | - 'type': 'GET', |
| 166 | + 'type': 'POST', |
163 | 167 | 'success': function( data ) { |
| 168 | + console.debug( data ); |
164 | 169 | if ( data.result.errors ) { |
165 | 170 | var errors = new Array(); |
166 | | - for( var key in data.result.errors ){ |
167 | | - errors.push( data.result.errors[key] ); |
| 171 | + $.each( data.result.errors, function( index, value ) { |
| 172 | + $( '#card-errors' ).append( '<div class="error-msg">'+value+'</div>' ); |
| 173 | + } ); |
| 174 | + } else { |
| 175 | + if ( data.result.returnurl ) { |
| 176 | + window.location = data.result.returnurl; |
168 | 177 | } |
169 | | - alert ( errors.join( '\r\n' ) ); |
170 | | - } else { |
171 | | - /* Load the thank you page */ |
172 | 178 | } |
173 | 179 | } |
174 | 180 | } ); |
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -49,12 +49,17 @@ |
50 | 50 | $outputResult = array(); |
51 | 51 | $outputResult['message'] = $result['message']; |
52 | 52 | $outputResult['status'] = $result['status']; |
53 | | - if ( array_key_exists( 'RETURNURL', $result['data']['PAYMENT'] ) ) { |
| 53 | + if ( array_key_exists( 'PAYMENT', $result['data'] ) |
| 54 | + && array_key_exists( 'RETURNURL', $result['data']['PAYMENT'] ) ) |
| 55 | + { |
54 | 56 | $outputResult['returnurl'] = $result['data']['PAYMENT']['RETURNURL']; |
55 | 57 | } |
56 | 58 | if ( array_key_exists( 'FORMACTION', $result['data'] ) ) { |
57 | 59 | $outputResult['formaction'] = $result['data']['FORMACTION']; |
58 | 60 | } |
| 61 | + if ( array_key_exists( 'RESPMSG', $result['data'] ) ) { |
| 62 | + $outputResult['responsemsg'] = $result['data']['RESPMSG']; |
| 63 | + } |
59 | 64 | if ( $result['errors'] ) { |
60 | 65 | $outputResult['errors'] = $result['errors']; |
61 | 66 | } |
— | — | @@ -111,7 +116,7 @@ |
112 | 117 | 'fname' => 'Tester', |
113 | 118 | 'mname' => 'T.', |
114 | 119 | 'lname' => 'Testington', |
115 | | - 'street' => '548 Market St.', |
| 120 | + 'street' => '549 Market St.', |
116 | 121 | 'city' => 'San Francisco', |
117 | 122 | 'state' => 'CA', |
118 | 123 | 'zip' => '94104', |