Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -74,6 +74,9 @@ |
75 | 75 | /** |
76 | 76 | * handle PayPal redirection |
77 | 77 | * |
| 78 | + * @todo |
| 79 | + * - Redirect to the bank needs some error checking on the url. Verify that it is https... |
| 80 | + * |
78 | 81 | * if paypal redirection is enabled ($wgPayflowProGatewayPaypalURL must be defined) |
79 | 82 | * and the PaypalRedirect form value must be true |
80 | 83 | */ |
— | — | @@ -113,15 +116,47 @@ |
114 | 117 | // allow any external validators to have their way with the data |
115 | 118 | // Execute the proper transaction code: |
116 | 119 | |
117 | | - $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
118 | | - |
119 | | - $this->displayResultsForDebug( $result ); |
120 | 120 | |
121 | 121 | if ( $payment_method == 'cc' ) { |
122 | 122 | |
| 123 | + $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
123 | 124 | $this->executeIframeForCreditCard( $result ); |
124 | 125 | } |
| 126 | + elseif ( $payment_method == 'rtbt' ) { |
125 | 127 | |
| 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 | + } |
126 | 161 | } |
127 | 162 | } else { |
128 | 163 | // Display form for the first time |