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

Paul Jordan paul at gishnetwork.com
Fri Apr 21 00:10:41 EDT 2006


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of DB
> Sent: Thursday, April 20, 2006 7:14 PM
> To: interchange-users at icdevgroup.org
> Subject: [ic] Preventing non-US orders from using realtime processing
> 
> > 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


Depending on what version you are using, I believe later model IC's have a
[charge] in etc/log_transaction. The code in that file has a:

[elsif variable MV_PAYMENT_MODE]

 charge, etc etc...

[/elsif]

So, you'll need to redirect before this. I think what you'd need to do is
setup a second Order Route called something like "offline" similar to "main"
but setup for PGP. Somewhere in your profiles.order you'd set your order
rotues to hit "offline", instead of "main" if the country is not US. Since
your MV_PAYMENT_MODE will be set for your realtime stuff, you'll also need
to block the code in etc/log_transaction that I pointed to above. Or, before
it add an [elsif value mv_order_profile eq offline] and it won't be allowed
to get to the real time charging further down.

But, yes you are right that there is more to it than you think and if you
study up on order rotues.

Ic config 3.52
Ic advanced tutorial 11.2
http://www.icdevgroup.org/interchange/doc-5.0/frames/icdatabase_63.html


HTH
Paul



More information about the interchange-users mailing list