[ic] Preventing non-US orders from using realtime processing

Curt Hauge ictech at mnwebdesign.com
Fri Apr 21 18:56:02 EDT 2006


DB at M-and-D.com wrote:
>> This works for me:
>>
>> [if value country =~ /^(US)$/i]
>>
>> <!-- Do real-time credit card -->
>>
>> [else]
>>
>> <!-- Don't do real-time credit card -->
>>
>> [/else]
>> [/if]
>>
>> YMMV
>>
>>
>>>
>
>
>
> I gave your code a shot as shown below, but I get errors about invalid
> credit card number and in the log I see entries about routing
> problems:
>
> [20/April/2006:22:04:22 -0400] mdp /cgi-bin/mdp/process Route log
> failed. [20/April/2006:22:04:22 -0400] mdp /cgi-bin/mdp/process
> ERRORS on ORDER 3958:
>> Error during creation of order routing log:
>> Route log failed. at /usr/local/interchange/lib/Vend/Order.pm line
>> 1835.
>
>
> I think I'm missing part of a bigger picture. Here is what I tried:
>
> ====================================================
>
> __NAME__                            credit_card
>
> __COMMON_ORDER_PROFILE__
>
> &fatal = yes
> email=required
> email=email
>
> &set = mv_payment Incomplete
>
> [if value country =~ /^(US)$/i]
>
> [if variable MV_PAYMENT_MODE]
> [value name=mv_payment_realtime set=""]
> &credit_card=standard keep __CREDIT_CARDS_ACCEPTED__
> &set=mv_payment Real-time Credit Card (%c -- [var MV_PAYMENT_MODE])
> &set=mv_payment_realtime 1 [else]
> &credit_card=standard __CREDIT_CARDS_ACCEPTED__
> &set=mv_payment Credit Card (%c)
> [/else]
> [/if]
>
> [else]
> &credit_card=standard __CREDIT_CARDS_ACCEPTED__
> &set=mv_payment Credit Card (%c)
> [/else]
>
> [/if]
>
>
> &calc = $Values->{mv_payment} =~
> s/\%c/$Values->{mv_credit_card_type}/g; 1;
> &final = yes
> &setcheck=mv_email [value email]
>
> __END__
>
> =============================
>
> Still trying..... hints still welcomed

Your code is messed up, you have too many [else] [/else] tags.

I would look into the [if] tag a little more, you want to do something like:

[if value country =~ /^(US)$/i]
[and value name=mv_payment_realtime set=""]
&credit_card=standard keep __CREDIT_CARDS_ACCEPTED__
&set=mv_payment Real-time Credit Card (%c -- [var MV_PAYMENT_MODE])
&set=mv_payment_realtime 1 [else]
&credit_card=standard __CREDIT_CARDS_ACCEPTED__
&set=mv_payment Credit Card (%c)
[else]
&credit_card=standard __CREDIT_CARDS_ACCEPTED__
&set=mv_payment Credit Card (%c)
[/else]
[/if]

Untested, but should be close.

Good luck!

Curt Hauge
Office 763-689-4984
Cell   612-598-5530
www.IWantAConsultant.com
www.MNWebDesign.com



More information about the interchange-users mailing list