The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cpanel Noob needing help with GCO

Discussion in 'General Discussion' started by emt3000gt, Aug 26, 2008.

  1. emt3000gt

    emt3000gt Registered

    Joined:
    Aug 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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:

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

    Thank you,
    Tom
     
  2. emt3000gt

    emt3000gt Registered

    Joined:
    Aug 26, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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 );
    
          }
          
     
    #2 emt3000gt, Aug 26, 2008
    Last edited: Aug 26, 2008
Loading...

Share This Page