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

Dan Bergan dan at berganconsulting.com
Thu Nov 15 20:51:04 UTC 2012


On Thu, Nov 15, 2012 at 12:42 PM, Josh Lavin <josh at perusion.net> wrote:
> Quoting Dan Bergan (dan at berganconsulting.com):
>> On Wed, Nov 14, 2012 at 3:01 PM, Dan Bergan <dan at berganconsulting.com> wrote:
>> > I am playing around with Net::Braintree and trying to use their
>> > Transparent Redirect method.
>> >
>> > I have installed Net::Braintree and created a payment module.  When I
>> > process a payment, I am getting the following error:
>> >
>> > Safe: Real-time charge failed. Reason: payment routine 'braintreetr'
>> > returned error: Undefined subroutine CGI::delete at
>> > /usr/local/perl-5.8.9/lib/site_perl/5.8.9/Net/Braintree/TransparentRedirect/QueryString.pm
>> > line 18.
>> >
>> > line 18 in QueryString.pm:
>> >  my $query = CGI->new($query_string);
>> >
>>
>> I have a little more information:
>>
>> I moved the Net::Braintree code to a Global Usertag and called it from
>> a regular page rather than a payment route, and I am still getting
>> pretty much the same error message (just without the "Safe" message):
>
> Good work. I don't know why you would ever want a payment module to not
> be a global usertag.
>
>>  Died in server spawn: Undefined subroutine CGI::delete
>> >  at /usr/local/perl-5.8.9/lib/site_perl/5.8.9/Net/Braintree/TransparentRedirect/QueryString.pm line 18.
>
> 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.
>

Thanks, Josh.

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;
sub {
  my ($todo, $opt) = @_;

  my $query_string = $CGI::query_string;
  ::logError("test_cgi tag:".__LINE__.": query_string = $query_string");

  my $query = CGI->new($query_string);
  return $query->Vars;
}
EOR

I placed this usertag in a page called "test.html" and called the
page: /cgi-bin/champnew/test.html?test=1

Error in the global IC error log:

 champnew /cgi-bin/champnew/test.html Died in server spawn: Undefined
subroutine CGI::delete
>  at (tag 'test_cgi') line 9.

Thanks -
Dan Bergan



More information about the interchange-users mailing list