/** * Tests the hash calculation for an auth payment. */ public function testAuthMobileHashGeneration() { $request = new PaymentRequest(); $request->addType(PaymentType::AUTH_MOBILE)->addTimeStamp(SampleXmlValidationUtils::AUTH_MOBILE_TIMESTAMP)->addMerchantId(SampleXmlValidationUtils::AUTH_MOBILE_MERCHANT_ID)->addOrderId(SampleXmlValidationUtils::AUTH_MOBILE_ORDER_ID)->addToken(SampleXmlValidationUtils::AUTH_MOBILE_TOKEN); $request->hash(SampleXmlValidationUtils::SECRET); $this->assertEquals(SampleXmlValidationUtils::AUTH_MOBILE_REQUEST_HASH, $request->getHash()); }
/** * Tests the hash calculation for a stored card dcc rate payment. */ public function testStoredCardDccRateHashGeneration() { $request = new PaymentRequest(); $request->addType(PaymentType::STORED_CARD_DCC_RATE)->addTimeStamp(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_TIMESTAMP)->addMerchantId(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_MERCHANT_ID)->addAmount(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_AMOUNT)->addCurrency(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_CURRENCY)->addOrderId(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_ORDER_ID)->addPayerReference(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_PAYREF); $request->hash(SampleXmlValidationUtils::SECRET); $this->assertEquals(SampleXmlValidationUtils::STORED_CARD_DCC_RATE_REQUEST_HASH, $request->getHash()); }