r102805 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102804‎ | r102805 | r102806 >
Date:18:19, 11 November 2011
Author:jpostlethwaite
Status:ok
Tags:
Comment:
Fixed returnto for non credit card payments.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -1643,15 +1643,31 @@
16441644 * @param string $type request|response
16451645 */
16461646 protected function stage_returnto( $type = 'request' ) {
 1647+
16471648 if ( $type === 'request' ) {
1648 - // Add order ID to the returnto URL, only if it's not already there.
1649 - //TODO: This needs to be more robust (like actually pulling the
1650 - //qstring keys, resetting the values, and putting it all back)
1651 - //but for now it'll keep us alive.
 1649+
 1650+ // Get the default returnto
16521651 $returnto = $this->getData_Staged( 'returnto' );
1653 - if ( !is_null( $returnto ) && !strpos( $returnto, 'order_id' ) ){
1654 - $queryArray = array( 'order_id' => $this->staged_data['order_id'] );
1655 - $this->staged_data['returnto'] = wfAppendQuery( $returnto, $queryArray );
 1652+
 1653+ if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){
 1654+
 1655+ // Add order ID to the returnto URL, only if it's not already there.
 1656+ //TODO: This needs to be more robust (like actually pulling the
 1657+ //qstring keys, resetting the values, and putting it all back)
 1658+ //but for now it'll keep us alive.
 1659+ if ( !is_null( $returnto ) && !strpos( $returnto, 'order_id' ) ){
 1660+ $queryArray = array( 'order_id' => $this->staged_data['order_id'] );
 1661+ $this->staged_data['returnto'] = wfAppendQuery( $returnto, $queryArray );
 1662+ }
 1663+
 1664+ } elseif ( $this->getData_Raw( 'payment_method' ) === 'rtbt' ) {
 1665+
 1666+ $this->staged_data['returnto'] = $this->getThankYouPage();
 1667+
 1668+ } else {
 1669+
 1670+ // Do we want to set this here?
 1671+ $this->staged_data['returnto'] = $returnto;
16561672 }
16571673 }
16581674 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r102842MFT r102576, r102577, r102579, r102581, r102804, r102805, r102812, r102819, r...awjrichards02:20, 12 November 2011
r102929Re-attempting MFT r102576, r102577, r102578, r102579, r102581, r102689, r1027...khorn00:50, 14 November 2011

Status & tagging log