[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] order.profile logic commands
I tried using the code from the Docs, I added it to the catalog.cfg. And
now interchange gives me a timeout error when I Apply Changes to the
catalog. Here is the exact code I'm adding, is there any reason it wouldn't
work?
GlobalSub <<EOF
sub set_up_extra_check {
BEGIN {
package Vend::Order;
sub _date_past {
my($ref, $var, $val) = @_;
$_ = $val;
my ($mo, $da, $yr) =
/(^\d{1,2}).(\d{1,2}).(\d\d\d\d|\d\d)/;
my ($DAY, $MONTH, $YEAR) =
(localtime)[3,4,5];
$YEAR += 1900;
$YEAR = $YEAR - 18;
my $error_msg = "bad things";
if ($yr < $YEAR){
return (1, $var, '');
} elsif ($yr == $YEAR){
if ($mo < $MONTH){
return (1, $var, '');
} elsif ($mo == $MONTH){
if ($da < $DAY){
return (1, $var,
'');
} else {
return (undef,
$var, $error_msg);
}
} else {
return (undef, $var,
$error_msg);
}
} else {
return (undef, $var, $error_msg);
}
return (1, $var, '');
}
}
}
EOF
-----------------------------------------
Brendan Crosser-McGay
brendan@paymentonline.com
-----------------------------------------
> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of Ed
> LaFrance
> Sent: Tuesday, April 30, 2002 8:22 AM
> To: interchange-users@interchange.redhat.com
> Subject: Re: [ic] order.profile logic commands
>
>
> At 07:08 PM 4/29/2002 -0700, you wrote:
>
> >I was trying to perform some checks on some numbers for
> checking a date of
> >birth to see if it is past a certain age. I tried this and
> it didn't work,
> >this code is from the orders.profile, all I get is
> >
> >(elsif): No format check routine for 'value'
> >
> >when I go through an order. I guess that means the order
> profile is not
> >working, but I can't think of what could be wrong, from what
> I've seen from
> >the other order profiles, ITL can be used there without any
> problems, Any
> >help would be appreciated!
> >
> >profiles.order code follows:
> >
> >__NAME__ credit_card
>
> [snip arg=big_ol_nasty_chunk_o_code]
>
> >-----------------------------------------
> >Brendan Crosser-McGay
> >brendan@paymentonline.com
> >-----------------------------------------
>
> That [if] monster you just posted is probably the strongest
> argument I have
> seen for writing a custom order check instead. Check the
> ic_ecommerce doc
> that is included in the current dist for guidelines.
>
> - Ed L.
>
> ===============================================================
> New Media E.M.S. Software Solutions for Business
> 463 Main St., Suite D eCommerce | Consulting | Hosting
> Placerville, CA 95667 edl@newmediaems.com
> (530) 622-9421 http://www.newmediaems.com
> (866) 519-4680 Toll-Free (530) 622-9426 Fax
> ===============================================================
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
>