[ic] Payment module questions
Interchange user
interchange-users@icdevgroup.org
Wed Jan 29 00:39:00 2003
Hey there,
I'm working on a new payment module and have a couple questions (many more
will follow, no doubt).
The payment gateway I'm using requires a credit card type (that is, 'VISA',
'MASTERCARD' and so on). I've put the following chunk of code in
checkout.html:
<SELECT NAME=mv_credit_card_type>
[calc]
my $accepted = $Variable->{CREDIT_CARDS_ACCEPTED};
my %cc;
my $out = "";
$cc{"Visa"} = "VISA" if $accepted =~ /visa/;
$cc{"MasterCard"} = "MASTERCARD" if $accepted =~ /mc/;
$cc{"Discover"} = "DISCOVER" if $accepted =~ /discover/;
$cc{"American Express"} = "AMEX" if $accepted =~ /amex/;
for (keys %cc) {
$out .= "<OPTION VALUE=\"$cc{$_}\">$_";
}
return $out;
[/calc]
</SELECT>
Can I now access this variable using '$actual{mv_credit_card_type}' (assuming
this hash was set up as in other payment modules)?
BTW, what's the best way to debug? Where does the '::logDebug()' function
output to? How are payment modules called? Can you debug without having to
place an order each time?
Secondly, can someone please give me specs on the return values that IC
expects to receive in the %result hash? I can see more or less what's
happening in other modules, but it's a little confusing.
Thanks in advance.