r102086 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102085‎ | r102086 | r102087 >
Date:04:41, 5 November 2011
Author:jpostlethwaite
Status:resolved (Comments)
Tags:fundraising 
Comment:
Added method: addKeyToTransaction(). This is a helper to modify the transaction INSERT_ORDERWITHPAYMENT.
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -587,6 +587,18 @@
588588 }
589589
590590 /**
 591+ * Add a key to the transaction INSERT_ORDERWITHPAYMENT.
 592+ *
 593+ * $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS'][ $key ][] = $value
 594+ */
 595+ protected function addKeyToTransaction( $value, $type = 'PAYMENT' ) {
 596+
 597+ if ( !in_array( $value, $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS'][ $type ] ) ) {
 598+ $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS'][ $type ][] = $value;
 599+ }
 600+ }
 601+
 602+ /**
591603 * Builds a set of transaction data in name/value format
592604 * *)The current transaction must be set before you call this function.
593605 * *)Uses getTransactionSpecificValue to assign staged values to the

Follow-up revisions

RevisionCommit summaryAuthorDate
r102151Moved the method addKeyToTransaction() out of parent class. The logic was gat...jpostlethwaite04:15, 6 November 2011
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 Khorn (WMF) (talk | contribs)   18:24, 5 November 2011

This function should either live in the globalcollect adapter, or be abstracted in such a way that any gateway can use it (probably way easier to just put it in the GC-specific gateweay - that way you don't have to consider non-xml transactions, or searching the xml tree structure to find the correct node). Please do not put gateway-specific code in the gateway-agnostic GatewayAdapter class.

Status & tagging log