/**
  * Denormalizes data back into an object of the given class.
  *
  * @param mixed $data data to restore
  * @param string $class the expected class to instantiate
  * @param string $format format the given data was extracted from
  * @param array $context options available to the denormalizer
  *
  * @return object
  */
 public function denormalize($data, $class, $format = null, array $context = array())
 {
     $request = new PaymentRequest();
     $array = new SafeArrayAccess($data);
     $request->addTimestamp($array['@timestamp'])->addType($array['@type'])->addMerchantId($array['merchantid'])->addAccount($array['account'])->addChannel($array['channel'])->addOrderId($array['orderid'])->addHash($array['sha1hash'])->addPaymentsReference($array['pasref'])->addAuthCode($array['authcode'])->addRefundHash($array['refundhash'])->addFraudFilter($array['fraudfilter'])->addMobile($array['mobile'])->addToken($array['token']);
     $autoSettle = $this->denormaliseAutoSettle($array);
     if ($autoSettle != null) {
         $request->addAutoSettle($autoSettle);
     }
     $card = $this->denormaliseCard($array);
     if ($card != null) {
         $request->addCard($card);
     }
     $recurring = $this->denormaliseRecurring($array);
     if ($recurring != null) {
         $request->addRecurring($recurring);
     }
     $tssInfo = $this->denormaliseTssInfo($array);
     if ($tssInfo != null) {
         $request->addTssInfo($tssInfo);
     }
     $mpi = $this->denormaliseMpi($array);
     if ($mpi != null) {
         $request->addMpi($mpi);
     }
     $request->setAmount($this->denormaliseAmount($array));
     $request->setComments($this->denormaliseComments($array));
     return $request;
 }