Beispiel #1
0
 /**
  * @param Response\TransactionInfo $response
  *
  * @throws Exception\MethodNotSupportedException
  */
 public function transactionInfoResponse(Response\TransactionInfo $response)
 {
     $this->setSuccess($response);
     if ($response->getSuccess()) {
         $creditCard = new Helper\CreditCard();
         $cardInfo = $response->getApiResponse('card');
         $billingData = $response->getApiResponse('billing');
         $cardExpMonth = $cardInfo['expiry_month'];
         $cardExpYear = $cardInfo['expiry_year'] + 2000;
         $creditCard->setCardExpiry($cardExpMonth, $cardExpYear);
         $creditCard->setCardNumber('0000 0000 0000 ' . $cardInfo['last_four']);
         $creditCard->setName($cardInfo['name']);
         $creditCard->setAddress1($billingData['address_line1']);
         $creditCard->setAddress2($billingData['address_line2']);
         $creditCard->setCity($billingData['city']);
         $creditCard->setState($billingData['province']);
         $creditCard->setZipCode($billingData['postal_code']);
         $creditCard->setCountry($billingData['country']);
         $creditCard->setPhoneNumber($billingData['phone_number']);
         $creditCard->setEmailAddress($billingData['email_address']);
         $response->setCreditCard($creditCard);
         $response->setAmount($response->getApiResponse('amount'));
         $response->setOperation($response->getApiResponse('type'));
         $response->setDate(new \DateTime($response->getApiResponse('created')));
     }
 }