// Your Merchant Key $server_type = "sandbox"; // change this to go live $currency = 'USD'; // set to GBP if in the UK $Gresponse = new GoogleResponse($merchant_id, $merchant_key); $Grequest = new GoogleRequest($merchant_id, $merchant_key, $server_type, $currency); //serial-number //Setup the log file $Gresponse->SetLogFiles(RESPONSE_HANDLER_ERROR_LOG_FILE, RESPONSE_HANDLER_LOG_FILE, L_ALL); $Grequest->SetLogFiles(RESPONSE_HANDLER_ERROR_LOG_FILE, RESPONSE_HANDLER_LOG_FILE, L_ALL); //How to grab the serial number!!!! $serial = $_POST["serial-number"]; $Gresponse->log->LogResponse("serial:" . $serial); if ($serial != null) { $Grequest->SendNotificationRequest($serial); $Gresponse->SendAck($serial); return; } // Retrieve the XML sent in the HTTP POST request to the ResponseHandler $xml_response = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents("php://input"); if (get_magic_quotes_gpc()) { $xml_response = stripslashes($xml_response); } list($root, $data) = $Gresponse->GetParsedXML($xml_response); $Gresponse->SetMerchantAuthentication($merchant_id, $merchant_key); /*$status = $Gresponse->HttpAuthentication(); if(! $status) { die('authentication failed'); }*/