Example #1
0
 /**
  * Validates transaction
  *
  * @param boolean $respond Respond with XML data
  * @return NotifyResponse
  */
 public function validatePayment($respond = true)
 {
     $raw = file_get_contents("php://input");
     if (!$raw) {
         return new NotifyResponse([], 'POST data is empty');
     }
     $template = new Template('');
     $data = $template->decode($raw);
     $result = new NotifyResponse($data);
     if ($result->isDataOk() && $respond) {
         header("Content-type: text/xml;encoding=utf8");
         echo '<Response>OK</Response>';
     }
     return $result;
 }