Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | /** |
176 | 176 | * Hook to supply the page address of the payment gateway |
177 | 177 | * |
178 | | - * The user will redirected here with supplied data with input data appended (GET). |
| 178 | + * The user will be redirected here with supplied data with input data appended (GET). |
179 | 179 | * For example, if $url[$key] = index.php?title=Special:PayflowProGateway |
180 | 180 | * the result might look like this: http://www.yourdomain.com/index.php?title=Special:PayflowProGateway&amount=75.00¤cy_code=USD&payment_method=payflow |
181 | 181 | */ |
Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * Holds the GlobalCollect response from a transaction |
22 | 22 | * @var array |
23 | 23 | */ |
24 | | - public $payflow_response = array( ); |
| 24 | + public $payflow_response = array(); |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * A container for the form class |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | * An array of form errors |
36 | 36 | * @var array |
37 | 37 | */ |
38 | | - public $errors = array( ); |
| 38 | + public $errors = array(); |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Constructor - set up the new special page |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | */ |
55 | 55 | public function execute( $par ) { |
56 | 56 | global $wgRequest, $wgOut, $wgExtensionAssetsPath, |
57 | | - $wgPayFlowProGatewayCSSVersion; |
| 57 | + $wgPayFlowProGatewayCSSVersion; |
58 | 58 | |
59 | 59 | $wgOut->addExtensionStyle( |
60 | 60 | $wgExtensionAssetsPath . '/DonationInterface/gateway_forms/css/gateway.css?284' . |
— | — | @@ -80,6 +80,7 @@ |
81 | 81 | |
82 | 82 | $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) ); |
83 | 83 | |
| 84 | + // Make the wiki logo not clickable. |
84 | 85 | // @fixme can this be moved into the form generators? |
85 | 86 | $js = <<<EOT |
86 | 87 | <script type="text/javascript"> |
— | — | @@ -89,9 +90,9 @@ |
90 | 91 | </script> |
91 | 92 | EOT; |
92 | 93 | $wgOut->addHeadItem( 'logolinkoverride', $js ); |
93 | | - |
| 94 | + |
94 | 95 | $this->setHeaders(); |
95 | | - |
| 96 | + |
96 | 97 | //TODO: This is short-circuiting what I really want to do here. |
97 | 98 | //so stop it. |
98 | 99 | $data = $this->adapter->getDisplayData(); |
— | — | @@ -99,13 +100,16 @@ |
100 | 101 | // dispatch forms/handling |
101 | 102 | if ( $this->adapter->checkTokens() ) { |
102 | 103 | if ( $this->adapter->posted && $data['payment_method'] == 'processed' ) { |
103 | | - $this->adapter->log( "Posted and processed." ); |
| 104 | + // The form was submitted and the payment method has been set |
| 105 | + $this->adapter->log("Form posted and payment method set."); |
104 | 106 | |
105 | 107 | // increase the count of attempts |
106 | 108 | //++$data['numAttempt']; |
107 | | - // Check form for errors and redisplay with messages |
| 109 | + |
| 110 | + // Check form for errors |
108 | 111 | $form_errors = $this->fnPayflowValidateForm( $data, $this->errors ); |
109 | 112 | |
| 113 | + // If there were errors, redisplay form, otherwise proceed to next step |
110 | 114 | if ( $form_errors ) { |
111 | 115 | $this->fnPayflowDisplayForm( $data, $this->errors ); |
112 | 116 | } else { // The submitted form data is valid, so process it |
— | — | @@ -113,25 +117,44 @@ |
114 | 118 | $result = $this->adapter->do_transaction( 'INSERT_ORDERWITHPAYMENT' ); |
115 | 119 | //$result = $this->adapter->do_transaction( 'TEST_CONNECTION' ); |
116 | 120 | |
117 | | - $wgOut->addHTML( $result['message'] ); |
118 | | - if ( !empty( $result['errors'] ) ) { |
119 | | - $wgOut->addHTML( "<ul>" ); |
120 | | - foreach ( $result['errors'] as $code => $value ) { |
121 | | - $wgOut->addHTML( "<li>Error $code: $value" ); |
| 121 | + if (!empty($result['errors'])){ |
| 122 | + $wgOut->addHTML("<ul>"); |
| 123 | + foreach ($result['errors'] as $code => $value){ |
| 124 | + $wgOut->addHTML("<li>Error $code: $value"); |
122 | 125 | } |
123 | | - $wgOut->addHTML( "</ul>" ); |
| 126 | + $wgOut->addHTML("</ul>"); |
124 | 127 | } |
125 | | - |
126 | | - if ( !empty( $result['data'] ) ) { |
127 | | - $wgOut->addHTML( "<ul>" ); |
128 | | - foreach ( $result['data'] as $key => $value ) { |
129 | | - $wgOut->addHTML( "<li>$key: $value" ); |
| 128 | + |
| 129 | + if (!empty($result['data'])){ |
| 130 | + // Create new page here with iframe. |
| 131 | + $paymentFrame = Xml::openElement( 'iframe', |
| 132 | + array( |
| 133 | + 'id' => 'globalcollectframe', |
| 134 | + 'name' => 'globalcollectframe', |
| 135 | + 'width' => '680', |
| 136 | + 'height' => '300', |
| 137 | + 'frameborder' => '0', |
| 138 | + 'style' => 'display:block;', |
| 139 | + 'src' => $result['data']['FORMACTION'] |
| 140 | + ) |
| 141 | + ); |
| 142 | + $paymentFrame .= Xml::closeElement( 'iframe' ); |
| 143 | + |
| 144 | + $wgOut->addHTML( $paymentFrame ); |
| 145 | + } |
| 146 | + |
| 147 | + /* |
| 148 | + $wgOut->addHTML($result['message']); |
| 149 | + if (!empty($result['data'])){ |
| 150 | + $wgOut->addHTML("<ul>"); |
| 151 | + foreach ($result['data'] as $key => $value){ |
| 152 | + $wgOut->addHTML("<li>$key: $value"); |
130 | 153 | } |
131 | | - $wgOut->addHTML( "</ul>" ); |
| 154 | + $wgOut->addHTML("</ul>"); |
132 | 155 | } |
| 156 | + */ |
133 | 157 | |
134 | 158 | |
135 | | - |
136 | 159 | // self::log( $data[ 'order_id' ] . " Preparing to query MaxMind" ); |
137 | 160 | // wfRunHooks( 'PayflowGatewayValidate', array( &$this, &$data ) ); |
138 | 161 | // self::log( $data[ 'order_id' ] . ' Finished querying Maxmind' ); |
— | — | @@ -325,7 +348,7 @@ |
326 | 349 | */ |
327 | 350 | private function fnPayflowGetResults( $data, $result ) { |
328 | 351 | // prepare NVP response for sorting and outputting |
329 | | - $responseArray = array( ); |
| 352 | + $responseArray = array(); |
330 | 353 | |
331 | 354 | /** |
332 | 355 | * The result response string looks like: |
— | — | @@ -451,7 +474,7 @@ |
452 | 475 | public function prepareStompTransaction( $data, $responseArray, $responseMsg ) { |
453 | 476 | $countries = $this->getCountries(); |
454 | 477 | |
455 | | - $transaction = array( ); |
| 478 | + $transaction = array(); |
456 | 479 | |
457 | 480 | // include response message |
458 | 481 | $transaction['response'] = $responseMsg; |