r101558 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101557‎ | r101558 | r101559 >
Date:00:06, 2 November 2011
Author:jpostlethwaite
Status:reverted (Comments)
Tags:fundraising 
Comment:
Updated GlobalCollect to accept direct debit. See r101557.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -74,6 +74,9 @@
7575 /**
7676 * handle PayPal redirection
7777 *
 78+ * @todo
 79+ * - Redirect to the bank needs some error checking on the url. Verify that it is https...
 80+ *
7881 * if paypal redirection is enabled ($wgPayflowProGatewayPaypalURL must be defined)
7982 * and the PaypalRedirect form value must be true
8083 */
@@ -113,15 +116,47 @@
114117 // allow any external validators to have their way with the data
115118 // Execute the proper transaction code:
116119
117 - $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
118 -
119 - $this->displayResultsForDebug( $result );
120120
121121 if ( $payment_method == 'cc' ) {
122122
 123+ $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
123124 $this->executeIframeForCreditCard( $result );
124125 }
 126+ elseif ( $payment_method == 'rtbt' ) {
125127
 128+ $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
 129+
 130+ $formAction = ( isset( $result['data'] ) && isset($result['data']['FORMACTION']) ) ? $result['data']['FORMACTION'] : '';
 131+
 132+ // Redirect to the bank
 133+ if ( !empty( $formAction ) ) {
 134+ return $wgOut->redirect( $formAction );
 135+ }
 136+
 137+ }
 138+ elseif ( $payment_method == 'dd' ) {
 139+
 140+ $result = $this->adapter->do_transaction( 'DO_BANKVALIDATION' );
 141+
 142+ if ( isset( $result['status'] ) && $result['status'] ) {
 143+
 144+ $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
 145+ }
 146+
 147+ }
 148+ else {
 149+ $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
 150+ }
 151+
 152+ $this->displayResultsForDebug( $result );
 153+
 154+ if ( isset( $result['status'] ) && $result['status'] ) {
 155+ $thankyoupage = $this->adapter->getGlobal( 'ThankYouPage' );
 156+
 157+ if ( $thankyoupage ) {
 158+ $wgOut->redirect( $thankyoupage . "/" . $data['language'] );
 159+ }
 160+ }
126161 }
127162 } else {
128163 // Display form for the first time

Follow-up revisions

RevisionCommit summaryAuthorDate
r101778Had to revert this, because it both breaks GC non-ajax-based CC forms, and wi...khorn02:22, 3 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101557Updated GlobalCollect Adapter to include Direct Debit.jpostlethwaite00:03, 2 November 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   01:59, 3 November 2011

This is totally the commit that causes GlobalCollect CC payments to not display the iFrame in the default form (The others don't post back to this page, and instead do an ajax call to ourselves to get the URL, which is why it's not an issue there). Also, please check the return descriptions on do_transaction: Checking $results['status'] will only tell you if we were able to communicate with the server or not. You probably want to switch on the adapter's getTransactionWMFStatus.

Status & tagging log