r103244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103243‎ | r103244 | r103245 >
Date:22:18, 15 November 2011
Author:jpostlethwaite
Status:ok
Tags:
Comment:
Commented out optional fields for direct debit transactions. Translating error messages for DO_BANKVALIDATION. Only the first message will be returned since they are all the same message. They do have different error codes.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -758,7 +758,7 @@
759759 'label' => 'Direct debit: AT',
760760 'group' => 'dd',
761761 'validation' => array(),
762 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', 'BANKNAME', 'DIRECTDEBITTEXT', ),
 762+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', /*'BANKNAME',*/ 'DIRECTDEBITTEXT', ),
763763 );
764764
765765 // Direct debit: BE
@@ -768,6 +768,7 @@
769769 'group' => 'dd',
770770 'validation' => array(),
771771 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'AUTHORISATIONID', 'BANKCHECKDIGIT', 'BANKCODE', 'BANKNAME', 'DIRECTDEBITTEXT', ),
 772+ //'keys' => array( /*'ACCOUNTNAME',*/ 'ACCOUNTNUMBER', 'AUTHORISATIONID', /*'BANKCHECKDIGIT',*/ 'BANKCODE', /*'BANKNAME',*/ 'DIRECTDEBITTEXT', ),
772773 );
773774
774775 // Direct debit: CH
@@ -776,7 +777,7 @@
777778 'label' => 'Direct debit: CH',
778779 'group' => 'dd',
779780 'validation' => array(),
780 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'ADDRESSLINE1E', 'ADDRESSLINE2', 'ADDRESSLINE3', 'ADDRESSLINE4', 'BANKCODE', 'BANKNAME', 'CUSTOMERBANKCITY', 'CUSTOMERBANKNUMBER', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP', 'DIRECTDEBITTEXT', 'IBAN', ),
 781+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'ADDRESSLINE1E', 'ADDRESSLINE2', 'ADDRESSLINE3', 'ADDRESSLINE4', 'BANKCODE', /*'BANKNAME',*/ /*'CUSTOMERBANKCITY', 'CUSTOMERBANKNUMBER', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP',*/ 'DIRECTDEBITTEXT', 'IBAN', ),
781782 );
782783
783784 // Direct debit: DE
@@ -785,7 +786,7 @@
786787 'label' => 'Direct debit: DE',
787788 'group' => 'dd',
788789 'validation' => array(),
789 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', 'BANKNAME', 'DIRECTDEBITTEXT', ),
 790+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', /*'BANKNAME',*/ 'DIRECTDEBITTEXT', ),
790791 );
791792
792793 // Direct debit: ES
@@ -794,7 +795,7 @@
795796 'label' => 'Direct debit: ES',
796797 'group' => 'dd',
797798 'validation' => array(),
798 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', 'BANKNAME', 'BRANCHCODE', 'BANKCHECKDIGIT', 'CUSTOMERBANKCITY', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP', 'DIRECTDEBITTEXT', 'DOMICILIO', 'PROVINCIA', ),
 799+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', /*'BANKNAME',*/ 'BRANCHCODE', 'BANKCHECKDIGIT', /*'CUSTOMERBANKCITY', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP',*/ 'DIRECTDEBITTEXT', /*'DOMICILIO', 'PROVINCIA',*/ ),
799800 );
800801
801802 // Direct debit: FR
@@ -803,7 +804,7 @@
804805 'label' => 'Direct debit: FR',
805806 'group' => 'dd',
806807 'validation' => array(),
807 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', 'BANKNAME', 'BRANCHCODE', 'BANKCHECKDIGIT', 'DIRECTDEBITTEXT', ),
 808+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', /*'BANKNAME',*/ 'BRANCHCODE', 'BANKCHECKDIGIT', 'DIRECTDEBITTEXT', ),
808809 );
809810
810811 // Direct debit: GB
@@ -812,7 +813,7 @@
813814 'label' => 'Direct debit: GB',
814815 'group' => 'dd',
815816 'validation' => array(),
816 - 'keys' => array( 'ACCOUNTNUMBER', 'AUTHORISATIONID', 'BANKCODE', 'BANKNAME', 'DIRECTDEBITTEXT', 'TRANSACTIONTYPE', ),
 817+ 'keys' => array( 'ACCOUNTNUMBER', 'AUTHORISATIONID', 'BANKCODE', /*'BANKNAME',*/ 'DIRECTDEBITTEXT', 'TRANSACTIONTYPE', ),
817818 );
818819
819820 // Direct debit: IT
@@ -821,7 +822,7 @@
822823 'label' => 'Direct debit: IT',
823824 'group' => 'dd',
824825 'validation' => array(),
825 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', 'BANKNAME', 'BRANCHCODE', 'BANKAGENZIA', 'BANKCHECKDIGIT', 'BANKFILIALE', 'CUSTOMERBANKCITY', 'CUSTOMERBANKNUMBER', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP', 'DIRECTDEBITTEXT', ),
 826+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKCODE', /*'BANKNAME',*/ 'BRANCHCODE', 'BANKAGENZIA', 'BANKCHECKDIGIT', /*'BANKFILIALE',*/ /*'CUSTOMERBANKCITY', 'CUSTOMERBANKNUMBER', 'CUSTOMERBANKSTREET', 'CUSTOMERBANKZIP',*/ 'DIRECTDEBITTEXT', ),
826827 );
827828
828829 // Direct debit: NL
@@ -830,7 +831,7 @@
831832 'label' => 'Direct debit: NL',
832833 'group' => 'dd',
833834 'validation' => array(),
834 - 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', 'BANKNAME', 'DIRECTDEBITTEXT', 'TRANSACTIONTYPE', ),
 835+ 'keys' => array( 'ACCOUNTNAME', 'ACCOUNTNUMBER', /*'BANKNAME',*/ 'DIRECTDEBITTEXT', 'TRANSACTIONTYPE', ),
835836 );
836837
837838 /*
@@ -1437,6 +1438,9 @@
14381439 /**
14391440 * Set the bank validation error messages for the client.
14401441 *
 1442+ * @todo
 1443+ * - Only the first message will be returned. The reason is there are no translations for DO_BANKVALIDATION
 1444+ *
14411445 * The messages have already been generated at this point. The purpose of
14421446 * this method is to pass them to the view.
14431447 */
@@ -1448,7 +1452,15 @@
14491453
14501454 $errors = isset( $checks['errors'] ) ? $checks['errors'] : array();
14511455
1452 - $this->setTransactionResult( $errors, 'errors' );
 1456+ $errorsToBeDisplayed = array();
 1457+ foreach ( $errors as $code => $error ) {
 1458+ $errorsToBeDisplayed[ $code ] = $this->getErrorMapByCodeAndTranslate( $code );
 1459+
 1460+ // This break is temporary. All errors will have the same message. Only display it once.
 1461+ break;
 1462+ }
 1463+
 1464+ $this->setTransactionResult( $errorsToBeDisplayed, 'errors' );
14531465 }
14541466
14551467 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r103847MFT r102338, r102681, r102685, r102810, r102828, r102829, r102832, r102836, r...khorn22:30, 21 November 2011
r103848MFT r102338, r102681, r102685, r102810, r102828, r102829, r102832, r102836, r...khorn22:31, 21 November 2011

Status & tagging log