Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:14:19+00:00 2026-05-26T18:14:19+00:00

I’ve integrated Google Checkout with a site, got it working / pretending to charge

  • 0

I’ve integrated Google Checkout with a site, got it working / pretending to charge people fine and also processing the order notifications fine.

However, when I make a request back to Google to get the details of the notification, I receive a 400 response, something about invalid XML.

Thing is, everything for this integration so far has been HTML key value pairs, but all of a sudden I need to parse and deal with XML? I may be missing something, but I can’t see where in the docs it tells me exactly what my request should look like.

See here:
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#Receiving_and_Processing_Notifications

It clearly lists an example with name / value pairs, yet apparently I actually need to send them as XML?

Here’s where I am right now:

<?php    $header_arr = array("Authorization: Basic ".$authKey,
                    "Content-Type: application/xml; charset=UTF-8",
            "Accept: application/xml; charset=UTF-8");

$request='type=notification-history-request&serial-number='.$serialNumber;

$ch = curl_init($test_URL);     
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_arr);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);

if (curl_errno($ch)) {
  $log.=', error! :'.curl_error($ch);
} else {
  $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  $log.=', status code is: '.$status_code;  //400
}
?>

This returns a 400 each time – yes I realise I’m setting an accept header for XML, this is as the docs specify, here: http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API.html#https_auth_scheme

So, I find myself needing to send the correct request… any ideas?

P.S I’ve also checked through google’s sample code but it’s so layered and dependency-ridden that while I’ve managed to use some of it, the rest is a mystery – so unless you can give me line numbers, the samples aren’t much help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:14:20+00:00Added an answer on May 26, 2026 at 6:14 pm

    OK turns out this was really simple.

    I had the param names wrong – ‘type’ should have been ‘_type’, like this:

    $request='_type=notification-history-request&serial-number='.$serialNumber;
    

    I’m getting the response I need now, panic averted 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.