http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72184

Revision: 72184
Author:   awjrichards
Date:     2010-09-02 00:20:34 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
Added a way to put cc gateway into test mode to prepopulate cc form; updated 
messaging for wikimedia 2010 fundraiser, added credit card logos to cc form; 
added a 'test' ip address for minfraud queries in test mode

Modified Paths:
--------------
    
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
    
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
    
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
    trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php

Added Paths:
-----------
    
trunk/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
     2010-09-02 00:10:52 UTC (rev 72183)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/extras/minfraud/minfraud.body.php
     2010-09-02 00:20:34 UTC (rev 72184)
@@ -151,6 +151,8 @@
         * @return array containing hash for minfraud query
         */
        public function build_query( array $data ) {
+               global $wgPayflowGatewayTest;
+
                // mapping of data keys -> minfraud array keys
                $map = array(
                        "city" => "city",
@@ -167,7 +169,7 @@
                $minfraud_array[ "license_key" ] = $this->minfraud_license_key;
 
                // user's IP address
-               $minfraud_array[ "i" ] = wfGetIP();
+               $minfraud_array[ "i" ] = ( $wgPayflowGatewayTest ) ? 
'12.12.12.12' : wfGetIP();
 
                // user's user agent
                global $wgRequest;

Added: 
trunk/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif
                                (rev 0)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif
        2010-09-02 00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\xD6h\xE4\xE0!^5l~v2\xB9\x83B\xE0{\xAC\x89CBa?q<\,\xE1vX"\xA8R:\xB8E%x\xC0\xE2"\xF8\xE1B\x85\x8A\x98U
 \x82vu<\xD7\xC2
+.\x88\xE6\xC7<\x8C\xC0       <\xD0P\xC4 
\...@cl1\xd2\xd6\xe2\xf1qc\xc8}9\xacу}\xf6=\xfed~\xe4\xd4\xc3|\xB1q\x81B8!C\x81a\r\xC9
0h\xA1Za\x92Y\xB8\xA1\x99\x82x\xF6\x86\xCF)pL\xF4\xD3\xD9
+\x88\xD0~\xB4\xB0g\xDEq\xE3 '\xB8\x86\xA3G\xF0\xB0
+<\x9C (m...@\xcawho~观~e\xae\xd1\xdf\xe1\xfb      %aAA\xC4       
Dр\xAE\x8A*A\xAḆ \xC0\xE0
\40\x...@h\xc1\x83iy\xec\xf0dot\xb8\xc1\xacЦ\xccֹby\xd8\xe0gc\xb4\xb1\x81

d_\xB4\xC1Bi5\xCAC\x9C'...@\xb2#h\x82y\x90!\xfa$Ƨ~$\xd9\xc9aꥱ\xb0\x80g7\xd0\xc7
+\xC1\x85\xF8\xA1B½\x8A      \xC2~\xFE\xA4\x90B \xA0\x90ǰ\x84 
\xC2;x\xB0\x9Bl\x90\x85.\xC8\xB3'\xF7S
\x9F~\xE8\xB9A\x85\x80\xF6\x95\xC8'\xE4p\xC2<瀳9$b)\x81\x85\xE8g*\x92\x82|\xea\xe4\xbfdk...@4pq
      
\\xe8\xf1c%h\xe0\x87\xe1dd6\xb0d\xd4k\x...@p<\xC8\xCA˾\xB1l%\xDB\xF0+\xD0\xF9\x86\xB3\xACY\x89f\xC3g͂
-\xC8        $\x90\...@$\x8c\x8b(...@\xc4v\xc8\x82kd\xef}~ 
$Fb\xF8\x9B\x90I\x9E*Q},\x811p\xFB1pH\xDD\xB1\xA5D\xD4
+4D7\x9AI\x88P<\xC7o\xE0q^p\xE6\xED\x87\x98a\xBC.\xE4]m\xB8\xB1\x83V\x88\x91C[\xBC4)\xA00\x9E!B\xB0\xB9\xFE\x98\xD6\xEB\xF0}
+\x89_\xF9\x9E\x83\x83\xEC\xB7\xEF>\xFBA4ѥ\xF4ׯ\x83R\xF4\xE0\xE0 
\xD1BW\xC1H\xA0\x936@'?l\xA0[m;\x86f6\xE0\x82:\xEC`PȐ\xCD2
+\xE7{\x98JD\xFE\xD3\xE1\xA78I\x92&\xECO\xE0Nu\x9DZ\x87;Ў\x86\xB2=K\xB4\xE68\xA4
\xC0\xC3\xFA\xF0\x87@\xA2 \x9c\xf5\x81\xf...@  
\x95bB\x93Lh\xC5\xD0΄\xA6H\xC5*Z\xD13ycj(\x899t\x878\xC4\xE0\x85H\xC62\xB1\x88,8\xE2EFHB0\xE5\x84\xC3C\xC6]\xB0\x92\x97\xBD\xD8\xF1\x8E{\xA1\xC9^\xB8\xF8\x88\x82\x8Cb4\xA3
 \x81hı\x94\...@e\xf1\xc1\x97\xd2b\xc8\xf12\xc1\xca?\xea\xa8
\x90/\x81\x8BD\xFF\x9C\xC8I\xEF\xE9p\x90\xA04\x80
+Ir\xE1\x83D\xD1G\x9A\xA04\xA1-\x8CD2dII
+\x80\x924a\x80
+\xA0\x80Iy-\xC2l\xECd'1x#\xF3\x98\xC8L\xA62\x97     
\x83"\xAA\xE3>@,\xC5Q\x84v4\xE1o,\x89#\xFBa\xCBn\xE6\x85&\xC9\xC8?
+\xF3\x9C\xA4\x85:e\x8Bu\xBA\xB2\xEC\xA6<o9Id,C\xF8\xCC\xE74N\xC1\xCF~\xFA\xF3\x9F
+\...@jЂ\xf4\xa0m\xa8b=;
\ No newline at end of file

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
   2010-09-02 00:10:52 UTC (rev 72183)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
   2010-09-02 00:20:34 UTC (rev 72184)
@@ -91,40 +91,9 @@
                $numAttempt = ( $wgRequest->getText( 'numAttempt' ) == '' ) ? 
'0' : $wgRequest->getText( 'numAttempt' );
 
                // Populate from data
-               $data = array(
-                       'amount' => $amount,
-                       'email' => $wgRequest->getText( 'emailAdd' ),
-                       'fname' => $wgRequest->getText( 'fname' ),
-                       'mname' => $wgRequest->getText( 'mname' ),
-                       'lname' => $wgRequest->getText( 'lname' ),
-                       'street' => $wgRequest->getText( 'street' ),
-                       'city' => $wgRequest->getText( 'city' ),
-                       'state' => $wgRequest->getText( 'state' ),
-                       'zip' => $wgRequest->getText( 'zip' ),
-                       'country' => $wgRequest->getText( 'country' ),
-                       'card' => $wgRequest->getText( 'card' ),
-                       'card_num' => str_replace( ' ', '', 
$wgRequest->getText( 'card_num' ) ),
-                       'expiration' => $wgRequest->getText( 'mos' ) . substr( 
$wgRequest->getText( 'year' ), 2, 2 ),
-                       'cvv' => $wgRequest->getText( 'cvv' ),
-                       'currency' => $wgRequest->getText( 'currency_code' ),
-                       'payment_method' => $wgRequest->getText( 
'payment_method' ),
-                       'order_id' => $wgRequest->getText( 'orderid' ), //will 
be set with $payflow_data
-                       'numAttempt' => $numAttempt,
-                       'referrer' => $wgRequest->getText( 'referrer' ),
-                       'utm_source' => $wgRequest->getText( 'utm_source' ),
-                       'utm_medium' => $wgRequest->getText( 'utm_medium' ),
-                       'utm_campaign' => $wgRequest->getText( 'utm_campaign' ),
-                       'language' => $wgRequest->getText( 'language' ),
-                       'comment' => $wgRequest->getText( 'comment' ),
-                       'anonymous' => $wgRequest->getText( 'comment-option' ),
-                       'optout' => $wgRequest->getText( 'email' ),
-                       'test_string' => $wgRequest->getText( 'process' ), 
//for showing payflow string during testing
-                       'token' => $token,
-                       'contribution_tracking_id' => $wgRequest->getText( 
'contribution_tracking_id' ),
-                       'data_hash' => $wgRequest->getText( 'data_hash' ),
-                       'action' => $wgRequest->getText( 'action' ),
-               );
+               $data = $this->fnGetFormData( $amount, $numAttempt, $token );
                
+               
                // Get array of default account values necessary for Payflow 
                require_once( 'includes/payflowUser.inc' );
 
@@ -205,7 +174,7 @@
                require_once( 'includes/stateAbbreviations.inc' );
                require_once( 'includes/countryCodes.inc' );
        
-               global $wgOut, $wgLang, $wgPayflowGatewayHeader;
+               global $wgOut, $wgLang, $wgPayflowGatewayHeader, 
$wgPayflowGatewayTest;
 
                // save contrib tracking id early to track abondonment
                if ( $data[ 'numAttempt' ] == '0' ) {
@@ -238,21 +207,38 @@
                );
 
                foreach( $cardOptions as $value => $fullName ) {
-                       $cardOptionsMenu .= Xml::option( $fullName, $value );
+                       if ( $value == $data[ 'card' ] && $wgPayflowGatewayTest 
) {
+                               $cardOptionsMenu .= Xml::option( $fullName, 
$value, true );
+                       } else {
+                               $cardOptionsMenu .= Xml::option( $fullName, 
$value, false );
+                       }
                }
+       
+               if ( $data['expiration'] ) {
+                       $mo = substr( $data['expiration'], 0, 2);
+                       $yr = substr( $data['expiration'], 2, 2);
+               }
                
                //create expiration month menu
                $expMos = '';
 
                for( $i = 1; $i < 13; $i++ ) {
-                       $expMos .= Xml::option( $wgLang->getMonthName( $i ), 
str_pad( $i, 2, '0', STR_PAD_LEFT ) );
+                       if ( $i == $mo && $wgPayflowGatewayTest ) {
+                               $expMos .= Xml::option( $wgLang->getMonthName( 
$i ), str_pad( $i, 2, '0', STR_PAD_LEFT ), true );
+                       } else {
+                               $expMos .= Xml::option( $wgLang->getMonthName( 
$i ), str_pad( $i, 2, '0', STR_PAD_LEFT ), false );
+                       }
                }
                
                //create expiration year menu
                $expYr = '';
   
                for( $i = 0; $i < 11; $i++ ) {
-                       $expYr .= Xml::option( date( 'Y' ) + $i, date( 'Y' ) + 
$i );
+                       if ( date( 'Y' ) + $i == substr(date('Y'), 0, 2) . $yr 
&& $wgPayflowGatewayTest ) {
+                               $expYr .= Xml::option( date( 'Y' ) + $i, date( 
'Y' ) + $i, true );
+                       } else {
+                               $expYr .= Xml::option( date( 'Y' ) + $i, date( 
'Y' ) + $i, false );
+                       }
                }
                
                $states = statesMenuXML();
@@ -281,17 +267,17 @@
                $currency_options = '';
        
                foreach ( $currencies as $code => $name ) {
-                       $selected = '';
-                       if ( $code == $default_currency ) {
-                                 $selected = ' selected="selected"';
-                       }
-               $currency_options .= '<option value="' . $code . '"' . 
$selected . '>' . wfMsg( 'donate_interface-' . $code ) . '</option>';
-               }
+               $selected = '';
+               if ( $code == $default_currency ) {
+                               $selected = ' selected="selected"';
+               }
+                       $currency_options .= '<option value="' . $code . '"' . 
$selected . '>' . wfMsg( 'donate_interface-' . $code ) . '</option>';
+       }
                
                // intro text
                if ( $wgPayflowGatewayHeader ) {
                        $header = str_replace( '@language', $data['language'], 
$wgPayflowGatewayHeader );
-                       $wgOut->addHtml( $wgOut->parse( $header 
));//'{{2009/Donate-header/' . $data['language'] . '}}' ));
+                       $wgOut->addHtml( $wgOut->parse( $header ));
                }       
 
                $form = Xml::openElement( 'div', array( 'id' => 'mw-creditcard' 
) ) .
@@ -385,7 +371,13 @@
                        '<br />';
                        
                // credit card info
+               global $wgScriptPath;
+               $card_num = ( $wgPayflowGatewayTest ) ? $data[ 'card_num' ] : 
'';
+               $cvv = ( $wgPayflowGatewayTest ) ? $data[ 'cvv' ] : '';
                $form .= Xml::openElement( 'table', array( 'id' => 
'payflow-table-cc' ) ).
+                       '<tr><td style="text-align: right;"></td><td>'.
+                       Xml::openElement( 'img', array( 'src' => $wgScriptPath 
. 
"/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif"
 )) .
+                       '</td></tr>' .
                        '<tr><td style="text-align:right;">' .
                        Xml::label( wfMsg( 'payflowpro_gateway-donor-card' ), 
'card' ) .
                        $endCell .
@@ -395,7 +387,7 @@
                        $endRow .
                        Xml::label( wfMsg( 'payflowpro_gateway-donor-card-num' 
), 'card_num' ) .
                        $endCell .
-                       Xml::input( 'card_num', '30', '', array( 'maxlength' => 
'100', 'id' => 'card_num', 'autocomplete' => 'off' ) ) .
+                       Xml::input( 'card_num', '30', $card_num, array( 
'maxlength' => '100', 'id' => 'card_num', 'autocomplete' => 'off' ) ) .
                        '<span class="creditcard-error-msg">' . '  ' . 
$error['card_num'] . '</span>' .
                        '</tr><tr><td></td><td>' .
                        '<span class="creditcard-error-msg">' . '  ' . 
$error['card'] . '</span>' .
@@ -411,7 +403,7 @@
                        $endRow .
                        Xml::label( wfMsg( 'payflowpro_gateway-donor-security' 
), 'cvv' ) .
                        $endCell .
-                       Xml::input( 'cvv', '5', '', array( 'maxlength' => '10', 
'id' => 'cvv', 'autocomplete' => 'off') ) .
+                       Xml::input( 'cvv', '5', $cvv, array( 'maxlength' => 
'10', 'id' => 'cvv', 'autocomplete' => 'off') ) .
                        '<a href="javascript:PopupCVV();">' . wfMsg( 
'word-separator' ) . wfMsg( 'payflowpro_gateway-cvv-link' ) . '</a>' .
                        '<span class="creditcard-error-msg">' . '  ' . 
$error['cvv'] . '</span>' .
                        '</td></tr>' .
@@ -1028,4 +1020,113 @@
                // otherwise, fire it up using global mw function wfSetupSession
                wfSetupSession();
        }
+
+       /**
+        * Populate the $data array for the credit card form
+        *
+        * Provides a way to prepopulate the form with test data using 
$wgPayflowGatewayTest
+        * @return array
+        */
+       public function fnGetFormData( $amount, $numAttempt, $token ) {
+               global $wgPayflowGatewayTest, $wgRequest;
+               if ( !$numAttempt && $wgPayflowGatewayTest ) { // if we're in 
testing mode, prepopulate the form
+                       // define arrays of cc's and cc #s for random selection
+                       $cards = array( 'visa', 'mastercard', 'american', 
'discover');
+                       $card_nums = array(
+                               'visa' => array(
+                                       4111111111111111,
+                                       4012888888881881,
+                                       4222222222222
+                               ),
+                               'mastercard' => array(
+                                       5105105105105100,
+                                       5555555555554444,
+                               ),
+                               'american' => array(
+                                       378734493671000,
+                                       371449635398431,
+                                       378282246310005
+                               ),
+                               'discover' => array(
+                                       6011111111111117,
+                                       6011000990139424
+                               ),
+                       );
+
+                       // randomly select a credit cards
+                       $card_index = array_rand( $cards );
+
+                       // randomly select a credit card #
+                       $card_num_index = array_rand( $card_nums[ $cards[ 
$card_index ]] );
+
+                       $data = array(
+                               'amount' => $amount,
+                               'email' => '[email protected]',
+                               'fname' => 'Tester',
+                               'mname' => 'T.',
+                               'lname' => 'Testington',
+                               'street' => '548 Market St.',
+                               'city' => 'San Francisco',
+                               'state' => 'CA',
+                               'zip' => '94104',
+                               'country' => 840,
+                               'card' => $cards[ $card_index ],
+                               'card_num' => $card_nums[ $cards[ $card_index 
]][ $card_num_index ],
+                               'expiration' => date( 'my', strtotime( '+1 year 
1 month' )),
+                               'cvv' => '001',
+                               'currency' => 'USD',
+                               'payment_method' => $wgRequest->getText( 
'payment_method' ),
+                               'order_id' => $wgRequest->getText( 'orderid' ),
+                               'numAttempt' => $numAttempt,
+                               'referrer' => 
'http://www.baz.test.com/index.php?action=foo&action=bar',
+                               'utm_source' => '.Spam.Support.cc',
+                               'utm_medium' => $wgRequest->getText( 
'utm_medium' ),
+                               'utm_campaign' => $wgRequest->getText( 
'utm_campaign' ),
+                               'language' => 'en',
+                               'comment' => 'This sure is neat',
+                               'anonymous' => $wgRequest->getText( 
'comment-option' ),
+                               'optout' => $wgRequest->getText( 'email' ),
+                               'test_string' => $wgRequest->getText( 'process' 
),
+                               'token' => $token,
+                               'contribution_tracking_id' => 
$wgRequest->getText( 'contribution_tracking_id' ),
+                               'data_hash' => $wgRequest->getText( 'data_hash' 
),
+                               'action' => $wgRequest->getText( 'action' ),
+                       );
+               } else {
+                       $data = array(
+                               'amount' => $amount,
+                               'email' => $wgRequest->getText( 'emailAdd' ),
+                               'fname' => $wgRequest->getText( 'fname' ),
+                               'mname' => $wgRequest->getText( 'mname' ),
+                               'lname' => $wgRequest->getText( 'lname' ),
+                               'street' => $wgRequest->getText( 'street' ),
+                               'city' => $wgRequest->getText( 'city' ),
+                               'state' => $wgRequest->getText( 'state' ),
+                               'zip' => $wgRequest->getText( 'zip' ),
+                               'country' => $wgRequest->getText( 'country' ),
+                               'card' => $wgRequest->getText( 'card' ),
+                               'card_num' => str_replace( ' ', '', 
$wgRequest->getText( 'card_num' ) ),
+                               'expiration' => $wgRequest->getText( 'mos' ) . 
substr( $wgRequest->getText( 'year' ), 2, 2 ),
+                               'cvv' => $wgRequest->getText( 'cvv' ),
+                               'currency' => $wgRequest->getText( 
'currency_code' ),
+                               'payment_method' => $wgRequest->getText( 
'payment_method' ),
+                               'order_id' => $wgRequest->getText( 'orderid' ), 
//will be set with $payflow_data
+                               'numAttempt' => $numAttempt,
+                               'referrer' => $wgRequest->getText( 'referrer' ),
+                               'utm_source' => $wgRequest->getText( 
'utm_source' ),
+                               'utm_medium' => $wgRequest->getText( 
'utm_medium' ),
+                               'utm_campaign' => $wgRequest->getText( 
'utm_campaign' ),
+                               'language' => $wgRequest->getText( 'language' ),
+                               'comment' => $wgRequest->getText( 'comment' ),
+                               'anonymous' => $wgRequest->getText( 
'comment-option' ),
+                               'optout' => $wgRequest->getText( 'email' ),
+                               'test_string' => $wgRequest->getText( 'process' 
), //for showing payflow string during testing
+                               'token' => $token,
+                               'contribution_tracking_id' => 
$wgRequest->getText( 'contribution_tracking_id' ),
+                               'data_hash' => $wgRequest->getText( 'data_hash' 
),
+                               'action' => $wgRequest->getText( 'action' ),
+                       );
+               }
+               return $data;
+       }
 } // end class

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
   2010-09-02 00:10:52 UTC (rev 72183)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
   2010-09-02 00:20:34 UTC (rev 72184)
@@ -13,8 +13,7 @@
        'payflowprogateway' => 'Support Wikimedia',
        'payflowpro_gateway-desc' => 'PayPal Payflow Pro credit card 
processing',
        'payflowpro_gateway-accessible' => 'This page is only accessible from 
the donation page.',
-       'payflowpro_gateway-form-message' => 'Contribute with your credit card.
-There are <a href="http://wikimediafoundation.org/wiki/Ways_to_Give/en";>other 
ways to give, including PayPal, check, or mail</a>.',
+       'payflowpro_gateway-form-message' => 'Secure credit card 
contributions.',
        'payflowpro_gateway-form-message-2' => 'To change amount or currency, 
return to <a href="/index.php?title=Donate">the donation page</a>',
        'payflowpro_gateway-donor-legend' => 'Donor information',
        'payflowpro_gateway-card-legend' => 'Credit card information',
@@ -93,9 +92,10 @@
 <h4>American Express</h4>
 <p>The code is <i>always</i> located <i>above</i> the embossed (raised) 
account number on the face of the card.
 In some instances, the code is located on the left side of the card, but is 
always above the account number.</p><br />',
-       'payflowpro_gateway-question-comment' => 'Wikipedia is a project of the 
Wikimedia Foundation. Questions or comments? Contact the Wikimedia Foundation: 
<a href="mailto:[email protected]";>[email protected]</a>',
+       'payflowpro_gateway-question-comment' => 'Questions or comments? 
Contact: <a href="mailto:[email protected]";>[email protected]</a>',
        'payflowpro_gateway-donate-click' => 'After clicking 
"{{int:payflowpro_gateway-donor-submit}}", your credit card information will be 
processed.',
-       '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/Donor_Privacy_Policy";>privacy 
policy</a>.',
+       'payflowpro_gateway-credit-storage-processing' => 'There are <a 
href="http://wikimediafoundation.org/wiki/Ways_to_Give/en";>other ways to give, 
including PayPal, check, or mail</a>.<br />
+We do not store your credit card information, and your personal data is 
subject to our <a 
href="http://wikimediafoundation.org/wiki/Donor_Privacy_Policy";>privacy 
policy</a>.',
        'donate_interface-GBP' => 'GBP: British Pound',
        'donate_interface-EUR' => 'EUR: Euro',
        'donate_interface-USD' => 'USD: U.S. Dollar',

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
===================================================================
--- 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php    
    2010-09-02 00:10:52 UTC (rev 72183)
+++ 
trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php    
    2010-09-02 00:20:34 UTC (rev 72184)
@@ -38,6 +38,9 @@
 $wgPayflowProUserID = ''; //if one or more users are set up, authorized user 
ID, else same as VENDOR
 $wgPayflowProPassword = ''; //merchant login password
 
+// a boolean to determine if we're in testing mode
+$wgPayflowGatewayTest = FALSE;
+
 /**
  * A string or array of strings for making tokens more secure
  *



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to