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
https://forums.phpfreaks.com/topic/209646-google-checkout-response-check/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.