Jump to content

XML/Google Checkout - Getting the data.


DanielWhite

Recommended Posts

Hello, I am trying to implement Google Checkout and have been trying to for a few months now, it's crap! Anyway does anybody know how I can get data from some xml.

 

when the order goes though, Google send me some xml with the order details on and it gets saved in a text file on my server.

 

What I wish to do is get the data out of the response Google sends to me so that I can save it to my database.

 

Does anybody know how I can this because Google is hopeless!

 

Sample xml response:

<?xml version="1.0" encoding="UTF-8"?>
<risk-information-notification xmlns="http://checkout.google.com/schema/2"
    serial-number="0b95f758-0332-45d5-aced-5da64c8fc5b9">
    <google-order-number>841171949013218</google-order-number>
    <risk-information>
        <eligible-for-protection>true</eligible-for-protection>
        <billing-address>
            <contact-name>John Smith</contact-name>
            <email>[email protected]</email>
            <address1>10 Example Road</address1>
            <city>Sampleville</city>
            <region>CA</region>
            <postal-code>94141</postal-code>
            <country-code>US</country-code>
        </billing-address>
        <avs-response>Y</avs-response>
        <cvn-response>M</cvn-response>
        <partial-cc-number>3719</partial-cc-number>
        <ip-address>10.11.12.13</ip-address>
        <buyer-account-age>6</buyer-account-age>
    </risk-information>
    <timestamp>2007-03-19T15:06:26.051Z</timestamp>
</risk-information-notification>

 

Thank you,

Daniel White.

Link to comment
https://forums.phpfreaks.com/topic/111138-xmlgoogle-checkout-getting-the-data/
Share on other sites

OK found out how, go to:

 

http://www.onlamp.com/pub/a/php/2004/01/15/simplexml.html

 

If you are using Google Checkout you will have problems with the - in the xml. Go to this post for help:

 

http://www.phpfreaks.com/forums/index.php/topic,203011.0.html

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.