Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -92,18 +92,25 @@ |
93 | 93 | // The form was submitted and the payment method has been set |
94 | 94 | $this->adapter->log( "Form posted and payment method set." ); |
95 | 95 | |
96 | | - /* |
97 | | - * The $payment_method should default to false. |
98 | | - * |
99 | | - * An invalid $payment_method will cause an error. |
100 | | - */ |
101 | | - $payment_method = ( isset( $data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? $data['payment_method'] : false; |
102 | | - $payment_submethod = ( isset( $data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? $data['payment_submethod'] : false; |
103 | | - |
104 | | - $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) ); |
| 96 | + /* Commenting out because this is completely breaking Credit Card in GC. |
| 97 | + * Under usual circumstances, that would be an automatic revert, but |
| 98 | + * there were no small number of clean places to do that. |
| 99 | + **/ |
105 | 100 | |
106 | | - // Check form for errors |
107 | | - $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] ); |
| 101 | +// /* |
| 102 | +// * The $payment_method should default to false. |
| 103 | +// * |
| 104 | +// * An invalid $payment_method will cause an error. |
| 105 | +// */ |
| 106 | +// $payment_method = ( isset( $data['payment_method'] ) && !empty( $data['payment_method'] ) ) ? $data['payment_method'] : false; |
| 107 | +// $payment_submethod = ( isset( $data['payment_submethod'] ) && !empty( $data['payment_submethod'] ) ) ? $data['payment_submethod'] : false; |
| 108 | +// |
| 109 | +// $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) ); |
| 110 | +// |
| 111 | +// // Check form for errors |
| 112 | +// $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] ); |
| 113 | + |
| 114 | + $form_errors = $this->validateForm( $data, $this->errors, array( 'address', 'amount', 'creditCard', 'email', 'name' ) ); |
108 | 115 | |
109 | 116 | // If there were errors, redisplay form, otherwise proceed to next step |
110 | 117 | if ( $form_errors ) { |
— | — | @@ -117,10 +124,10 @@ |
118 | 125 | |
119 | 126 | $this->displayResultsForDebug( $result ); |
120 | 127 | |
121 | | - if ( $payment_method == 'credit' ) { |
| 128 | + //if ( $payment_method == 'credit' ) { |
122 | 129 | |
123 | | - $this->executeIframeForCreditCard( $result ); |
124 | | - } |
| 130 | + $this->executeIframeForCreditCard( $result ); |
| 131 | + //} |
125 | 132 | |
126 | 133 | |
127 | 134 | //TODO: add all the hooks back in. |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -325,27 +325,32 @@ |
326 | 326 | */ |
327 | 327 | public function getPaymentSubmethodMeta( $payment_submethod, $options = array() ) { |
328 | 328 | |
329 | | - extract( $options ); |
| 329 | + /* Commenting out because this is completely breaking Credit Card in GC. |
| 330 | + * Under usual circumstances, that would be an automatic revert, but |
| 331 | + * there were no small number of clean places to do that. |
| 332 | + **/ |
330 | 333 | |
331 | | - $log = isset( $log ) ? (boolean) $log : false ; |
332 | | - |
333 | | - if ( isset( $this->payment_submethods[ $payment_submethod ] ) ) { |
334 | | - |
335 | | - if ( $log ) { |
336 | | - $this->log( 'Getting payment submethod: ' . ( string ) $payment_submethod ); |
337 | | - } |
338 | | - |
339 | | - // Ensure that the validation index is set. |
340 | | - if ( !isset( $this->payment_submethods[ $payment_submethod ]['validation'] ) ) { |
341 | | - $this->payment_submethods[ $payment_submethod ]['validation'] = array(); |
342 | | - } |
343 | | - |
344 | | - return $this->payment_submethods[ $payment_submethod ]; |
345 | | - } |
346 | | - else { |
347 | | - $message = 'The payment submethod [ ' . $payment_submethod . ' ] was not found.'; |
348 | | - throw new Exception( $message ); |
349 | | - } |
| 334 | +// extract( $options ); |
| 335 | +// |
| 336 | +// $log = isset( $log ) ? (boolean) $log : false ; |
| 337 | +// |
| 338 | +// if ( isset( $this->payment_submethods[ $payment_submethod ] ) ) { |
| 339 | +// |
| 340 | +// if ( $log ) { |
| 341 | +// $this->log( 'Getting payment submethod: ' . ( string ) $payment_submethod ); |
| 342 | +// } |
| 343 | +// |
| 344 | +// // Ensure that the validation index is set. |
| 345 | +// if ( !isset( $this->payment_submethods[ $payment_submethod ]['validation'] ) ) { |
| 346 | +// $this->payment_submethods[ $payment_submethod ]['validation'] = array(); |
| 347 | +// } |
| 348 | +// |
| 349 | +// return $this->payment_submethods[ $payment_submethod ]; |
| 350 | +// } |
| 351 | +// else { |
| 352 | +// $message = 'The payment submethod [ ' . $payment_submethod . ' ] was not found.'; |
| 353 | +// throw new Exception( $message ); |
| 354 | +// } |
350 | 355 | } |
351 | 356 | |
352 | 357 | /** |
Index: trunk/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -95,6 +95,9 @@ |
96 | 96 | * @see GatewayForm::fnValidateForm() |
97 | 97 | */ |
98 | 98 | public function validateForm( &$data, &$error, $options = array( ) ) { |
| 99 | + |
| 100 | + //TODO: Should parts of this fail closed? Probably. Right now, with no |
| 101 | + //options sent, nothing will validate. |
99 | 102 | |
100 | 103 | extract( $options ); |
101 | 104 | |