r101823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101822‎ | r101823 | r101824 >
Date:15:44, 3 November 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:fundraising 
Comment:
Added helper methods: getTransactionDataFormAction() and getTransactionDataLanguage().
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -701,7 +701,7 @@
702702 //are frequently packaged togther in the same place, whether the transaction passed or failed.
703703 $this->setTransactionResult( $this->getResponseErrors( $formatted ), 'errors' );
704704
705 - //if we're still okay (hey, even if we're not), get relevent dataz.
 705+ //if we're still okay (hey, even if we're not), get relevent data.
706706 $pulled_data = $this->getResponseData( $formatted );
707707 $this->setTransactionResult( $pulled_data, 'data' );
708708
@@ -1484,6 +1484,38 @@
14851485 }
14861486 }
14871487
 1488+ /**
 1489+ * Returns false if FORMACTION does not exist or string if it does exist
 1490+ *
 1491+ * @return false|string
 1492+ */
 1493+ public function getTransactionDataFormAction() {
 1494+
 1495+ $data = $this->getTransactionData();
 1496+
 1497+ if ( is_array( $data ) && array_key_exists( 'FORMACTION', $data ) ) {
 1498+ return $data['FORMACTION'];
 1499+ } else {
 1500+ return false;
 1501+ }
 1502+ }
 1503+
 1504+ /**
 1505+ * Returns false if language does not exist or string if it does exist
 1506+ *
 1507+ * @return false|string
 1508+ */
 1509+ public function getTransactionDataLanguage() {
 1510+
 1511+ $data = $this->getTransactionData();
 1512+
 1513+ if ( is_array( $data ) && array_key_exists( 'language', $data ) ) {
 1514+ return $data['language'];
 1515+ } else {
 1516+ return false;
 1517+ }
 1518+ }
 1519+
14881520 public function setFormClass( $formClassName ) {
14891521 //I'm adding this because Captcha needs it, and we're gonna fire the hook inside. Nothing else really needs it as far as I know.
14901522 $this->form_class = $formClassName;

Follow-up revisions

RevisionCommit summaryAuthorDate
r102236MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:06, 7 November 2011
r102237MFT r90286, r100671, r100837, r100950, r101060, r101063, r101064, r101073, r1......khorn03:07, 7 November 2011

Comments

#Comment by Jpostlethwaite (talk | contribs)   15:46, 3 November 2011

These have been added so we can stop handling the raw data in GlobalCollectGateway::execute().

#Comment by Khorn (WMF) (talk | contribs)   18:33, 5 November 2011

Two more functions that are definitely gateway- and transaction-specific, in the main adapter class. Please do not put gateway-specific code in the main Gateway Adapter class.

Status & tagging log