Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -259,6 +259,10 @@ |
260 | 260 | } |
261 | 261 | |
262 | 262 | // intro text |
| 263 | + if ( $wgWikipediForeverTheme ) { |
| 264 | + $wgOut->addWikiText( '{{2009/Donate-header/' . $data[language] . '}}' ); |
| 265 | + } |
| 266 | + |
263 | 267 | $form = Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) ) . |
264 | 268 | Xml::openElement( 'div', array( 'id' => 'mw-creditcard-intro' ) ) . |
265 | 269 | Xml::tags( 'p', array( 'class' => 'mw-creditcard-intro-msg' ), wfMsg( 'payflowpro_gateway-form-message' ) ) . |
— | — | @@ -678,7 +682,7 @@ |
679 | 683 | if( $errorCode == '1' ) { |
680 | 684 | $this->fnPayflowDisplayApprovedResults( $data, $responseArray, $responseMsg ); |
681 | 685 | // give user a second chance to enter incorrect data |
682 | | - } elseif( ( $errorCode == '3' ) && ( $data['numAttempt'] < '3' ) ) { |
| 686 | + } elseif( ( $errorCode == '3' ) && ( $data['numAttempt'] < '5' ) ) { |
683 | 687 | // pass responseMsg as an array key as required by displayForm |
684 | 688 | $tryAgainResponse['retryMsg'] = $responseMsg; |
685 | 689 | $this->fnPayflowDisplayForm( $data, $tryAgainResponse ); |
— | — | @@ -760,29 +764,12 @@ |
761 | 765 | * @param $responseMsg String: message supplied by getResults function |
762 | 766 | */ |
763 | 767 | function fnPayflowDisplayApprovedResults( $data, $responseArray, $responseMsg ) { |
764 | | - global $wgOut; |
| 768 | + require_once( 'includes/countryCodes.inc' ); |
| 769 | + |
| 770 | + global $wgOut, $wgThankYouPage; |
765 | 771 | $transaction = ''; |
766 | 772 | $tracked = ''; |
767 | 773 | |
768 | | - require_once( 'includes/countryCodes.inc' ); |
769 | | - |
770 | | - // display response message |
771 | | - $wgOut->addHTML( '<h3 class="response_message">' . $responseMsg . '</h3>' ); |
772 | | - |
773 | | - // translate country code into text |
774 | | - $countries = countryCodes(); |
775 | | - |
776 | | - $rows = array( |
777 | | - 'title' => array( wfMsg( 'payflowpro_gateway-post-transaction' ) ), |
778 | | - 'amount' => array( wfMsg( 'payflowpro_gateway-donor-amount' ), $data['amount'] ), |
779 | | - 'email' => array( wfMsg( 'payflowpro_gateway-donor-email' ), $data['email'] ), |
780 | | - 'name' => array( wfMsg( 'payflowpro_gateway-donor-name' ), $data['fname'], $data['mname'], $data['lname'] ), |
781 | | - 'address' => array( wfMsg( 'payflowpro_gateway-donor-address' ), $data['street'], $data['city'], $data['state'], $data['zip'], $countries[$data['country']] ), |
782 | | - ); |
783 | | - |
784 | | - // if we want to show the response |
785 | | - $wgOut->addHTML( Xml::buildTable( $rows, array( 'class' => 'submitted-response' ) ) ); |
786 | | - |
787 | 774 | // push to ActiveMQ server |
788 | 775 | // include response message |
789 | 776 | $transaction['response'] = $responseMsg; |
— | — | @@ -794,12 +781,29 @@ |
795 | 782 | // put all data into one array |
796 | 783 | $transaction += array_merge( $data, $responseArray ); |
797 | 784 | |
798 | | - //enable if we need this to get the Civi data to display correctly |
799 | | - $transaction['optout'] = ($transaction['optout'] == "1") ? '0' : '1'; |
800 | | - $transaction['anonymous'] = ($transaction['anonymous'] == "1") ? '0' : '1'; |
801 | | - |
802 | 785 | // hook to call stomp functions |
803 | 786 | wfRunHooks( 'gwStomp', array( &$transaction ) ); |
| 787 | + |
| 788 | + if ( $wgExternalThankYou ) { |
| 789 | + $wgOut->redirect( $wgThankYouPage . $data[language] ); |
| 790 | + } else { |
| 791 | + // display response message |
| 792 | + $wgOut->addHTML( '<h3 class="response_message">' . $responseMsg . '</h3>' ); |
| 793 | + |
| 794 | + // translate country code into text |
| 795 | + $countries = countryCodes(); |
| 796 | + |
| 797 | + $rows = array( |
| 798 | + 'title' => array( wfMsg( 'payflowpro_gateway-post-transaction' ) ), |
| 799 | + 'amount' => array( wfMsg( 'payflowpro_gateway-donor-amount' ), $data['amount'] ), |
| 800 | + 'email' => array( wfMsg( 'payflowpro_gateway-donor-email' ), $data['email'] ), |
| 801 | + 'name' => array( wfMsg( 'payflowpro_gateway-donor-name' ), $data['fname'], $data['mname'], $data['lname'] ), |
| 802 | + 'address' => array( wfMsg( 'payflowpro_gateway-donor-address' ), $data['street'], $data['city'], $data['state'], $data['zip'], $countries[$data['country']] ), |
| 803 | + ); |
| 804 | + |
| 805 | + // if we want to show the response |
| 806 | + $wgOut->addHTML( Xml::buildTable( $rows, array( 'class' => 'submitted-response' ) ) ); |
| 807 | + } |
804 | 808 | } |
805 | 809 | |
806 | 810 | /** |