public function test_creditOrderRows_creditDirectBankOrderRows_returns_CreditTransaction() { $creditOrderRowsBuilder = WebPayAdmin::creditOrderRows(Svea\SveaConfig::getDefaultConfig())->setCountryCode("SE")->setOrderId(123456)->addNumberedOrderRow(TestUtil::createNumberedOrderRow(100.0, 1, 1))->setRowToCredit(1); $request = $creditOrderRowsBuilder->creditDirectBankOrderRows(); $this->assertInstanceOf("Svea\\HostedService\\CreditTransaction", $request); }
function test_validates_missing_required_method_for_creditOrderRows_creditCardOrderRows__mismatched_numberedOrderRows() { $creditOrderRowsObject = WebPayAdmin::creditOrderRows(Svea\SveaConfig::getDefaultConfig())->setOrderId("123456")->setCountryCode("SE")->addNumberedOrderRow(TestUtil::createNumberedOrderRow(100.0, 1, 1))->setRowToCredit(9); $this->setExpectedException('\\Svea\\ValidationException', 'every entry in rowsToCredit must match a numberedOrderRows. Use setRowsToCredit() and addNumberedOrderRow().'); $request = $creditOrderRowsObject->creditCardOrderRows(); // exception thrown in builder when selecting request class }