Jump to content

Google checkout response check


anups

Recommended Posts

   echo "<h2>Standard Checkout Request</h2>";
      $merchant_id = "merchant_id";  // Your Merchant ID
      $merchant_key = "merchant_id";  // Your Merchant Key
      $server_type = "sandbox";
      $currency = "USD";
      $cart = new GoogleCart($merchant_id, $merchant_key, $server_type,
      $currency);
      $total_count = 12;
      
      $item_1 = new GoogleItem("item name",      // Item name
                               "item desc", // Item      description
                               $total_count, // Quantity
                               10); // Unit price
      $cart->AddItem($item_1);


    $cart->SetMerchantCalculations(
	"http://www.xyz.com/gc2/responsehandlerdemo.php",		
        "false", // merchant-calculated tax
        "true", // accept-merchant-coupons
        "true"); // accept-merchant-gift-certificates
      
      // Add shipping options
      if($total_count < 3){
             $ship_1 = new GoogleFlatRateShipping("USPS Priority Mail", 4.55);
      }else{
             $ship_1 = new GoogleFlatRateShipping("USPS Priority Mail", 6.2);
      }
      $Gfilter = new GoogleShippingFilters();
      $Gfilter->SetAllowedCountryArea('CONTINENTAL_48');
      $ship_1->AddShippingRestrictions($Gfilter);
      $cart->AddShipping($ship_1);

      // Add tax rules
      $tax_rule = new GoogleDefaultTaxRule(0.05);
      $tax_rule->SetStateAreas(array("MA"));
      $cart->AddDefaultTaxRules($tax_rule);
      
      // Specify <edit-cart-url>
      $cart->SetEditCartUrl("http://navkarinfotech.co.in/gc2/demo/cartdemo.php");
      
      // Specify "Return to xyz" link
      $cart->SetContinueShoppingUrl("http://navkarinfotech.co.in/gc2/demo/cartdemo.php");
      
      // Request buyer's phone number
      $cart->SetRequestBuyerPhone(true);
      
      // Display Google Checkout button
      echo $cart->CheckoutButtonCode("SMALL");

 

Hi All,

I am using above code for google checkout.

It do the payment properly

but I an not getting any response from the "Google Checkout" on the given URL.

I need it to insert the record in database.

response page is set to responsehandlerdemo.php.

 

I want to validate the payment on the my website (Something similar to paypal IPN)

 

can u pls help me ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.