[ic] Payment module questions - Mike Heins?, anyone?

Interchange user interchange-users@icdevgroup.org
Fri Jan 31 00:19:01 2003


On Wednesday 29 January 2003 05:38 am, you wrote:
> 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 =~ /mastercard/;
> $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.


OK, I've figured out how to get debugging output, and I can see that the form 
variable above is not getting passed to the module as the others are. So just 
how do I make sure that this variable gets included in values that are sent 
to the module?

Still need some specs on %result too, please.

Thanks.


foreach (@poor_documentation) {
  if ($hair) {
    &pullout(@more_hair);
  }
  else {
    &gomad();
  }
}

;-)