Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | // Hide unneeded interface elements |
55 | 55 | $wgOut->addModules( 'donationInterface.skinOverride' ); |
56 | 56 | |
| 57 | + // Used to add gateway specific error messages. |
57 | 58 | $gateway_id = $this->adapter->getIdentifier(); |
58 | 59 | |
59 | 60 | $this->addErrorMessageScript(); |
— | — | @@ -87,21 +88,22 @@ |
88 | 89 | |
89 | 90 | // dispatch forms/handling |
90 | 91 | if ( $this->adapter->checkTokens() ) { |
91 | | - if ( $this->adapter->posted && $data['payment_method'] == 'processed' ) { |
| 92 | + if ( $this->adapter->posted ) { |
92 | 93 | // The form was submitted and the payment method has been set |
93 | 94 | $this->adapter->log( "Form posted and payment method set." ); |
94 | 95 | |
95 | 96 | /* |
96 | | - * The $transactionType should default to false. |
| 97 | + * The $payment_method should default to false. |
97 | 98 | * |
98 | | - * An invalid $transactionType will cause an error. |
| 99 | + * An invalid $payment_method will cause an error. |
99 | 100 | */ |
100 | | - $transactionType = ( isset( $data['transaction_type'] ) && !empty( $data['transaction_type'] ) ) ? $data['transaction_type'] : false; |
| 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; |
101 | 103 | |
102 | | - $transactionTypeMeta = $this->adapter->getTransactionTypeMeta( $transactionType, array( 'log' => true, ) ); |
| 104 | + $payment_submethodMeta = $this->adapter->getPaymentSubmethodMeta( $payment_submethod, array( 'log' => true, ) ); |
103 | 105 | |
104 | 106 | // Check form for errors |
105 | | - $form_errors = $this->validateForm( $data, $this->errors, $transactionTypeMeta['validation'] ); |
| 107 | + $form_errors = $this->validateForm( $data, $this->errors, $payment_submethodMeta['validation'] ); |
106 | 108 | |
107 | 109 | // If there were errors, redisplay form, otherwise proceed to next step |
108 | 110 | if ( $form_errors ) { |
— | — | @@ -115,9 +117,9 @@ |
116 | 118 | |
117 | 119 | $this->displayResultsForDebug( $result ); |
118 | 120 | |
119 | | - if ( $transactionType == 'credit' ) { |
| 121 | + if ( $payment_method == 'credit' ) { |
120 | 122 | |
121 | | - $this->executeiFrameForCreditCard(); |
| 123 | + $this->executeIframeForCreditCard( $result ); |
122 | 124 | } |
123 | 125 | |
124 | 126 | |
— | — | @@ -144,9 +146,14 @@ |
145 | 147 | } |
146 | 148 | |
147 | 149 | /** |
148 | | - * Execute execute iFrame for credit card |
| 150 | + * Execute iframe for credit card |
| 151 | + * |
| 152 | + * @param array $result The result array from the gateway adapter |
| 153 | + * |
| 154 | + * @todo |
| 155 | + * - this needs to be moved out of @see GlobalCollectGateway and into the adapter. |
149 | 156 | */ |
150 | | - public function executeiFrameForCreditCard() { |
| 157 | + public function executeIframeForCreditCard( $result ) { |
151 | 158 | |
152 | 159 | global $wgOut; |
153 | 160 | |