emt3000gt

Registered
Aug 26, 2008
2
0
51
Hello,
I am looking for some help getting my site working with Google Checkout. I am familiar with Perl so I have been trying to get that working... Here is my checkout.cgi code:

Code:
#!/[COLOR="Red"]home/zipup/perl[/COLOR]
use strict;
      

use CGI qw(:standard);

       

      if (param()) {
      use lib qw(/home/zipup/perl);
      use [COLOR="red"]/home/zipup/perl/[/COLOR]Google::Checkout::General::GCO;
      use /home/zipup/perl/Google::Checkout::General::MerchantItem;

      use /home/zipup/perl/Google::Checkout::General::MerchantCheckoutFlow;
      use /home/zipup/perl/Google::Checkout::General::DigitalContent;
      use /home/zipup/perl/Google::Checkout::General::ShoppingCart;
      use /home/zipup/perl/Google::Checkout::General::Util qw/is_gco_error/;

       
 
      my $gco = /[COLOR="red"]home/zipup/perl/[/COLOR]Google::Checkout::General::GCO->new(config_path => [COLOR="red"]/.cpan/build/Google-Checkout-1.1.1-asmg_H/conf/GCOSystemGlobal.conf[/COLOR]);

            my $name = param(name);
      my $desc = param(desc);
      my $price = param(price);
      $price =~ s/-//g;
      my $qty = param(qty);
      $qty =~ s/-//g;
      my $private = param(private);
      my $item_id = param(item_id);

       
 
      my $checkout_flow = Google::Checkout::General::MerchantCheckoutFlow->new(
        edit_cart_url         => http://www.organicsem.com/cart/,
       continue_shopping_url => http://www.organicsem.com/continue/
 
      );

       

      my $cart = Google::Checkout::General::ShoppingCart->new(
      expiration    => +1 mont,
      private       => Merchant private data,
      checkout_flow => $checkout_flow);

       

      my $item01 = Google::Checkout::General::DigitalContent->new(
      name        => $name,
      description => $desc,
      price       => $price,
      quantity    => $qty,
      private     => $private,
      delivery_method => Google::Checkout::General::DigitalContent::EMAIL_DELIVERY,
      merchant_item_id => $item_id

      );


      $cart->add_item($item01);

      # Send the cart to google checkout and receive a destination URL
      my $response = $gco->checkout($cart);
 

      die $response if is_gco_error $response;

      # Redirect the user to their checkout page
      my $cgi = new CGI;
      print $cgi->redirect( -uri => $response );
      }
I am not sure if those paths labeled in red are right... I have installed all of the Checkout Modules that I am referencing and Permissions for checkout.cgi are 755. The conf file for CGO is also set correctly.


When run the script from my website I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.37 Server at beta.zipup.com Port 80

any help would be appreciated. Just trying to get the basics working so I can play with it some more..

Thank you,
Tom
 

emt3000gt

Registered
Aug 26, 2008
2
0
51
I was able to get a simple "Hello" world program working... But this gco is being a pain.. Im getting the same messages as above.

On a side note, while I installed all of those modules they doint show up in the Perl moduel page. But I was able to find the GCOSystemGlobal.conf file which was in a hidden directory.

So I dont know weather or not to assume the are installed correctly or not... But here is my new code for Checkout.cgi...

Code:
#!/usr/bin/perl



use CGI qw(:standard);

       

      if (param()) {

      use lib qw(/usr/bin/perl);

      use Google::Checkout::General::GCO;
      
      use Google::Checkout::General::MerchantItem;

      use Google::Checkout::General::MerchantCheckoutFlow;

      use Google::Checkout::General::DigitalContent;

      use Google::Checkout::General::ShoppingCart;

      use Google::Checkout::General::Util qw/is_gco_error/;

       
 
      my $gco = Google::Checkout::General::GCO->new(config_path => /.cpan/build/Google-Checkout-1.1.1-asmg_H/conf/GCOSystemGlobal.conf);

       

      my $name = param(name);

      my $desc = param(desc);

      my $price = param(price);

      $price =~ s/-//g;

      my $qty = param(qty);

      $qty =~ s/-//g;
 
      my $private = param(private);
 
      my $item_id = param(item_id);

       
 
      my $checkout_flow = Google::Checkout::General::MerchantCheckoutFlow->new(
  
      edit_cart_url         => http://www.organicsem.com/cart/,
 
      continue_shopping_url => http://www.organicsem.com/continue/
 
      );

       

      my $cart = Google::Checkout::General::ShoppingCart->new(
 
      expiration    => +1 mont,
  
      private       => Merchant private data,
 
      checkout_flow => $checkout_flow);

       

      my $item01 = Google::Checkout::General::DigitalContent->new(

      name        => $name,

      description => $desc,

      price       => $price,
 
      quantity    => $qty,

      private     => $private,

      delivery_method => Google::Checkout::General::DigitalContent::EMAIL_DELIVERY,

      merchant_item_id => $item_id

      );

       

      $cart->add_item($item01);

       
  
      # Send the cart to google checkout and receive a destination URL

      my $response = $gco->checkout($cart);
 
       
  
      die $response if is_gco_error $response;

       

      # Redirect the user to their checkout page

      my $cgi = new CGI;

      print $cgi->redirect( -uri => $response );

      }
 
Last edited: