r106707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106706‎ | r106707 | r106708 >
Date:22:05, 19 December 2011
Author:khorn
Status:ok
Tags:
Comment:
Adds the ability to do recurring payments via globalcollect. All that remains is to add a "recurring" field to GC recurring forms (hidden or checkbox shouldn't matter).
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js
@@ -54,6 +54,7 @@
5555 'utm_campaign': $( "input[name='utm_campaign']" ).val(),
5656 'utm_medium': $( "input[name='utm_medium']" ).val(),
5757 'referrer': $( "input[name='referrer']" ).val(),
 58+ 'recurring': $( "input[name='recurring']" ).val(),
5859 'format': 'json'
5960 };
6061 $.ajax( {
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js
@@ -56,6 +56,7 @@
5757 'utm_campaign': $( "input[name='utm_campaign']" ).val(),
5858 'utm_medium': $( "input[name='utm_medium']" ).val(),
5959 'referrer': $( "input[name='referrer']" ).val(),
 60+ 'recurring': $( "input[name='recurring']" ).val(),
6061 'format': 'json'
6162 };
6263 $.ajax( {
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -1685,6 +1685,7 @@
16861686 'issuer_id',
16871687 'order_id', //This may or may not oughta-be-here...
16881688 'language',
 1689+ 'recurring'
16891690 );
16901691 }
16911692
@@ -2009,6 +2010,22 @@
20102011 }
20112012
20122013 /**
 2014+ * Stage: recurring
 2015+ * Adds the recurring payment pieces to the structure of
 2016+ * INSERT_ORDERWITHPAYMENT if the recurring field is populated.
 2017+ *
 2018+ * @param string $type request|response
 2019+ */
 2020+ protected function stage_recurring( $type = 'request' ){
 2021+ if ( ! $this->getData_Staged( 'recurring' ) ){
 2022+ return;
 2023+ } else {
 2024+ $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['ORDER'][] = 'ORDERTYPE';
 2025+ $this->transactions['INSERT_ORDERWITHPAYMENT']['values']['ORDERTYPE'] = '4';
 2026+ }
 2027+ }
 2028+
 2029+ /**
20132030 * Add keys to transaction for submethod
20142031 *
20152032 */
Index: trunk/extensions/DonationInterface/gateway_common/donation.api.php
@@ -113,6 +113,7 @@
114114 'utm_campaign' => $this->defineParam( false ),
115115 'utm_medium' => $this->defineParam( false ),
116116 'referrer' => $this->defineParam( false ),
 117+ 'recurring' => $this->defineParam( false ),
117118 );
118119 }
119120
@@ -182,6 +183,7 @@
183184 'utm_campaign' => 'Tracking variable',
184185 'utm_medium' => 'Tracking variable',
185186 'referrer' => 'Original referrer',
 187+ 'recurring' => 'Optional - indicates that the transaction is meant to be recurring.',
186188 );
187189 }
188190
Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php
@@ -136,6 +136,7 @@
137137 'transaction_type' => $wgRequest->getText( 'transaction_type', null ),
138138 'form_name' => $wgRequest->getText( 'form_name', null ),
139139 'ffname' => $wgRequest->getText( 'ffname', null ),
 140+ 'recurring' => $wgRequest->getVal( 'recurring', null ), //boolean type
140141 );
141142 if ( !$this->wasPosted() ) {
142143 $this->setVal( 'posted', false );
@@ -1428,6 +1429,7 @@
14291430 '_cache_',
14301431 'anonymous',
14311432 'optout',
 1433+ 'recurring',
14321434 );
14331435
14341436 foreach ($boolean as $key){

Follow-up revisions

RevisionCommit summaryAuthorDate
r106832Adds a "recurring" key to the stomp message in a way that amounts to it being...khorn18:45, 20 December 2011
r106896MFT r106707, r106832, r106853, r106854, r106855khorn23:58, 20 December 2011
r106897MFT r106707, r106832, r106853, r106854, r106855khorn23:59, 20 December 2011

Status & tagging log