r79367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79366‎ | r79367 | r79368 >
Date:20:39, 31 December 2010
Author:kaldari
Status:deferred
Tags:
Comment:
support for separate shipping country
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnPremium.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -1031,7 +1031,7 @@
10321032 'city2' => $wgRequest->getText( 'city' ),
10331033 'state2' => $wgRequest->getText( 'state' ),
10341034 'zip2' => $wgRequest->getText( 'zip' ),
1035 - 'country2' => $wgRequest->getText( 'country' ),
 1035+ 'country2' => $wgRequest->getText( 'country2', $wgRequest->getText( 'country' ) ),
10361036 'size' => $wgRequest->getText( 'size' ),
10371037 'premium_language' => $wgRequest->getText( 'premium_language', "en" ),
10381038 'card_num' => str_replace( ' ', '', $wgRequest->getText( 'card_num' ) ),
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -624,13 +624,13 @@
625625 return $form;
626626 }
627627
628 - protected function getCountryField() {
 628+ protected function getCountryField( $defaultCountry = null ) {
629629 $form = '<tr>';
630630 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country'] . '</span></td>';
631631 $form .= '</tr>';
632632 $form .= '<tr>';
633633 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-country' ), 'country' ) . '</td>';
634 - $form .= '<td>' . $this->generateCountryDropdown() . '</td>';
 634+ $form .= '<td>' . $this->generateCountryDropdown( $defaultCountry ) . '</td>';
635635 $form .= '</tr>';
636636 return $form;
637637 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnPremium.php
@@ -142,7 +142,24 @@
143143 $form .= $this->getZipField();
144144
145145 // country
146 - $form .= $this->getCountryField();
 146+ $form .= $this->getCountryField( $this->form_data[ 'country2' ] );
 147+
 148+ /*
 149+ $form .= '<tr>';
 150+ $form .= '<td colspan="2"><span class="creditcard-error-msg"></span></td>';
 151+ $form .= '</tr>';
 152+ $form .= '<tr>';
 153+ $form .= '<td colspan="2"><label for="shipping"><input id="shipping" name="shipping" type="checkbox" checked="checked"/> '.wfMsg( 'payflowpro_gateway-shipping-address-same' ).'</label></td>';
 154+ $form .= '</tr>';
 155+
 156+ $form .= '<tr>';
 157+ $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country2'] . '</span></td>';
 158+ $form .= '</tr>';
 159+ $form .= '<tr>';
 160+ $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-country' ), 'country2' ) . '</td>';
 161+ $form .= '<td>' . $this->generateCountryDropdown() . '</td>';
 162+ $form .= '</tr>';
 163+ */
147164
148165 return $form;
149166 }
@@ -157,6 +174,9 @@
158175 foreach ( $hidden_fields as $field => $value ) {
159176 $form .= Html::hidden( $field, $value );
160177 }
 178+
 179+ // Temporary
 180+ $form .= Html::hidden( 'country2', $this->form_data[ 'country2' ] );
161181
162182 $form .= Xml::closeElement( 'form' ); // close form 'payment'
163183 $form .= $this->generateDonationFooter();

Status & tagging log