Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter2.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class PayflowProGateway_Form_TwoColumnLetter2 extends PayflowProGateway_Form_OneStepTwoColumn { |
| 5 | + public $paypal = false; // true for paypal only version |
5 | 6 | |
6 | 7 | public function __construct( &$form_data, &$form_errors ) { |
7 | 8 | global $wgOut, $wgScriptPath; |
— | — | @@ -16,6 +17,8 @@ |
17 | 18 | public function generateFormStart() { |
18 | 19 | global $wgOut, $wgRequest; |
19 | 20 | |
| 21 | + $this->paypal = $wgRequest->getBool( 'paypal', false ); |
| 22 | + |
20 | 23 | $form = parent::generateBannerHeader(); |
21 | 24 | |
22 | 25 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0)); |
— | — | @@ -84,18 +87,11 @@ |
85 | 88 | |
86 | 89 | $form = ''; |
87 | 90 | |
88 | | - // PayPal button |
89 | | - // make sure we have a paypal url set to redirect the user to before displaying the button |
90 | | - if ( strlen( $wgPayflowGatewayPaypalURL )) { |
| 91 | + if ( !$this->paypal ) { |
| 92 | + // PayPal button |
91 | 93 | $form .= '<tr>'; |
92 | 94 | $form .= '<td class="label"></td>'; |
93 | | - $form .= '<td class="paypal-button">'; |
94 | | - $form .= Xml::hidden( 'PaypalRedirect', false ); |
95 | | - $form .= Xml::tags( 'div', |
96 | | - array(), |
97 | | - '<a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';document.payment.submit();"><img src="'.$scriptPath.'/donate_with_paypal.gif"/></a>' |
98 | | - ); |
99 | | - $form .= '</td>'; |
| 95 | + $form .= '<td><a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';document.payment.submit();"><img src="'.$scriptPath.'/donate_with_paypal.gif"/></a></td>'; |
100 | 96 | $form .= '</tr>'; |
101 | 97 | } |
102 | 98 | |
— | — | @@ -105,6 +101,49 @@ |
106 | 102 | // email |
107 | 103 | $form .= $this->getEmailField(); |
108 | 104 | |
| 105 | + // amount |
| 106 | + $form .= $this->getAmountField(); |
| 107 | + |
| 108 | + if ( !$this->paypal ) { |
| 109 | + // PayPal button |
| 110 | + // make sure we have a paypal url set to redirect the user to before displaying the button |
| 111 | + if ( strlen( $wgPayflowGatewayPaypalURL )) { |
| 112 | + $form .= '<tr>'; |
| 113 | + $form .= '<td class="label"></td>'; |
| 114 | + $form .= '<td>'; |
| 115 | + $form .= Xml::hidden( 'PaypalRedirect', false ); |
| 116 | + $form .= Xml::tags( 'div', |
| 117 | + array(), |
| 118 | + Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) |
| 119 | + ); |
| 120 | + $form .= '</td>'; |
| 121 | + $form .= '</tr>'; |
| 122 | + } |
| 123 | + |
| 124 | + // card number |
| 125 | + $form .= $this->getCardNumberField(); |
| 126 | + |
| 127 | + // cvv |
| 128 | + $form .= $this->getCvvField(); |
| 129 | + |
| 130 | + // expiry |
| 131 | + $form .= $this->getExpiryField(); |
| 132 | + |
| 133 | + // street |
| 134 | + $form .= $this->getStreetField(); |
| 135 | + |
| 136 | + // city |
| 137 | + $form .= $this->getCityField(); |
| 138 | + |
| 139 | + // state |
| 140 | + $form .= $this->getStateField(); |
| 141 | + // zip |
| 142 | + $form .= $this->getZipField(); |
| 143 | + |
| 144 | + // country |
| 145 | + $form .= $this->getCountryField(); |
| 146 | + } |
| 147 | + |
109 | 148 | // anonymous |
110 | 149 | $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
111 | 150 | $form .= '<tr>'; |
— | — | @@ -115,38 +154,6 @@ |
116 | 155 | // email agreement |
117 | 156 | $form .= $this->getEmailOptField(); |
118 | 157 | |
119 | | - // amount |
120 | | - $form .= $this->getAmountField(); |
121 | | - |
122 | | - // card logos |
123 | | - $form .= '<tr>'; |
124 | | - $form .= '<td />'; |
125 | | - $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>'; |
126 | | - $form .= '</tr>'; |
127 | | - |
128 | | - // card number |
129 | | - $form .= $this->getCardNumberField(); |
130 | | - |
131 | | - // cvv |
132 | | - $form .= $this->getCvvField(); |
133 | | - |
134 | | - // expiry |
135 | | - $form .= $this->getExpiryField(); |
136 | | - |
137 | | - // street |
138 | | - $form .= $this->getStreetField(); |
139 | | - |
140 | | - // city |
141 | | - $form .= $this->getCityField(); |
142 | | - |
143 | | - // state |
144 | | - $form .= $this->getStateField(); |
145 | | - // zip |
146 | | - $form .= $this->getZipField(); |
147 | | - |
148 | | - // country |
149 | | - $form .= $this->getCountryField(); |
150 | | - |
151 | 158 | return $form; |
152 | 159 | } |
153 | 160 | |
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/Form.php |
— | — | @@ -458,14 +458,18 @@ |
459 | 459 | protected function getCardnumberField() { |
460 | 460 | global $wgPayflowGatewayTest; |
461 | 461 | $card_num = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'card_num' ] : ''; |
462 | | - |
463 | | - $form = '<tr>'; |
464 | | - $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card_num'] . '</span></td>'; |
465 | | - $form .= '</tr>'; |
| 462 | + $form = ''; |
| 463 | + if ( $this->form_errors['card_num'] ) { |
| 464 | + $form .= '<tr>'; |
| 465 | + $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card_num'] . '</span></td>'; |
| 466 | + $form .= '</tr>'; |
| 467 | + } |
| 468 | + if ( $this->form_errors['card'] ) { |
| 469 | + $form .= '<tr>'; |
| 470 | + $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card'] . '</span></td>'; |
| 471 | + $form .= '</tr>'; |
| 472 | + } |
466 | 473 | $form .= '<tr>'; |
467 | | - $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card'] . '</span></td>'; |
468 | | - $form .= '</tr>'; |
469 | | - $form .= '<tr>'; |
470 | 474 | $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-card-num' ), 'card_num' ) . '</td>'; |
471 | 475 | $form .= '<td>' . Xml::input( 'card_num', '30', $card_num, array( 'type' => 'text', 'maxlength' => '100', 'id' => 'card_num', 'class' => 'fullwidth', 'autocomplete' => 'off' ) ) . |
472 | 476 | '</td>'; |
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' )); |
106 | 106 | if ( $this->paypal ) { |
107 | 107 | $form .= Xml::hidden( 'PaypalRedirect', false ); |
108 | | - $form .= Xml::element( 'input', array( 'class' => 'input-button button-navyblue', 'value' => wfMsg( 'payflowpro_gateway-submit-button'), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit')); |
| 108 | + $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button'), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit')); |
109 | 109 | } else { |
110 | 110 | $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-cc-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit')); |
111 | 111 | $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button |
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | 'payflowpro_gateway-question-comment' => 'Questions or comments? Contact: <a href="mailto:donate@wikimedia.org">donate@wikimedia.org</a>', |
100 | 100 | 'payflowpro_gateway-donate-click' => 'Your credit card will be securely processed.', |
101 | 101 | 'payflowpro_gateway-otherways' => 'There are <a href="http://wikimediafoundation.org/wiki/Ways_to_Give/en">other ways to give, including PayPal, check, or mail</a>.', |
102 | | - 'payflowpro_gateway-paypal' => 'Have a PayPal account? <a href="$1/index.php/Special:PayflowProGateway?paypal=true&masthead=none&form_name=$2&text_template=2010/JimmyAppealLong&language=en&utm_source=$3&utm_medium=$4&utm_campaign=$5">Donate with PayPal</a>.', |
| 102 | + 'payflowpro_gateway-paypal' => 'Have a PayPal account? <a href="$1/index.php/Special:PayflowProGateway?_cache_=true&paypal=true&masthead=none&form_name=$2&text_template=2010/JimmyAppealLong&language=en&utm_source=$3&utm_medium=$4&utm_campaign=$5">Donate with PayPal</a>.', |
103 | 103 | '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>.', |
104 | 104 | 'payflowpro_gateway-token-mismatch' => 'Your session has expired. Please try filling out and submitting the form again.', |
105 | 105 | 'payflowpro_gateway-cc-form-header-personal' => 'Billing information', |
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/payflowpro_gateway.css |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | } |
32 | 32 | |
33 | 33 | #payflowpro_gateway-form-submit { |
34 | | - margin-top: 1.5em; |
| 34 | + margin-top: 1.2em; |
35 | 35 | text-align: center; |
36 | 36 | margin-bottom: 1em; |
37 | 37 | } |
Property changes on: branches/fundraising/deployment/DonationInterface |
___________________________________________________________________ |
Modified: svn:mergeinfo |
38 | 38 | Merged /trunk/extensions/DonationInterface:r75121-75137 |