public function decline() { if ($this->isBeingVerified()) { $result = \Paynl\Transaction::decline($this->getId()); $this->_reload(); //status is changed, so refresh the object return $result; } else { throw new Error("Cannot decline transaction because it does not have the status 'verify'"); } }
public function testDeclineWithoutTransactionId() { \Paynl\Config::setApiToken('123456789012345678901234567890'); $this->setExpectedException('\\Paynl\\Error\\Required'); \Paynl\Transaction::decline(''); }