r92825 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92824‎ | r92825 | r92826 >
Date:23:24, 21 July 2011
Author:awjrichards
Status:ok (Comments)
Tags:
Comment:
Fixing 'country2' handling in DonationInterface. We don't really support a country2 field, but for legacy reasons, it's possible that a country2 value will be passed into the form (when dealing with premium gifts eg t-shirts). To protect downstream processing of premium gift data, I left the coutnry2 field in - if however it is not present or is a 0-length string (also a possible scenario...) then the value gets sent to whatve the value for 'country' is.
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -1057,7 +1057,12 @@
10581058 'city2' => $wgRequest->getText( 'city' ),
10591059 'state2' => $wgRequest->getText( 'state' ),
10601060 'zip2' => $wgRequest->getText( 'zip' ),
1061 - 'country2' => $wgRequest->getText( 'country2', $wgRequest->getText( 'country' ) ),
 1061+ /**
 1062+ * For legacy reasons, we might get a 0-length string passed into the form for country2. If this happens, we need to set country2
 1063+ * to be 'country' for downstream processing (until we fully support passing in two separate addresses). I thought about completely
 1064+ * disabling country2 support in the forms, etc but realized there's a chance it'll be resurrected shortly. Hence this silly hack.
 1065+ */
 1066+ 'country2' => ( strlen( $wgRequest->getText( 'country2', '' ))) ? $wgRequest->getText( 'country2' ) : $wgRequest->getText( 'country' ),
10621067 'size' => $wgRequest->getText( 'size' ),
10631068 'premium_language' => $wgRequest->getText( 'premium_language', "en" ),
10641069 'card_num' => str_replace( ' ', '', $wgRequest->getText( 'card_num' ) ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r92829Followup r92825awjrichards23:50, 21 July 2011
r92830MFT r92825 for premiums-related country fixawjrichards23:52, 21 July 2011

Comments

#Comment by Kaldari (talk | contribs)   23:48, 21 July 2011

Looks fine. The ", " part is redundant I believe, but doesn't hurt anything.

Status & tagging log