Ejemplo n.º 1
0
 /**
  * @param $value
  * @param Processor $processor
  * @return \Upg\Library\Request\RequestInterface
  */
 public function unserializeProperty(Processor $processor, $value)
 {
     $paymentInstrument = new PaymentInstrument();
     $paymentInstrument->setUnserializedData($value);
     if ($paymentInstrument->getPaymentInstrumentType() == PaymentInstrument::PAYMENT_INSTRUMENT_TYPE_CARD) {
         list($year, $month) = explode('-', $value['validity']);
         $dateTime = new \DateTime();
         $dateTime->setDate($year, $month, 1);
         $paymentInstrument->setValidity($dateTime);
     }
     return $paymentInstrument;
 }