r100789 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100788‎ | r100789 | r100790 >
Date:04:53, 26 October 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:fundraising 
Comment:
Added ISSUERID to transaction for real time bank transfer.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -663,6 +663,11 @@
664664 $this->postdata['payment_product'] = 809;
665665 $this->var_map['PAYMENTPRODUCTID'] = 'payment_product';
666666 $this->var_map['ISSUERID'] = 'issuer_id';
 667+
 668+ // Add the ISSUERID field if it does not exist
 669+ if ( !in_array( 'ISSUERID', $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'] ) ) {
 670+ $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'][] = 'ISSUERID';
 671+ }
667672 break;
668673
669674 case 'rtbt_enets':
@@ -679,6 +684,11 @@
680685 $this->postdata['payment_product'] = 856;
681686 $this->var_map['PAYMENTPRODUCTID'] = 'payment_product';
682687 $this->var_map['ISSUERID'] = 'issuer_id';
 688+
 689+ // Add the ISSUERID field if it does not exist
 690+ if ( !in_array( 'ISSUERID', $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'] ) ) {
 691+ $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'][] = 'ISSUERID';
 692+ }
683693 break;
684694 }
685695 }

Comments

#Comment by Khorn (WMF) (talk | contribs)   19:11, 27 October 2011

I was going to say "you may want to consider functionalizing the repeated code here" but it looks like one of them collapsed. May still end up being a good idea if you have to do stuff like this a lot, though.

Status & tagging log