An example of Google Checkout Integration in CakePHP

NOTE: You will have to make changes into the component code in order to get it working with you application. This is only a sample component and it should not be taken as a plug-and-play kind of component.

NOTE: Download the latest Google Checkout library files from here. After downloading it from this link you will have to make changes to component code where you “include” vendors files following the new file naming structure Google have laid there. As an alternate, I have attached vendors/google files with the new zip archive (This is an OLD one, it’s when i did this) but i would strongly recommend the use of new google checkout library.

I am posting an implementation of Google Checkout payment gateway in CakePHP which i had implemented an year ago in one of my client’s website. The implementation was based on the use of vendors and components. I placed all google checkout files in “app/vendors” folder and created a component to process transactions. The file structure of vendor file was something like the following:

vendors/google/calculations
vendors/google/cart
vendors/google/item

I am attaching a sample GoogleComponent with this post so that someone interested can check this component to get help in similar implementation.

Following is an example of controller action which i used to receive google callback.

public function googlecallback()    {
$this->autoRender=false;
App::import('Component', 'Google');
$this->Google = new GoogleComponent();
$this->Google->controller = $this;
$this->Google->Response();
}

Download Google Checkout Component

I hope this helps someone.

6 thoughts on “An example of Google Checkout Integration in CakePHP

  1. dont work :(
    i set
    $this->google_callback = Router::url(‘/user balanses/googlecallback’, true);
    but $this->google_callback never used and there is no path to this treatment

  2. Now a new problem – the order is paid, but the feedback does not work: (
    I call the component in UserBalansesController
    to refer to the googlecallback method, I specify the path googlecallback $ item-> SetURLDigitalContent (Router:: url (‘/ UserBalanses / googlecallback’, true), “”, “”);
    but in the $ post There is nothing that I am doing wrong?

    1. Are you able to access the url /UserBalanses/googlecallback using browser? Try writing $_REQUEST contents to a log file and re-try the checkout process after it works fine through your browser. Another thing is that it may not work on your local environment. So try testing it on a remote server (valid domain).

  3. unfortunately does not work, could you lay out the contents of a directory
    /app/vendor/google
    can i not download what you need?

    1. I apologize for not attaching the Google checkout library with this example. You can download it from here. If you download it from this link you will have to make changes to the code where you “include” vendors files following the new folder structure Google have laid there. Alternately, I have attached the vendors/google with the new zip archive but i would strongly recommend the use of new google checkout library.

Leave a Reply