Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -16,11 +16,17 @@ |
17 | 17 | * @param $par Mixed: parameter passed to the page or null |
18 | 18 | */ |
19 | 19 | public function execute( $par ) { |
20 | | - global $wgRequest, $wgOut, $wgUser, $wgScriptPath; |
| 20 | + global $wgRequest, $wgOut, $wgUser, $wgScriptPath, $wgPayFlowProGatewayCSSVersion; |
21 | 21 | |
22 | 22 | $this->setHeaders(); |
23 | 23 | |
24 | | - $wgOut->addHeadItem( 'validatescript', '<script type="text/javascript" language="javascript" src="' . $wgScriptPath . '/extensions/DonationInterface/payflowpro_gateway/validate_input.js"></script>' ); |
| 24 | + $wgOut->addHeadItem( 'validatescript', '<script type="text/javascript" language="javascript" src="' . |
| 25 | + $wgScriptPath . |
| 26 | + '/extensions/DonationInterface/payflowpro_gateway/validate_input.js"></script>' ); |
| 27 | + |
| 28 | + $wgOut->addExtensionStyle( |
| 29 | + "{$wgScriptPath}/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.css?" . |
| 30 | + $wgPayFlowProGatewayCSSVersion); |
25 | 31 | |
26 | 32 | $scriptVars = array( |
27 | 33 | 'payflowproGatewayErrorMsgJs' => wfMsg( 'payflowpro_gateway-error-msg-js' ), |
— | — | @@ -246,7 +252,6 @@ |
247 | 253 | $form = Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) ) . |
248 | 254 | Xml::openElement( 'div', array( 'id' => 'mw-creditcard-intro' ) ) . |
249 | 255 | Xml::tags( 'p', array( 'class' => 'mw-creditcard-intro-msg' ), wfMsg( 'payflowpro_gateway-form-message' ) ) . |
250 | | - Xml::tags( 'p', array( 'class' => 'mw-creditcard-intro-msg' ), wfMsg( 'payflowpro_gateway-form-message-2' ) ) . |
251 | 256 | Xml::closeElement( 'div' ); |
252 | 257 | |
253 | 258 | // open form |
— | — | @@ -254,12 +259,12 @@ |
255 | 260 | Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => '', 'onsubmit' => 'return validate_form(this)' ) ); |
256 | 261 | |
257 | 262 | // donor amount and name |
258 | | - $form .= Xml::openElement( 'table', array( 'id' => 'payflow_table' ) ). |
| 263 | + $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) ). |
259 | 264 | '<tr><td style="text-align:right;">' . |
260 | 265 | Xml::label(wfMsg( 'payflowpro_gateway-amount-legend' ), 'amount', array( 'maxlength' => '10' ) ) . |
261 | 266 | $endCell . |
262 | 267 | Xml::input( 'amount', '7', $data['amount'], array( 'id' => 'amount' ) ) . |
263 | | - '<span class="creditcard_error_msg">' . ' ' . $error['invalidamount'] . '</span>' . |
| 268 | + '<span class="creditcard-error-msg">' . ' ' . $error['invalidamount'] . '</span>' . |
264 | 269 | $endRow . |
265 | 270 | Xml::label( wfMsg( 'payflowpro_gateway-donor-currency-label' ), 'currency_code' ) . |
266 | 271 | $endCell . |
— | — | @@ -270,21 +275,21 @@ |
271 | 276 | Xml::label( wfMsg( 'payflowpro_gateway-donor-email' ), 'emailAdd' ) . |
272 | 277 | $endCell . |
273 | 278 | Xml::input( 'emailAdd', '30', $data['email'], array( 'maxlength' => '64', 'id' => 'emailAdd' ) ) . |
274 | | - '<span class="creditcard_error_msg">' . ' ' . $error['emailAdd'] . '</span>' . |
| 279 | + '<span class="creditcard-error-msg">' . ' ' . $error['emailAdd'] . '</span>' . |
275 | 280 | $endRow . |
276 | 281 | Xml::label( wfMsg( 'payflowpro_gateway-donor-fname' ), 'fname' ) . |
277 | 282 | $endCell . |
278 | | - Xml::input( 'fname', '20', $data['fname'], array( 'maxlength' => '15', 'class' => 'required', 'id' => 'fname' ) ) . |
279 | | - '<span class="creditcard_error_msg">' . ' ' . $error['fname'] . '</span>' . |
| 283 | + Xml::input( 'fname', '30', $data['fname'], array( 'maxlength' => '15', 'class' => 'required', 'id' => 'fname' ) ) . |
| 284 | + '<span class="creditcard-error-msg">' . ' ' . $error['fname'] . '</span>' . |
280 | 285 | $endRow . |
281 | 286 | Xml::label( wfMsg( 'payflowpro_gateway-donor-mname' ), 'mname' ) . |
282 | 287 | $endCell . |
283 | | - Xml::input( 'mname', '20', $data['mname'], array( 'maxlength' => '15', 'id' => 'mname' ) ) . |
| 288 | + Xml::input( 'mname', '30', $data['mname'], array( 'maxlength' => '15', 'id' => 'mname' ) ) . |
284 | 289 | $endRow . |
285 | 290 | Xml::label( wfMsg( 'payflowpro_gateway-donor-lname' ), 'lname' ) . |
286 | 291 | $endCell . |
287 | | - Xml::input( 'lname', '20', $data['lname'], array( 'maxlength' => '15', 'id' => 'lname' ) ) . |
288 | | - '<span class="creditcard_error_msg">' . ' ' . $error['lname'] . '</span>' . |
| 292 | + Xml::input( 'lname', '30', $data['lname'], array( 'maxlength' => '15', 'id' => 'lname' ) ) . |
| 293 | + '<span class="creditcard-error-msg">' . ' ' . $error['lname'] . '</span>' . |
289 | 294 | $endRow; |
290 | 295 | |
291 | 296 | //donor address |
— | — | @@ -293,35 +298,35 @@ |
294 | 299 | Xml::openElement( 'select', array( 'name' => 'country', 'id' => 'country', 'onchange' => 'return disableStates( this )' ) ) . |
295 | 300 | $countryMenu . |
296 | 301 | Xml::closeElement( 'select' ) . |
297 | | - '<span class="creditcard_error_msg">' . ' ' . $error['country'] . '</span>' . |
| 302 | + '<span class="creditcard-error-msg">' . ' ' . $error['country'] . '</span>' . |
298 | 303 | $endRow . |
299 | 304 | Xml::label( wfMsg( 'payflowpro_gateway-donor-street' ), 'street' ) . |
300 | 305 | $endCell . |
301 | 306 | Xml::input( 'street', '30', $data['street'], array( 'maxlength' => '30', 'id' => 'street' ) ) . |
302 | | - '<span class="creditcard_error_msg">' . ' ' . $error['street'] . '</span>' . |
| 307 | + '<span class="creditcard-error-msg">' . ' ' . $error['street'] . '</span>' . |
303 | 308 | $endRow . |
304 | 309 | Xml::label( wfMsg( 'payflowpro_gateway-donor-city' ), 'city' ) . |
305 | 310 | $endCell . |
306 | | - Xml::input( 'city', '20', $data['city'], array( 'maxlength' => '20', 'id' => 'city' ) ) . |
307 | | - '<span class="creditcard_error_msg">' . ' ' . $error['city'] . '</span>' . |
| 311 | + Xml::input( 'city', '30', $data['city'], array( 'maxlength' => '20', 'id' => 'city' ) ) . |
| 312 | + '<span class="creditcard-error-msg">' . ' ' . $error['city'] . '</span>' . |
308 | 313 | $endRow . |
309 | 314 | Xml::label( wfMsg( 'payflowpro_gateway-donor-state' ), 'state' ) . |
310 | 315 | $endCell . |
311 | 316 | Xml::openElement( 'select', array( 'name' => 'state', 'id' => 'state' ) ) . |
312 | 317 | $stateMenu . |
313 | 318 | Xml::closeElement( 'select' ) . |
314 | | - '<span class="creditcard_error_msg">' . ' ' . $error['state'] . '</span>' . |
| 319 | + '<span class="creditcard-error-msg">' . ' ' . $error['state'] . '</span>' . |
315 | 320 | $endRow . |
316 | 321 | Xml::label( wfMsg( 'payflowpro_gateway-donor-postal' ), 'zip' ) . |
317 | 322 | $endCell . |
318 | | - Xml::input( 'zip', '15', $data['zip'], array( 'maxlength' => '9', 'id' => 'zip' ) ) . |
319 | | - '<span class="creditcard_error_msg">' . ' ' . $error['zip'] . '</span>' . |
| 323 | + Xml::input( 'zip', '30', $data['zip'], array( 'maxlength' => '9', 'id' => 'zip' ) ) . |
| 324 | + '<span class="creditcard-error-msg">' . ' ' . $error['zip'] . '</span>' . |
320 | 325 | '</td></tr>' . |
321 | 326 | Xml::closeElement( 'table' ) . |
322 | 327 | '<br />'; |
323 | 328 | |
324 | 329 | // credit card info |
325 | | - $form .= Xml::openElement( 'table', array( 'id' => 'payflow_table' ) ). |
| 330 | + $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) ). |
326 | 331 | '<tr><td style="text-align:right;">' . |
327 | 332 | Xml::label( wfMsg( 'payflowpro_gateway-donor-card' ), 'card' ) . |
328 | 333 | $endCell . |
— | — | @@ -332,9 +337,9 @@ |
333 | 338 | Xml::label( wfMsg( 'payflowpro_gateway-donor-card-num' ), 'card_num' ) . |
334 | 339 | $endCell . |
335 | 340 | Xml::input( 'card_num', '30', '', array( 'maxlength' => '100', 'id' => 'card_num' ) ) . |
336 | | - '<span class="creditcard_error_msg">' . ' ' . $error['card_num'] . '</span>' . |
| 341 | + '<span class="creditcard-error-msg">' . ' ' . $error['card_num'] . '</span>' . |
337 | 342 | '</tr><tr><td></td><td>' . |
338 | | - '<span class="creditcard_error_msg">' . ' ' . $error['card'] . '</span>' . |
| 343 | + '<span class="creditcard-error-msg">' . ' ' . $error['card'] . '</span>' . |
339 | 344 | $endRow . |
340 | 345 | Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . |
341 | 346 | $endCell . |
— | — | @@ -349,7 +354,7 @@ |
350 | 355 | $endCell . |
351 | 356 | Xml::input( 'cvv', '5', '', array( 'maxlength' => '10', 'id' => 'cvv' ) ) . |
352 | 357 | '<a href="javascript:PopupCVV();">' . wfMsg( 'word-separator' ) . wfMsg( 'payflowpro_gateway-cvv-link' ) . '</a>' . |
353 | | - '<span class="creditcard_error_msg">' . ' ' . $error['cvv'] . '</span>' . |
| 358 | + '<span class="creditcard-error-msg">' . ' ' . $error['cvv'] . '</span>' . |
354 | 359 | '</td></tr>' . |
355 | 360 | Xml::closeElement( 'table' ); |
356 | 361 | |
— | — | @@ -370,13 +375,19 @@ |
371 | 376 | Xml::hidden( 'numAttempt', $data['numAttempt'] ); |
372 | 377 | |
373 | 378 | // submit button and close form |
374 | | - $form .= Xml::submitButton( wfMsg( 'payflowpro_gateway-submit-button' ) ) . |
| 379 | + $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage' ) ) . |
| 380 | + wfMsg( 'payflowpro_gatewa-donate-click' ) . |
| 381 | + Xml::tags( 'div', array( 'id' => 'mw-donate-submit-button' ), |
| 382 | + Xml::submitButton( wfMsg( 'payflowpro_gateway-submit-button' ) ) ) . |
| 383 | + Xml::tags( 'p', array( 'class' => '' ), |
| 384 | + wfMsg( 'payflowpro_gateway-credit-storage-processing' ) ) . |
| 385 | + Xml::tags( 'p', array( 'class' => ''), |
| 386 | + wfMsg( 'payflowpro_gateway-question-comment' ) ) . |
375 | 387 | Xml::closeElement( 'form' ) . |
| 388 | + Xml::closeElement( 'div' ) . |
376 | 389 | Xml::closeElement( 'div' ); |
377 | 390 | |
378 | | - $form .= Xml::closeElement( 'div' ) . |
379 | | - Xml::Element( 'p', array( 'class' => 'mw-creditcard-submessage' ), |
380 | | - wfMsg( 'payflowpro_gateway-donor-currency-msg', $data['currency'] ) ); |
| 391 | + $form .= Xml::closeElement( 'div' ); |
381 | 392 | |
382 | 393 | // Theming |
383 | 394 | global $wgDonationInterfaceTomasSkin; |
— | — | @@ -568,8 +579,7 @@ |
569 | 580 | $headers[] = 'X-VPS-Request-ID:' . $payflow_data['order_id']; |
570 | 581 | $ch = curl_init(); |
571 | 582 | $paypalPostTo = isset ( $wgDonationTestingMode ) ? 'testingurl' : 'paypalurl'; |
572 | | - //curl_setopt( $ch, CURLOPT_URL, $payflow_data[ $paypalPostTo ] ); |
573 | | - curl_setopt($ch, CURLOPT_URL, $payflow_data['testingurl']); |
| 583 | + curl_setopt( $ch, CURLOPT_URL, $payflow_data[ $paypalPostTo ] ); |
574 | 584 | curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers ); |
575 | 585 | curl_setopt( $ch, CURLOPT_USERAGENT, $user_agent ); |
576 | 586 | curl_setopt( $ch, CURLOPT_HEADER, 1 ); |
— | — | @@ -780,9 +790,8 @@ |
781 | 791 | //enable if we need this to get the Civi data to display correctly |
782 | 792 | $transaction['optout'] = ($transaction['optout'] == "1") ? '0' : '1'; |
783 | 793 | $transaction['anonymous'] = ($transaction['anonymous'] == "1") ? '0' : '1'; |
784 | | - var_dump($transaction); |
785 | 794 | // hook to call stomp functions |
786 | | - //wfRunHooks( 'gwStomp', array( &$transaction ) ); |
| 795 | + wfRunHooks( 'gwStomp', array( &$transaction ) ); |
787 | 796 | } |
788 | 797 | |
789 | 798 | /** |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php |
— | — | @@ -88,6 +88,9 @@ |
89 | 89 | <h4>American Express</h4> |
90 | 90 | <p>The code is ALWAYS located ABOVE the embossed (raised) account number on the face of the card. |
91 | 91 | In some instances, the code is located on the left side of the card, but is always above the account number.</p><br />', |
| 92 | + 'payflowpro_gateway-question-comment' => 'Wikipedia is a project of the Wikimedia Foundation. Questions or comments? Contact the Wikimedia Foundation: <a href="mailto:donate@wikimedia.org">donate@wikimedia.org</a>', |
| 93 | + 'payflowpro_gatewa-donate-click' => 'After clicking "Donate", your credit card information will be processed.', |
| 94 | + 'payflowpro_gateway-credit-storage-processing' => 'We do not store your credit card information, and your personal data is subject to our <a href="http://wikimediafoundation.org/wiki/Wikimedia:Privacy_policy">privacy policy</a>', |
92 | 95 | 'donate_interface-GBP' => 'GBP: British Pound', |
93 | 96 | 'donate_interface-EUR' => 'EUR: Euro', |
94 | 97 | 'donate_interface-USD' => 'USD: U.S. Dollar', |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -30,6 +30,8 @@ |
31 | 31 | $wgPayflowProURL = 'https://payflowpro.paypal.com'; |
32 | 32 | $wgPayflowProTestingURL = 'https://pilot-payflowpro.paypal.com'; // Payflow testing URL |
33 | 33 | |
| 34 | +$wgPayFlowProGatewayCSSVersion = 1; |
| 35 | + |
34 | 36 | $wgPayflowProPartnerID = ''; //PayPal or original authorized reseller |
35 | 37 | $wgPayflowProVendorID = ''; // paypal merchant login ID |
36 | 38 | $wgPayflowProUserID = ''; //if one or more users are set up, authorized user ID, else same as VENDOR |