[ic] Preventing non-US orders from using realtimeprocessing

Steve Graham icdev at mrlock.com
Wed Jun 21 14:50:26 EDT 2006

>Test at your own risk.....

There was some error in the nested [then] [/then] statement in the 
previous code - I removed it and the following code has been working well...

[elsif variable MV_PAYMENT_MODE]
[if value country eq "US"]
                 return if $Scratch->{tmp_total} == $Scratch->{tmp_remaining};
                 my $msg = sprintf "Your credit card was charged 
%.2f", $Scratch->{tmp_remaining};
                 $Scratch->{pay_cert_total} = $Scratch->{tmp_total} - 
                 $Scratch->{charge_total_message} = $msg;
                 return "Credit card will be charged 
         Country: [value country]
         Charging with payment mode=[var MV_PAYMENT_MODE]
         [tmp name="charge_succeed"][charge route="[var 
MV_PAYMENT_MODE]" amount="[scratch tmp_remaining]" order_id="[value 
         [if scratch charge_succeed]
           [set do_invoice]1[/set]
           [set do_payment]1[/set]
           Real-time charge succeeded. ID=[data session payment_id] 
amount=[scratch tmp_remaining]
         Real-time charge FAILED. Reason: [data session payment_error]
                         delete $Scratch->{$_};
                 die errmsg(
                                 "Real-time charge failed. Reason: %s\n",
Country: [value country]
Forcing Offline credit card [value mv_credit_card_type] [value 
         Payment: [value name=mv_payment set="credit_card"]

As before,
- Test at your own risk

If anyone else has come up with a similar solution, I'd like to compare notes.


More information about the interchange-users mailing list