r102740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102739‎ | r102740 | r102741 >
Date:02:30, 11 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
fixing GlobalCollect Gateway for field length limits imposed by GlobalCollect
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -1363,6 +1363,12 @@
13641364 public function defineStagedVars() {
13651365 //OUR field names.
13661366 $this->staged_vars = array(
 1367+ 'fname',
 1368+ 'lname',
 1369+ 'street',
 1370+ 'city',
 1371+ 'state',
 1372+ 'email',
13671373 'amount',
13681374 'card_type',
13691375 //'card_num',
@@ -1375,6 +1381,36 @@
13761382 );
13771383 }
13781384
 1385+ protected function stage_fname( $type = 'request' ) {
 1386+ // Truncate to 15 characters due to GlobalCollect's field length limit
 1387+ $this->staged_data['fname'] = substr( $this->staged_data['fname'], 0, 15 );
 1388+ }
 1389+
 1390+ protected function stage_lname( $type = 'request' ) {
 1391+ // Truncate to 35 characters due to GlobalCollect's field length limit
 1392+ $this->staged_data['lname'] = substr( $this->staged_data['lname'], 0, 35 );
 1393+ }
 1394+
 1395+ protected function stage_street( $type = 'request' ) {
 1396+ // Truncate to 50 characters due to GlobalCollect's field length limit
 1397+ $this->staged_data['street'] = substr( $this->staged_data['street'], 0, 50 );
 1398+ }
 1399+
 1400+ protected function stage_city( $type = 'request' ) {
 1401+ // Truncate to 40 characters due to GlobalCollect's field length limit
 1402+ $this->staged_data['city'] = substr( $this->staged_data['city'], 0, 40 );
 1403+ }
 1404+
 1405+ protected function stage_state( $type = 'request' ) {
 1406+ // Truncate to 35 characters due to GlobalCollect's field length limit
 1407+ $this->staged_data['state'] = substr( $this->staged_data['state'], 0, 35 );
 1408+ }
 1409+
 1410+ protected function stage_email( $type = 'request' ) {
 1411+ // Truncate to 70 characters due to GlobalCollect's field length limit
 1412+ $this->staged_data['email'] = substr( $this->staged_data['email'], 0, 70 );
 1413+ }
 1414+
13791415 protected function stage_language( $type = 'request' ) {
13801416 $language = strtolower( $this->staged_data['language'] );
13811417

Follow-up revisions

RevisionCommit summaryAuthorDate
r102806MFT r102740awjrichards18:53, 11 November 2011

Status & tagging log