public function __construct($responseArray)
 {
     $apiPayload = $responseArray->APIResponse;
     $apiResponse = new APIResponse($apiPayload->ResponseCode, $apiPayload->ResponseText);
     parent::__construct($apiResponse);
     if ($apiResponse->getResponseCode() == "0") {
         $this->authKey = $responseArray->AuthKey;
     }
 }
 public function __construct($responseArray)
 {
     $apiPayload = $responseArray->APIResponse;
     $apiResponse = new APIResponse($apiPayload->ResponseCode, $apiPayload->ResponseText);
     parent::__construct($apiResponse);
     if ($apiResponse->getResponseCode() == "0") {
         $elements = $responseArray->TxnResp;
         $this->action = $elements->Action;
         $this->amount = $elements->Amount;
         $this->amountSurcharge = $elements->AmountSurcharge;
         $this->threeDSResponse = $elements->ThreeDSResponse;
         $this->authoriseId = $elements->AuthoriseId;
         $this->bankAccountDetails = $elements->BankAccountDetails;
         $this->bankResponseCode = $elements->BankResponseCode;
         $this->cvnResult = new CVNResult($elements->CVNResult);
         $ccDetails = new CardDetails();
         $cardPayload = $elements->CardDetails;
         $ccDetails->setCardHolderName($cardPayload->CardHolderName);
         $ccDetails->setExpiryDate($cardPayload->ExpiryDate);
         $ccDetails->setMaskedCardNumber($cardPayload->MaskedCardNumber);
         $this->cardDetails = $ccDetails;
         $this->cardType = $elements->CardType;
         $this->currency = $elements->Currency;
         $this->isThreeDS = $elements->IsThreeDS;
         $this->isCVNPresent = $elements->IsCVNPresent;
         $this->merchantNumber = $elements->MerchantNumber;
         $this->originalTxnNumber = $elements->OriginalTxnNumber;
         $this->processedDateTime = $elements->ProcessedDateTime;
         $this->rrn = $elements->RRN;
         $this->receiptNumber = $elements->ReceiptNumber;
         $this->crn1 = $elements->Crn1;
         $this->crn2 = $elements->Crn2;
         $this->crn3 = $elements->Crn3;
         $this->responseCode = $elements->ResponseCode;
         $this->responseText = $elements->ResponseText;
         $this->billerCode = $elements->BillerCode;
         $this->settlementDate = $elements->SettlementDate;
         $this->source = $elements->Source;
         $this->subType = $elements->SubType;
         $this->storeCard = $elements->StoreCard;
         $this->txnNumber = $elements->TxnNumber;
         $this->type = $elements->Type;
         $this->isTestTxn = $elements->IsTestTxn;
         $fsDetails = new FraudScreeningResponse($elements->FraudScreeningResponse);
         $this->fraudScreeningResponse = $fsDetails;
         if (isset($elements->DVToken)) {
             $this->dvtoken = $elements->DVToken;
         }
         if (isset($elements->EmailAddress)) {
             $this->emailAddress = $elements->EmailAddress;
         }
     }
 }
 public function __construct($responseArray)
 {
     $apiPayload = $responseArray->APIResponse;
     $apiResponse = new APIResponse($apiPayload->ResponseCode, $apiPayload->ResponseText);
     parent::__construct($apiResponse);
     $this->transactions = array();
     if ($apiResponse->getResponseCode() == "0") {
         $transactionList = $responseArray->TxnRespList;
         foreach ($transactionList as $transaction) {
             $transactionPayload = (object) array();
             $transactionPayload->APIResponse = $apiPayload;
             $transactionPayload->TxnResp = $transaction;
             $this->transactions[] = new TransactionResponse($transactionPayload);
         }
     }
 }
 public function __construct($responseArray)
 {
     $apiPayload = $responseArray->APIResponse;
     $apiResponse = new APIResponse($apiPayload->ResponseCode, $apiPayload->ResponseText);
     parent::__construct($apiResponse);
     if ($apiResponse->getResponseCode() == "0") {
         $elements = $responseArray->DVTokenResp;
         $this->cardDetails = new CardDetails($elements->CardDetails);
         $this->cardType = $elements->CardType;
         $this->emailAddress = $elements->EmailAddress;
         $this->crn1 = $elements->Crn1;
         $this->crn2 = $elements->Crn2;
         $this->crn3 = $elements->Crn3;
         $this->token = $elements->DVToken;
     }
 }