MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: checkout-profile and Perl question



******    message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com>     ******

At 10:16 AM 6/10/99 , Kyle Hayes wrote:
>******    message to minivend-users from Kyle Hayes <kyle540@quicknet.net>
    ******
>
>I am using MV 3.12, Apache and MySQL under Red Hat Linux 6.0.
>
>I have created a UserTag that performs credit card authorization.  The tag
>works great. I can even call it from within my checkout-profile.  However,
>I get some odd results.

	Cool.

>I have some perl in the checkout profile like this:
>
>	[perl values interpolate=1]
>		my $temp = '[credit-check ....]';
>
>		my @temparray = split /&/ , "$temp";

	Remove the quotes from $temp?  According to the camel book, if split
cannot match the full string is returned.  (what you're getting)

>		my $size = scalar(@temparray);
>
>		$Safe{values}->{credit_card_result_size} = $size;
>		$Safe{values}->{credit_card_results} = $temp;
>	[/perl]
>
>	[log-value message="[value credit_card_results]"]
>	[log-value message="[value credit_card_result_size]"]
>
>...
>
>My credit check tag returns a string with keys and values delimited by
>"&".  The log-value tag is something I made for debugging.  It takes its
>message argument and prints it to the error.log file.  Very handy for
>debugging.
>
>What I am trying to do is determine whether split is actually splitting
>the string on the "&" characters.  With the above code, I get:
>
>results: TESTKEY1&TESTVAL1&TESTKEY2&TESTVAL2&
>size: 1
>
>I expect:
>
>results: <as above>
>size: 4
>
>If I hard-code $temp to be the above results string, I get the responses I
>expect.
>
>So, it appears that split works with a statically coded string in $temp,
>but not one returned from my credit check tag even though they are
>identical as best as I can determine!
>
>What is happening?  It the return value from the tag actually returning a
>reference or something??  This seems to be an issue with split in the Safe
>mode, maybe????
>
>Any help is appreciated.  I am so close to having this work.
>
>Ideally, I would simply call a GlobalSub from within my checkout-profile
>code, but that does not seem to work.  A UserTag that returns a
>string-ified value of the hash I want to return is fine, but even that is
>causing me grief.  Is there a way to directly call a GlobalSub from within
>a checkout profile?  I.e.
>
>	[set checkout-profile]
>
>	...
>	name=required
>	country=required
>	...
>
>	[perl values interpolate=1]
>		my $temp = &my_global_sub("[value name]");
>
>		... do stuff ...
>	[/perl]
>
>	...
>
>	&final=yes
>
>	&set=mv_email [value email]
>	...
>	[/set]
>
>Any ideas?

	Don't know.

>
>Best,
>Kyle
>
>
>
>-
>To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
>email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
>Archive of past messages: http://www.minivend.com/minivend/minivend-list
> 

Ryan Hertz                                              tel  520-645-3812
Webmaster                                               tel  800-645-BAIT
Advertising Director                                    fax  520-645-2588
Gary Yamamoto Custom Baits, Inc.            http://www.yamamoto.baits.com
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: