Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -191,25 +191,33 @@ |
192 | 192 | |
193 | 193 | $this->payment_methods = array(); |
194 | 194 | |
| 195 | + // Bank Transfers |
| 196 | + $this->payment_methods['bt'] = array( |
| 197 | + 'label' => 'Bank transfer', |
| 198 | + 'types' => array( 'bt', ), |
| 199 | + 'validation' => array( 'creditCard' => false, ) |
| 200 | + //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
| 201 | + ); |
| 202 | + |
195 | 203 | // Credit Cards |
196 | 204 | $this->payment_methods['cc'] = array( |
197 | 205 | 'label' => 'Credit Cards', |
198 | 206 | 'types' => array( '', 'visa', 'mc', 'amex', 'discover', 'maestro', 'solo', 'laser', 'jcb,', 'cb', ), |
199 | 207 | ); |
200 | 208 | |
| 209 | + // Direct Debit |
| 210 | + $this->payment_methods['dd'] = array( |
| 211 | + 'label' => 'Direct Debit', |
| 212 | + 'types' => array( 'dd_johnsen_nl', 'dd_johnsen_de', 'dd_johnsen_at', 'dd_johnsen_fr', 'dd_johnsen_gb', 'dd_johnsen_be', 'dd_johnsen_ch', 'dd_johnsen_it', 'dd_johnsen_es', ), |
| 213 | + 'validation' => array( 'creditCard' => false, ) |
| 214 | + //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
| 215 | + ); |
| 216 | + |
201 | 217 | // Real Time Bank Transfers |
202 | 218 | $this->payment_methods['rtbt'] = array( |
203 | 219 | 'label' => 'Real time bank transfer', |
204 | 220 | 'types' => array( 'rtbt_ideal', 'rtbt_eps', 'rtbt_sofortuberweisung', 'rtbt_nordea_sweeden', 'rtbt_enets', ), |
205 | 221 | ); |
206 | | - |
207 | | - // Bank Transfers |
208 | | - $this->payment_methods['bt'] = array( |
209 | | - 'label' => 'Bank transfer', |
210 | | - 'types' => array( 'bt', ), |
211 | | - 'validation' => array( 'creditCard' => false, ) |
212 | | - //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
213 | | - ); |
214 | 222 | } |
215 | 223 | |
216 | 224 | /** |
— | — | @@ -221,9 +229,24 @@ |
222 | 230 | $this->payment_submethods = array(); |
223 | 231 | |
224 | 232 | /* |
225 | | - * Credit Card |
| 233 | + * Bank transfers |
226 | 234 | */ |
227 | 235 | |
| 236 | + // Bank Transfer |
| 237 | + $this->payment_submethods['bt'] = array( |
| 238 | + 'paymentproductid' => 11, |
| 239 | + 'label' => 'Bank Transfer', |
| 240 | + 'group' => 'bt', |
| 241 | + 'validation' => array(), |
| 242 | + ); |
| 243 | + |
| 244 | + /* |
| 245 | + * Default => Credit Card |
| 246 | + * |
| 247 | + * Every payment_method should have a payment_submethod. |
| 248 | + * This is just a catch to sure some validation happens. |
| 249 | + */ |
| 250 | + |
228 | 251 | // None specified - This is a catchall to validate all options for credit cards. |
229 | 252 | $this->payment_submethods[''] = array( |
230 | 253 | 'paymentproductid' => 0, |
— | — | @@ -233,6 +256,18 @@ |
234 | 257 | ); |
235 | 258 | |
236 | 259 | /* |
| 260 | + * Bank transfers |
| 261 | + */ |
| 262 | + |
| 263 | + // Bank Transfer |
| 264 | + $this->payment_submethods['bt'] = array( |
| 265 | + 'paymentproductid' => 11, |
| 266 | + 'label' => 'Bank Transfer', |
| 267 | + 'group' => 'bt', |
| 268 | + 'validation' => array(), |
| 269 | + ); |
| 270 | + |
| 271 | + /* |
237 | 272 | * Credit Card |
238 | 273 | */ |
239 | 274 | |
— | — | @@ -309,12 +344,12 @@ |
310 | 345 | ); |
311 | 346 | |
312 | 347 | /* |
313 | | - * Bank transfers |
| 348 | + * Direct Debit |
314 | 349 | */ |
315 | 350 | |
316 | 351 | // Bank Transfer |
317 | | - $this->payment_submethods['bt'] = array( |
318 | | - 'paymentproductid' => 11, |
| 352 | + $this->payment_submethods['dd_johnsen_nl'] = array( |
| 353 | + 'paymentproductid' => 711, |
319 | 354 | 'label' => 'Bank Transfer', |
320 | 355 | 'group' => 'bt', |
321 | 356 | 'validation' => array(), |
— | — | @@ -649,39 +684,35 @@ |
650 | 685 | |
651 | 686 | /* Bank transfer */ |
652 | 687 | case 'bt': |
653 | | - $this->postdata['payment_product'] = 11; |
| 688 | + $this->postdata['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
654 | 689 | $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
655 | 690 | break; |
| 691 | + |
| 692 | + /* Direct Debit */ |
| 693 | + case 'dd_johnsen_nl': |
| 694 | + case 'dd_johnsen_de': |
| 695 | + case 'dd_johnsen_at': |
| 696 | + case 'dd_johnsen_fr': |
| 697 | + case 'dd_johnsen_gb': |
| 698 | + case 'dd_johnsen_be': |
| 699 | + case 'dd_johnsen_ch': |
| 700 | + case 'dd_johnsen_it': |
| 701 | + case 'dd_johnsen_es': |
| 702 | + $this->postdata['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
| 703 | + $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
| 704 | + break; |
656 | 705 | |
657 | 706 | /* Real time bank transfer */ |
658 | 707 | case 'rtbt_nordea_sweeden': |
659 | | - $this->postdata['payment_product'] = 805; |
660 | | - $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
661 | | - break; |
662 | | - |
663 | | - case 'rtbt_ideal': |
664 | | - $this->postdata['payment_product'] = 809; |
665 | | - $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
666 | | - $this->var_map['ISSUERID'] = 'issuer_id'; |
667 | | - |
668 | | - // Add the ISSUERID field if it does not exist |
669 | | - if ( !in_array( 'ISSUERID', $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'] ) ) { |
670 | | - $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'][] = 'ISSUERID'; |
671 | | - } |
672 | | - break; |
673 | | - |
674 | 708 | case 'rtbt_enets': |
675 | | - $this->postdata['payment_product'] = 810; |
676 | | - $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
677 | | - break; |
678 | | - |
679 | 709 | case 'rtbt_sofortuberweisung': |
680 | | - $this->postdata['payment_product'] = 836; |
| 710 | + $this->postdata['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
681 | 711 | $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
682 | 712 | break; |
683 | 713 | |
684 | 714 | case 'rtbt_eps': |
685 | | - $this->postdata['payment_product'] = 856; |
| 715 | + case 'rtbt_ideal': |
| 716 | + $this->postdata['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
686 | 717 | $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
687 | 718 | $this->var_map['ISSUERID'] = 'issuer_id'; |
688 | 719 | |
— | — | @@ -690,6 +721,12 @@ |
691 | 722 | $this->transactions['INSERT_ORDERWITHPAYMENT']['request']['REQUEST']['PARAMS']['PAYMENT'][] = 'ISSUERID'; |
692 | 723 | } |
693 | 724 | break; |
| 725 | + |
| 726 | + /* Default Case */ |
| 727 | + default: |
| 728 | + //$this->postdata['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
| 729 | + //$this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
| 730 | + break; |
694 | 731 | } |
695 | 732 | } |
696 | 733 | |