[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Orders to countries which have no states/provinces ?


On 11/04/2007 08:03 AM, Gert van der Spoel wrote:
>> -----Original Message-----
>> From: suppressed [mailto:interchange-
>> suppressed On Behalf Of DB
>> Sent: zondag 4 november 2007 17:43
>> To: suppressed
>> Subject: [ic] Orders to countries which have no states/provinces ?
>>
>>>> IC 5.4.2 with a modified foundation catalog. On my checkout form,
>>>> "State/Province" is a required field. Some countries however have no
>>>> entries in the State table. When customers try to submit orders
>>>> shipping
>>>> to such a country, a rather cryptic error appears and they can't
>>>> proceed
>>>> (I use Skipjack). The error appears to be coming from Skipjack, but
>> I'm
>>>> not certain that Interchange isn't generating the error. Error text
>> is:
>>>> (Payment process): There was an error accepting payment: Real-time
>>>>  charge failed. Reason: Length of customer state (-82)
>>>>  Credit Card Information: Length of customer state (-82)
>>>>
>> <snip>
>>
>>> The error says 'length of state' to be an issue. Are you sure that
>> 'NONE'
>>> actually works?
>>> I would assume that the state-length expected is 2 characters. So it
>> would
>>> be rejecting everything else.
>>> If that is the case I'd add a   <option VALUE='NA'>Not Applicable
>>> as option ...
>>>
>>> CU,
>>>
>>> Gert
>> Hi - NONE does work in my tests, and there are many examples in the
>> State table of entries longer than 2 characters. Maybe 2 is a minimum
>> but I'm not sure.
> 
> Gotcha. Checked a SkipJack manual (2004) and minimum requirement for state
> is 1
> (actually 1-40 is allowed).
> 
> So if you do not care about the State itself you could still go with the
> <option value='NA'>Not Applicable    setting. Then you do not need the
> additional field.
> 
> You could put a test in your form profile in case someone from the US tries
> to be funny and
> Choose the 'NA' state ... 
> 
> As SkipJack is requiring at least 1 character you apparently cannot make the
> field optional.

Since this issue is specific to Skipjack, it's probably better to fix it
in Skipjack.pm.  Try this patch (untested attached) and see if it works.

Peter

Index: lib/Vend/Payment/Skipjack.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Payment/Skipjack.pm,v
retrieving revision 2.10
diff -u -p -r2.10 Skipjack.pm
--- lib/Vend/Payment/Skipjack.pm	9 Aug 2007 13:40:55 -0000	2.10
+++ lib/Vend/Payment/Skipjack.pm	5 Nov 2007 10:30:28 -0000
@@ -481,6 +481,8 @@ sub skipjack {
 			$amount = Vend::Util::round_to_frac_digits($amount,$precision);
     }
 
+	$actual{b_state} = 'NONE' unless length $actual{b_state};
+
 	my %values;
 	if($transtype eq 'sale') {
 		%values = (
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.