Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -1643,15 +1643,31 @@ |
1644 | 1644 | * @param string $type request|response |
1645 | 1645 | */ |
1646 | 1646 | protected function stage_returnto( $type = 'request' ) { |
| 1647 | + |
1647 | 1648 | 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 |
1652 | 1651 | $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; |
1656 | 1672 | } |
1657 | 1673 | } |
1658 | 1674 | } |