/**
  * Send a <notification-history-request> request to Google Checkout
  *
  * info: {@link http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_History_API.html}
  *
  * @param string $sn serial number
  * @param string $npt next page token
  * @param array $orders array of string google order numbers
  * @param array $nt array of string notification types
  * @param array $st array of tracking data where tracking code => carrier
  * @param string @st string of start time in format YYYY-MM-DD[T]HH:MM:SS[Timezone] ie
  *        2010-05-01T05:00:00Z
  * @param string @et string of end time in format YYYY-MM-DD[T]HH:MM:SS[Timezone] ie
  *        2010-05-02T05:00:00Z
  * @param string $cp path to SSL certificates for peer validation
  */
 function SendNotificationHistoryRequest($sn = null, $npt = null, $orders = array(), $nt = array(), $st = null, $et = null, $cp = null)
 {
     $postargs = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
     $postargs .= "<notification-history-request xmlns=\"" . $this->schema_url . "\">";
     if (isset($sn)) {
         $postargs .= "<serial-number>" . $sn . "</serial-number>";
     } elseif (isset($npt)) {
         $postargs .= "<next-page-token>" . $npt . "</next-page-token>";
     } else {
         if (isset($orders) && count($orders) > 0) {
             $postargs .= "<order-numbers>";
             foreach ($orders as $order) {
                 $postargs .= "<google-order-number>" . $order . "</google-order-number>";
             }
             $postargs .= "</order-numbers>";
         }
         if (isset($nt) && count($nt) > 0) {
             $postargs .= "<notification-types>";
             foreach ($nt as $notification_type) {
                 $postargs .= "<notification-type>" . $notification_type . "</notification-type";
             }
             $postargs .= "</notification-types>";
         }
         if (isset($st) && isset($et)) {
             $postargs .= "<start-time>" . $st . "</start-time>";
             $postargs .= "<end-time>" . $et . "</end-time>";
         }
     }
     $postargs .= "</notification-history-request>";
     $Grequest = new Espresso_GoogleRequest($this->merchant_id, $this->merchant_key, $this->server_type);
     $Grequest->SetCertificatePath($cp);
     return $Grequest->SendReq($Grequest->GetReportUrl(), $Grequest->GetAuthenticationHeaders(), $postargs);
 }