r99407 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99406‎ | r99407 | r99408 >
Date:16:38, 10 October 2011
Author:khorn
Status:ok
Tags:fundraising 
Comment:
Cleans up some confusion surrounding the gateway_txn_id in the two available payment gateways.
r97780
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/activemq_stomp/activemq_stomp.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro.adapter.php
@@ -208,6 +208,7 @@
209209 function processResponse( $response ) {
210210 //set the transaction result message
211211 $this->setTransactionResult( $response['RESPMSG'], 'txn_message' );
 212+ $this->setTransactionResult( $response['PNREF'], 'gateway_txn_id' );
212213 }
213214
214215 function defineStagedVars() {
Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -294,6 +294,7 @@
295295 function processResponse( $response ) {
296296 //set the transaction result message
297297 $this->setTransactionResult( "Response Status: " . $response['STATUSID'], 'txn_message' ); //TODO: Translate for GC.
 298+ $this->setTransactionResult( $this->getData( 'order_id' ), 'gateway_txn_id' );
298299 }
299300
300301 /**
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -927,6 +927,8 @@
928928 $transaction = array(
929929 'response' => $this->getTransactionMessage(),
930930 'date' => time(),
 931+ 'gateway_txn_id' => $this->getTransactionGatewayTxnID(),
 932+ 'language' => '',
931933 );
932934 $transaction += $this->getData();
933935
@@ -1090,6 +1092,14 @@
10911093 }
10921094 }
10931095
 1096+ public function getTransactionGatewayTxnID() {
 1097+ if ( array_key_exists( 'gateway_txn_id', $this->transaction_results ) ) {
 1098+ return $this->transaction_results['gateway_txn_id'];
 1099+ } else {
 1100+ return false;
 1101+ }
 1102+ }
 1103+
10941104 /**
10951105 * Returns the FORMATTED data harvested from the reply, or false if it is not set.
10961106 * @return mixed An array of returned data, or false.
Index: branches/fundraising/extensions/DonationInterface/activemq_stomp/activemq_stomp.php
@@ -164,7 +164,7 @@
165165 'country_2' => $transaction['country2'],
166166 'postal_code_2' => $transaction['zip2'],
167167 'gateway' => $transaction['gateway'],
168 - 'gateway_txn_id' => $transaction['order_id'], //pretty sure.
 168+ 'gateway_txn_id' => $transaction['gateway_txn_id'],
169169 'response' => $transaction['response'],
170170 'currency' => $transaction['currency'],
171171 'original_currency' => $transaction['currency'],

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97780Card #282, and a significant redefinition of what it means to stage gateway d...khorn02:02, 22 September 2011

Status & tagging log