/** * Check all fields match expected values. * * @param PaymentResponse $fromXmlResponse * @param PHPUnit_Framework_TestCase $testCase */ public static function checkUnmarshalledDCCPaymentResponse(PaymentResponse $fromXmlResponse, PHPUnit_Framework_TestCase $testCase) { $testCase->assertEquals(self::DCC_RATE_TIMESTAMP_RESPONSE, $fromXmlResponse->getTimeStamp()); $testCase->assertEquals(self::DCC_RATE_MERCHANT_ID_RESPONSE, $fromXmlResponse->getMerchantId()); $testCase->assertEquals(self::DCC_RATE_ACCOUNT_RESPONSE, $fromXmlResponse->getAccount()); $testCase->assertEquals(self::DCC_RATE_ORDER_ID_RESPONSE, $fromXmlResponse->getOrderId()); $testCase->assertEquals(self::DCC_RATE_RESULT_RESPONSE, $fromXmlResponse->getResult()); $testCase->assertEquals(self::DCC_RATE_CVN_RESULT_RESPONSE, $fromXmlResponse->getCvnResult()); $testCase->assertEquals(self::DCC_RATE_PASREF_RESPONSE, $fromXmlResponse->getPaymentsReference()); $testCase->assertEquals(self::DCC_RATE_CH_CURRENCY_RESPONSE, $fromXmlResponse->getDccInfoResult()->getCardHolderCurrency()); $testCase->assertEquals(self::DCC_RATE_CH_AMOUNT_RESPONSE, $fromXmlResponse->getDccInfoResult()->getCardHolderAmount()); $testCase->assertEquals(self::DCC_RATE_CH_RATE_RESPONSE, $fromXmlResponse->getDccInfoResult()->getCardHolderRate()); $testCase->assertEquals(self::DCC_RATE_MERCHANT_CURRENCY_RESPONSE, $fromXmlResponse->getDccInfoResult()->getMerchantCurrency()); $testCase->assertEquals(self::DCC_RATE_MERCHANT_AMOUNT_RESPONSE, $fromXmlResponse->getDccInfoResult()->getMerchantAmount()); $testCase->assertEquals(self::DCC_RATE_REQUEST_HASH_RESPONSE, $fromXmlResponse->getHash()); $testCase->assertTrue($fromXmlResponse->isSuccess()); }