r97115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97114‎ | r97115 | r97116 >
Date:23:43, 14 September 2011
Author:khorn
Status:resolved (Comments)
Tags:fundraising 
Comment:
Removing GC's ability to send credit card info
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -31,6 +31,15 @@
3232 $this->postdata['expiry'] = $this->postdata['expiration']; //. ($this->postdata['year'] % 100);
3333 $this->postdata['card_num'] = str_replace(' ', '', $this->postdata['card_num']);
3434
 35+ $returnto = '';
 36+ if (array_key_exists('returnto', $this->postdata)){
 37+ $returnto = $this->postdata['returnto'];
 38+ } else {
 39+ $returnto = $this->postdatadefaults['returnto'];
 40+ }
 41+
 42+ $this->postdata['returnto'] = $returnto . "?order_id=" . $this->postdata['order_id'];
 43+
3544 }
3645
3746 function defineAccountInfo() {
@@ -101,9 +110,9 @@
102111 'COUNTRYCODE',
103112 'HOSTEDINDICATOR',
104113 'RETURNURL',
105 - 'CVV',
106 - 'EXPIRYDATE',
107 - 'CREDITCARDNUMBER',
 114+// 'CVV',
 115+// 'EXPIRYDATE',
 116+// 'CREDITCARDNUMBER',
108117 'FIRSTNAME',
109118 'SURNAME',
110119 'STREET',
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -135,6 +135,7 @@
136136 'country' => 'US',
137137 'returnto' => $returnto,
138138 'user_ip' => ( self::getGlobal( 'Test' ) ) ? '12.12.12.12' : wfGetIP(), // current user's IP address
 139+ 'card_type' => 'visa',
139140 );
140141 }
141142

Follow-up revisions

RevisionCommit summaryAuthorDate
r100923Builds a minimal querystring with wfArrayToCGI() instead of manually with no ...khorn00:51, 27 October 2011
r101857follow-up to r100923 and r97115 - better method for constructing URLkaldari19:12, 3 November 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   18:41, 23 September 2011

Please note that this branch is in the middle of a serious refactoring, and is by no means ready to be merged back into trunk. (Latest DonationInterface branch rev at the time of this comment is r97833.)

#Comment by Khorn (WMF) (talk | contribs)   23:49, 7 October 2011

Not sure why this is a fixme, but I can mention that the staging stuff is vastly different now, and everything else makes total sense.

#Comment by Awjrichards (talk | contribs)   20:45, 21 October 2011

I must've forgotten to lave a comment.

+		$this->postdata['returnto'] = $returnto . "?order_id=" . $this->postdata['order_id'];

Query strings like this should be constructed with MW magic eg wfArrayToCGI(). $this->postdata['order_id'] should also be escaped.

#Comment by Khorn (WMF) (talk | contribs)   00:52, 27 October 2011

Took your advice in r100923 :)

Status & tagging log