Hi
I writing module for polish payment system: platnosci.pl
This system offer several types of payment:
- credit card
- transfer for several banks.
I will have:
admin/store/settings/payment/edit/methods
- one configuration: auth_key, id_shop etc.
- checkbox for types of payment
cart/checkout:
- user can choose one of active types of payment
cart/checkout/review:
- form action to platnosci.pl system with order values and type payment
How do it? 
I try:
1) If I define several methods for every type payment in function uc_platnosci_pl_payment_method()
then I have several configuration in admin/store/settings/payment/edit/methods
2) I define one method in uc_platnosci_pl_payment_method and:
<?php
/**
* Implementation of hook_form_alter().
*/
function uc_platnosci_pl_form_alter($form_id, &$form) {
if ($form_id == 'uc_cart_checkout_review_form' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
$order = uc_order_load($order_id);
if (substr($order->payment_method,'platnosci_pl')) {
unset($form['submit']);
$form['#prefix'] = '<table style="display: inline; padding-top: 1em;"><tr><td>';
$form['#suffix'] = '</td><td>'. drupal_get_form('uc_platnosci_pl_form', $order) .'</td></tr></table>';
}
}
elseif ($form_id == 'uc_cart_checkout_form') {
drupal_set_message('Form elements:<pre>'. print_r($form[panes][payment][pane][payment_method]['#options'], true) .'</pre>');
unset($form[panes][payment][pane][payment_method]['#options'][platnosci_pl]);
$form['panes']['payment']['pane']['payment_method']['#options']['platnosci_pl_a'] = 'platnosci: A';
$form['panes']['payment']['pane']['payment_method']['#options']['platnosci_pl_b'] = 'platnosci: B';
$form['panes']['payment']['pane']['payment_method']['#options']['platnosci_pl_c'] = 'platnosci: C';
} else {
drupal_set_message('Form elements:<pre>'. print_r($form_id, true) .'</pre>');
}
}
?>Any other/better ideas?
Thanks,
Artur





Joined: 08/22/2007