[googlecheckout / Siriux] recieving 'The test failed...' error.
andy_uk
Joined: 2008-02-28
Posts: 32 |
Posted: Fri, 2008-11-14 10:24 |
Hello, When I try the 'Test notification URL' button for this URL 'https://www.mysite.co.uk/gallery/main.php' I get the following error message: When I create an order and then try the Google Checkout payment button from the checkout page I get this error: And I receive an email containing the following (merchant id & key altered): Administrative Notification: GoogleCheckout: there was a problem preparing an order when a user tried to use Google Checkout. We contacted Google at this url: https://checkout.google.com/api/checkout/v2/merchantCheckout/Merchant/000000000000000 The response code was: https://checkout.google.com/api/checkout/v2/merchantCheckout/Merchant/000000000000000HTTP/1.0 400 Bad Request The Google Website returned the following response in the body: <?xml version="1.0" encoding="UTF-8"?> <error xmlns="http://checkout.google.com/schema/2" serial-number="00000000-0000-0000-0000-000000000000"> <error-message>Error parsing XML; message from parser is: The entity "Atilde" was referenced, but not declared.</error-message> </error>
Help getting this to work would be greatly appreciated. |
|
Posts: 4342
Have you read (and acted upon) the section of the Codex Page (http://codex.gallery2.org/Gallery_2:Modules:checkoutgoogle) entitled "Configuring your Apache Webserver"?
Posts: 32
I looked at that and I'd already added the suggested code (as below) to my .htaccess file located in: gallery/
Is there another .htaccess file in a different folder I should have added the code to? Or is there anything else you can think of that I should modify too?
Posts: 4342
Forget about the HTTPS for now - just use your regular gallery url in the box, to make sure the auth data is being decoded correctly. If you get the test working with a regular url then you stress about the HTTPS after.
If that doesn't work, add this at line 87 of CheckoutGoogleResponseHelper.class:
and see what the test failure message is.
Posts: 32
I changed the test URL to: http://www.mysite.co.uk/gallery/main.php
I added that line in CheckoutGoogleResponseHelper.class as per below,
I get the same error messages as before (see below), is the code above in the correct place?
When I hit the test URL button I get this error:
The test failed. You cannot receive Google Checkout notifications at this url.
When I try to checkout I get this error:
Apologies. There was a problem preventing you from transferring to the Google Checkout service. Please try again, or choose another method of payment.
Posts: 4342
There's absolutely not point even trying that, until you get the test to succeed.
What url are you putting in the box?
Posts: 32
This is the actual URL I have there at the moment:
http://www.andybeck.co.uk/gallery/main.php
Posts: 4342
Looks like your php installation isn't picking up the http auth data from the request. Unfortunately that's an Apache/php thing and I don't have the resources to debug individual installations, so you're going to have to fall back on your own resources to fix it or find a workaround. Your hosting provider might be able to help. With that extra line added to the file, you'll know when the required data is being picked up because you'll see something like this:
If you get that, then take the debugging line out, and you should be hot to trot.
Let me know if you find out anything useful that I can put in the codex for other people. Oh, and definitely the nicest Gallery installation I've seen.
Posts: 32
OK, I'll get onto my host and see if they are able to offer any help, they are usually very good.
I'll report back here if I make any progress, and thanks for the compliment
Posts: 32
I've already had a reply from my host(34SP):
Are you able to provide the above requested info?
Posts: 4342
Hi Andy,
I've been reading up further. Useful info is at the codex page for the Gallery "http auth" module http://codex.gallery2.org/Gallery2:Modules:httpauth which faces the same issue as checkoutgoogle. This module defines a url-rewrite rule that (effectively) does the same thing as the the manual .htaccess (I'm looking at putting the rewrite rule into checkoutgoogle which would automate things a bit.)
I'll have a think what would narrow down the issue for your hosting provider to look at.
In the mean time you could try that module and if you get it to work let me know - that would be a good sign.
Posts: 32
Hi,
I installed that module from within my Firefox browser...
I then tried to login with IE but it wouldn't let me get in to the admin section, even though I was entering the correct username and password.
So I then went back to my open Firefox browser window and disabled then un-installed the HTTP Auth module.
I'm not very technical so didn't really know what to do to test if the module was working or not, and to be honest I was a bit worried about locking myself out of the admin section all together.
I can try installing the module again if you are able to give me more explicit instructions? Otherwise I'll wait and see what you come up with for me to ask my hosting provider to look at.
Thanks again for the help,
Andy
Posts: 4342
I'm just hacking the http auth module's code into checkoutgoogle to see if that works. I might have something to try in about 20 minutes.
Posts: 4342
Can you please try this version? Assuming you have url rewrites enabled via mod_rewrite (I think you do, and if you don't then please arrange it) can you check a) if it installs and b) if you see a a new rewrite rule offered to you in the url-rewrite admin page? if so, please activate it, and save. Then can you post or pm me a copy of your rewrite rules please?
If you get that far with no errors, then try the test page and see what happens.
I have no actual method to test this as at present I don't have a server running php-cgi that will use mod-rewrite. This is quite experimental, so please make sure you have a backup of your gallery installation.
Posts: 32
Alec,
I didn't actually have URL Rewrite installed, so I have now installed it and it seems to be working.
Just installing this version of CheckoutGoogle - uploaded the folder contained in the zip file to replace the one on my site.
So now in the plugins directory I have:
Checkout by Google
Complete checkout by Google Checkout
Incompatible plugin!
Core API Required: 7.34 (available: 7.18)
Plugin API Required: 3.0 (available: 3.5)
Does this mean I'll have to update those ?
I'm not going to be around until Sunday evening or Monday, can we pick up from here then?
Thanks for all the help so far,
Andy
Posts: 4342
You'll need Gallery 2.3 to use it.
EDIT... oh... wait... the old version (the 'official' release) was only compatible with 2.3 as well, unless you updated one of the core files (see the codex page!) so that's one additional reason why it's not working.
Posts: 32
I currently have Gallery version 2.2.3, should I upgrade this or just leave it as is?
Posts: 4342
Well, you should definitely upgrade, 2.2.3 is ages old, and several serious security fixes have been applied up to 2.2.6. Then 2.3 is a major upgrade. But it's not something you want to do lightly. Definitely have backups first, and be prepared to use them if it doesn't go smoothly.
Posts: 4342
New version of code attached.
This one should auto-generate a url-rewrite rule, if it's needed, so no need to edit .htaccess files any more. I'm waiting to hear from people if it works, particularly those with difficulties with this module up to now.
Posts: 32
Hi Alec,
I have successfully upgraded to gallery 2.3 and installed the newest updated checkoutgoogle module from your attached zip.
It looks like it has added 'Authorization Header' under a separate heading 'Checkout by Google' to the URL Rewrite module.
However, I still receive the same error below when trying the Test notification URL button:
The test failed. You cannot receive Google Checkout notifications at this url.
Do you have a list of files/settings I should check? (such as the .htaccess file for example)
Or anything I should ask my hosting provider to look into?
Thanks,
Andy
Posts: 32
Hi Alec,
I have successfully upgraded to gallery 2.3 and installed the newest updated checkoutgoogle module from your attached zip.
It looks like it has added 'Authorization Header' under a separate heading 'Checkout by Google' to the URL Rewrite module.
However, I still receive the same error below when trying the Test notification URL button:
The test failed. You cannot receive Google Checkout notifications at this url.
Do you have a list of files/settings I should check? (such as the .htaccess file for example)
Or anything I should ask my hosting provider to look into?
Thanks,
Andy
Posts: 4342
So the rewrite rules in your .htaccess should include this:
To copy the Authorization header into a request variable called "g2_authorization".
If your host is helpful and will enable rewrite logging (has to be done in the apache virtual-host configuration, can't be done locally in .htaccess, I read , then you should see something like this. if it's working - and if you make a request with an authorization header to the right page.
Now if that is working, it should be simple for Gallery to pick up the required info, which it isn't doing at the moment. It should be reflected straight back in the output, if you test to the ...main.php?g2_view=checkoutgoogle.HttpAuthWorks URI with an Authorization header - and at present that's giving nada.
So ... if your host will enable the logging temporarily we can see if the rewrite rule is doing anything useful.
Posts: 32
I have just asked my host for rewrite logging to be enabled.
My .htaccess file looks as below, let me know if anything needs altering:
By the way, in 'URL Rewrite Administration' I see the following:
Apache mod_rewrite
Testing if mod_rewrite is supported by the server. - Success
Gallery .htaccess file
Testing if Gallery can write to the .htaccess file. - Success
Posts: 4342
That's all good. Ok, so if you get a positive response on the "we've enabled logging" then let me know.
Oh, wait - can you *remove* the first section, the bit you added by hand - that's not needed any more (and in fact might well be screwing things up at this point.)
Posts: 4342
Good news... you can call off the Hosting Provider dogs - it looks like the right auth data is getting through now. (Did you just remove that entry?)
You can go ahead and try the test page again now...
Posts: 32
I will let you know when I recieve a responce from my host.
One thing I just thought I should mention about the URL Rewrite module, although it appears to have installed correctly, it doesn't seem to be working!
If I activate 'Show Item' then try to click on a thumbnail in the gallery to open a descriptive URL, I always get a 404 error. If I activate 'Download Item' the thumbnail images fail to load in.
This is despite the Test tab showing 'success' for both 'Apache mod_rewrite' and 'Gallery .htaccess file'.
Does this point to something obvious that might be wrong with my gallery/server setup?
Posts: 4342
You can turn off all the active rewrite rules in the admin page (download and show item I think are enabled by default) if they don't suit ... probably a good idea for now as that would be a problem for another thread (and probably another person!) - leave the checkoutgoogle one enabled of course.
Now, we don't need to wait for your host - try the test page again, as the auth data is getting through.
Posts: 32
Just had the following response from my host:
I've just tried Checkout Google, and yes, you're probably already ahead of me here, after hitting the test button I now get:
The test was succesful. You can receive Google Checkout notifications at this url.
And that was using https!
Posts: 4342
Hurrah. Nice to have a success story with this module, for once.
Interesting. That might indeed have made the difference...it's worth checking - try disabling the checkoutgoogle rewrite rule, verify that the entry has been removed from the .htaccess file, and then try the test page again. If it still works, then it was probably the change to the fastcgi configuration.
Please thank your hosting provider from me - and it looks like we don't need the rewrite logging after all. (How nice to have a hosting provider who's prepared to push the boat out for a customer...)
Posts: 32
However when attempting to submit an order to google sandbox I still get the following error:
Apologies. There was a problem preventing you from transferring to the Google Checkout service. Please try again, or choose another method of payment.
Posts: 4342
Ok.. but that's still progress! You should get an email with info about the error. What does it say?
Posts: 32
Alec,
After disabling the checkoutgoogle rule, I looked at the .htaccess file and all the rewrite stuff had gone, i tried the Checkout Google URL test button and it was back to its error state.
So it seems both the fastcgi configuration change and the URW Rewrite thing were required, i'll turn the URL rewrite back on now...
Andy
Posts: 32
Administrative Notification:
GoogleCheckout: there was a problem preparing an order when a user tried to use Google Checkout.
We contacted Google at this url:
https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/000000000000000
The response code was:
https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/000000000000000HTTP/1.0 400 Bad Request
The Google Website returned the following response in the body:
<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://checkout.google.com/schema/2" serial-number="00000000-0000-0000-0000-000000000000">
<error-message>Error parsing XML; message from parser is: The entity "Atilde" was referenced, but not declared.</error-message>
</error>
Posts: 4342
Hmm... Atilde is a latin A with the ~ symbol over it.
Can you add these lines to SendData.inc at 163, please:
And try again.
Posts: 32
Administrative Notification:
GoogleCheckout: there was a problem preparing an order when a user tried to use Google Checkout.
We contacted Google at this url:
https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/000000000000000000
The content of our message was:
<?xml version="1.0" encoding="UTF-8"?>
<checkout-shopping-cart xmlns="http://checkout.google.com/schema/2">
<shopping-cart><merchant-private-data>
<transactionId>268</transactionId>
<mainURL>http://www.andybeck.co.uk/gallery/main.php</mainURL>
</merchant-private-data><items><item>
<item-name>Smiling Husky</item-name>
<item-description>Giclée Print on Paper</item-description>
<unit-price currency="GBP">33</unit-price>
<quantity>1</quantity>
</item></items>
</shopping-cart><checkout-flow-support>
<merchant-checkout-flow-support><shipping-methods>
<flat-rate-shipping name="Postage (please allow 7 days for delivery) ">
<price currency="GBP">8.00</price>
<shipping-restrictions>
<allowed-areas><world-area/></allowed-areas>
</shipping-restrictions>
</flat-rate-shipping>
</shipping-methods><edit-cart-url>http://www.andybeck.co.uk/gallery/main.php?g2_view=checkout.Confirm</edit-cart-url>
<continue-shopping-url>http://www.andybeck.co.uk/gallery/main.php?g2_controller=checkout.Complete&g2_transactionId=268&g2_verify1=0000000000&g2_verify2=0000000000000000000.00000000&g2_authToken=000000000000</continue-shopping-url>
</merchant-checkout-flow-support>
</checkout-flow-support></checkout-shopping-cart>
The response code was:
https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/00000000000000000HTTP/1.0 400 Bad Request
The Google Website returned the following response in the body:
<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://checkout.google.com/schema/2" serial-number="00000000-0000-0000-0000-000000000">
<error-message>Error parsing XML; message from parser is: The entity "Atilde" was referenced, but not declared.</error-message>
</error>
You can check the status of this order any time at this location:
http://www.andybeck.co.uk/gallery/main.php?g2_view=checkout.OrderStatus&g2_transactionId=268&g2_verify1=0000000000&g2_verify2=0000000000000000000000000.0000000
So does it mean it is the French word giclee which was in my item description with the accent on the first e that is causing a problem?
Posts: 4342
The item you had in the basket (the Gicle s.p?) print - try renaming it without the international character. It appears there's a character encoding issue passing stuff to google. But I can look at that later.
yes.
Posts: 32
It appears to be the case, Google Checkout doesn't seem to like characters with accents.
I take my hat off to you sir, you have the patience of a saint!
Checkout Google now seems working exactly as it should, that URL Rewrite add-on to the module might be worth including in your next release as it is certainly required for my particular set up.
Thanks once again for all your help with this Alec,
Andy
Posts: 4342
No problem. As I said, it's nice to have a success story. I'll look into the international characters issue, too.
I'll probably upgrade the checkoutgoogle code on the repository some time soon too.
If you want to do me a favour, and if your checkout installation isn't too precious (i.e. you don't mind uninstalling/reinstalling checkout if the worst comes to the worst) can you try the upgrade in this thread, and let me know (there) if it goes smoothly?
http://gallery.menalto.com/node/83562
Posts: 4342
I think the international characters issue is fixed; the code is in the Subversion repository, and it should be downloadable via "get new plugins" in a few hours.
You're looking for code revision 1686.
Posts: 4342
After some extensive work with neilj, I've changed the rewrite rule, and added an extra option in the admin page.
It's for anyone using cgi-based php who needs to have the authorization data written into a url parameter using the URL Rewrite module, and who can't presently get the test to work.
The international characters issue is fixed.
@andy_uk: could you try updating to the new version and let me know if the test button works for you?
The newest version is code revision 1688 and should be available from the get more plugins page in about 5 hours from now.