diff --git a/composer.json b/composer.json index 1567cc9..19dd61a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "@phpstan", "@phpunit" ], - "test:unit":"phpunit --configuration phpunit.xml --testdox --exclude e2e", + "test:unit":"phpunit --configuration phpunit.xml --testdox --exclude-group e2e", "test:e2e":"phpunit --configuration phpunit.xml --testdox --group e2e", "test:coverage":"phpunit --configuration phpunit.xml --coverage-clover build/logs/clover.xml --coverage-html build/coverage" }, diff --git a/src/Getnet/API/Credit.php b/src/Getnet/API/Credit.php index 45f5d9a..3f44d02 100644 --- a/src/Getnet/API/Credit.php +++ b/src/Getnet/API/Credit.php @@ -1,6 +1,8 @@ credentials_on_file_type; + } + + /** + * + * @param mixed $credentials_on_file_type + */ + public function setCredentialsOnFileType($credentials_on_file_type) + { + if (!in_array($credentials_on_file_type, [ + static::COF_ONE_CLICK, static::COF_ONE_CLICK_PAYMENT, static::COF_RECURRING, static::COF_RECURRING_PAYMENT + ])) + throw new GetnetException('Escolha uma forma de recorrência válida'); + + $this->credentials_on_file_type = $credentials_on_file_type; + + return $this; + } + + /** + * + * @return mixed + */ + public function getTransactionId() + { + return $this->transaction_id; + } + + /** + * + * @param mixed $transaction_id + */ + public function setTransactionId($transaction_id) + { + $this->transaction_id = (string) $transaction_id; + + return $this; + } + } \ No newline at end of file