Google checkout order details issue

my client wants to be able to make their purchases directly from the cart skipping marketpresses in-built shipping and address forms and instead getting all the details from the payment site. I have this working for Amazon payments but am having trouble with payments through google checkout, for some reason the get_transient statement used to clear the cart and get the details of purchased products is timing out (or so it seems) so the orders are added to the system with no details of products and the cart isnt emptied

any ideas why it might be timing out or how to get arround this?

  • Timothy Bowers

    Hey there.

    Really this is out of the scope of our plugin and support, it really needs a developer to look at that for you and code it up.

    I can ping our developer for some feedback here, as he knows the code best he might have a quick tip of two.

    Before doing so can you please provide code samples of your custom stuff to make it easier to see if there is an issue there.

    Take care.

  • kimedia

    hey here is the code we have for the payments through google checkout, let me know if there are other areas of the code you think you may need

    foreach ((array)$mp_gateway_active_plugins as $plugin) {
    		 	if($plugin->public_name == 'Google Checkout')
    		 	{
    		 		$i=1;
    		 $content.=		"<form method=\"POST\"
      action=\"https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/{$plugin->API_Merchant_id}\"
          accept-charset=\"utf-8\">";
          	$carts = $mp->get_cart_contents($mp->global_cart);
    		 $order_id = $mp->generate_order_id();
    		foreach ($carts as $product_id => $variations) {
    			foreach ($variations as $data) {
    				$thispost = get_post( $product_id );
    				$item1Title = $thispost->post_title;
    				if(strlen($thispost->post_content) > 0)
    				{
    					$item1Description = $thispost->post_content;
    				}
    				else
    				{
    
    					$item1Description =  apply_filters('mp_product_name_display_in_cart', $data['name'], $product_id);
    				}
    
    				$price= $data['price'] * $data['quantity'];
     $content.= "<input type=\"hidden\" name=\"item_name_$i\" value=\"".$item1Title."\"/>";
      $content.="<input type=\"hidden\" name=\"item_description_$i\" value=\"".$item1Description."\"/>
    <input type=\"hidden\" name=\"item_quantity_$i\" value=\"".$data['quantity']."\"/>
      <input type=\"hidden\" name=\"item_price_$i\" value=\"".$data['price']."\"/>
    <input type=\"hidden\" name=\"item_currency_$i\" value=\"GBP\"/>
    <input type=\"hidden\" name=\"shopping-cart.merchant-private-data\" value=\"".$order_id."\">";
    				$i++;
    			}
    
    		}
    		 		$content.="<input type=\"hidden\" name=\"_charset_\"/>
      <input type=\"image\" name=\"Google Checkout\" alt=\"Fast checkout through Google\"
    src=\"".$plugin->method_button_img_url."\"
    />
    
    </form>";
  • Aaron

    GC does things so very strangely, it took some real hacking to tie it in to MarketPress. My guess is the issue you are having is you don't have GC setup to post back the proper data to the gateways IPN handler to create the order in the system.

    Honestly though if you are trying to make all those selections on the Google side, then you'll need to create your own custom IPN handler script to build up the order and add it to the system with all the proper data.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.