xml = $xml->saveXML(); $this->paymentId = (string)$xml->TransactionId; $this->authType = (string)$xml->AuthType; $this->creditCardMaskedPan = (string)$xml->CreditCardMaskedPan; $this->creditCardToken = (string)$xml->CreditCardToken; $this->cardStatus = (string)$xml->CardStatus; $this->shopOrderId = (string)$xml->ShopOrderId; $this->shop = (string)$xml->Shop; $this->terminal = (string)$xml->Terminal; $this->transactionStatus = (string)$xml->TransactionStatus; $this->currency = (string)$xml->MerchantCurrency; $this->reservedAmount = (string)$xml->ReservedAmount; $this->capturedAmount = (string)$xml->CapturedAmount; $this->refundedAmount = (string)$xml->RefundedAmount; $this->recurringMaxAmount = (string)$xml->RecurringMaxAmount; $this->paymentSchemeName = (string)$xml->PaymentSchemeName; $this->paymentNature = (string)$xml->PaymentNature; $this->paymentNatureService = new PensioAPIPaymentNatureService($xml->PaymentNatureService); $this->fraudRiskScore = (string)$xml->FraudRiskScore; $this->fraudExplanation = (string)$xml->FraudExplanation; $this->fraudRecommendation = (string)$xml->FraudRecommendation; $this->customerInfo = new PensioAPICustomerInfo($xml->CustomerInfo); $this->paymentInfos = new PensioAPIPaymentInfos($xml->PaymentInfos); $this->chargebackEvents = new PensioAPIChargebackEvents($xml->ChargebackEvents); if(isset($xml->ReconciliationIdentifiers->ReconciliationIdentifier)) { foreach($xml->ReconciliationIdentifiers->ReconciliationIdentifier as $reconXml) { $this->reconciliationIdentifiers[] = new PensioAPIReconciliationIdentifier($reconXml); } } } public function mustBeCaptured() { return $this->capturedAmount == '0'; } public function getCurrentStatus() { return $this->transactionStatus; } public function isReleased() { return $this->getCurrentStatus() == 'released'; } /** * @return PensioAPIReconciliationIdentifier */ public function getLastReconciliationIdentifier() { return $this->reconciliationIdentifiers[count($this->reconciliationIdentifiers) - 1]; } public function getId() { return $this->paymentId; } public function getAuthType() { return $this->authType; } public function getShopOrderId() { return $this->shopOrderId; } public function getMaskedPan() { return $this->creditCardMaskedPan; } public function getCreditCardToken() { return $this->creditCardToken; } public function getCardStatus() { return $this->cardStatus; } public function getPaymentNature() { return $this->paymentNature; } public function getPaymentSchemeName() { return $this->paymentSchemeName; } /** * @return PensioAPIPaymentNatureService */ public function getPaymentNatureService() { return $this->paymentNatureService; } /** * @return string */ public function getFraudRiskScore() { return $this->fraudRiskScore; } /** * @return string */ public function getFraudExplanation() { return $this->fraudExplanation; } /** * @return string */ public function getFraudRecommendation() { return $this->fraudRecommendation; } /** * @return PensioAPICustomerInfo */ public function getCustomerInfo() { return $this->customerInfo; } public function getPaymentInfo($keyName) { return $this->paymentInfos->getInfo($keyName); } public function getCurrency() { return $this->currency; } public function getReservedAmount() { return $this->reservedAmount; } public function getCapturedAmount() { return $this->capturedAmount; } public function getRefundedAmount() { return $this->refundedAmount; } /** * @return PensioAPIChargebackEvents */ public function getChargebackEvents() { return $this->chargebackEvents; } public function getXml() { return $this->xml; } }