[ic] Perl CGI module (was: Safe error in payment module)

Peter peter at pajamian.dhs.org
Thu Nov 15 22:08:56 UTC 2012


On 16/11/12 09:51, Dan Bergan wrote:
> On Thu, Nov 15, 2012 at 12:42 PM, Josh Lavin <josh at perusion.net> wrote:
>> I think since you are working with a custom module and not stock
>> Interchange code, that you will have to provide us with your source
>> code, or hire a competent IC consultant to review it.
>>
> I was having success with the Net::Braintree module, except for the
> method that used the CGI module.  So, I created a simple usertag that
> caused the same error:
> 
> UserTag test_cgi Order todo
> UserTag test_cgi addAttr
> UserTag test_cgi Routine <<EOR
> use CGI;

<snip>

This code will give the same error, but the problem almost certainly
lies in Net::Braintree.  The fact is that you cannot create a new CGI
object from within a Safe block of code, and Net::Braintree is trying to
do this.  It is possible that if this only happens at the initialization
phase of the module that you can initialize it outside of the Safe block
and store a global object for this purpose, otherwise you're going to
have a hard time calling Net::Braintree from inside Safe.

At the end of the day it comes down to what Josh already said, we really
need to see your code that interfaces with Net::Braintree in order to be
able to figure out what's going on.


Peter



More information about the interchange-users mailing list