Jump to content

advice using Google checkout


edd12345678

Recommended Posts

Hi,

 

I was wondering if someone can help.

 

I am trying to implement a server to server Google checkout system on my website. 

 

I  have built my own custom shopping basket which meets my needs however I need to get my data in the correct format to send off for the payment to be taken by Google checkout. 

 

At present I have a sql table called basket which stores all of the items that a user adds to thier basket. 

 

The google checkout examle requires the data in the below format:

 

  $item_1 = new GoogleItem("product name ",      // Item name
                           "With S/N", // Item description
                           $total_count, // Quantity
                           10.99); // Unit price
  $item_1->SetURLDigitalContent('http://example.com/download.php?id=15',
                                'S/N: 123.123123-3213',
                                "Download Item1");
  $cart->AddItem($item_1);

 

The above code is obviously for just the one item.

 

Is it best to store the basket in a sql database and if so how would I go about retrieving the information from the database and then sending it to google in the above format bearing in mind there can be multiple items in the cart?

 

Thanks in advance

 

Edd

Link to comment
Share on other sites

 

Thankyou for your reply.

 

Thats what I thought.

 

What im struggling with is defining the array variable so that each row from the sql query is put into a seperate array and a new variable name for each product is created. eg. item1, item2 etc.

 

Any ideas?

 

 

Link to comment
Share on other sites

Thanks again for replying.

 

I have managed to build an arra. The challenge nowi is to get the information from it in the correct format to send off to google checkouts. 

 

Is it possible to do this? I need the data displayed as below.

So for each record stored in the array i will need to generate the below:

 

  $item_1 = new GoogleItem("product name ",      // Item name
                           "With S/N", // Item description
                           $total_count, // Quantity
                           10.99); // Unit priceow? 

 

Thanks again for your help so far.

 

 

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.