Skip to content

Commit

Permalink
Throw exception from PrivatbankarRecurrent->checkValid()
Browse files Browse the repository at this point in the history
We are not validating token.

Found by new, strictier PHPStan:

- Method Crm\PrivatbankarModule\Gateways\PrivatbankarRecurrent::checkValid()
  should return bool but return statement is missing.

remp/crm#2007
  • Loading branch information
markoph committed Sep 16, 2021
1 parent 5f2a5b1 commit 79cf1b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Gateways/PrivatbankarRecurrent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ public function charge($payment, $token): string
public function checkValid($token)
{
// TODO: 24 charges or 2 years since initial payment
throw new InvalidRequestException(self::GATEWAY_CODE . " gateway doesn't support checking if token is still valid");
}

public function checkExpire($recurrentPayments)
{
throw new InvalidRequestException("gateway doesn't support token expiration check");
throw new InvalidRequestException(self::GATEWAY_CODE . " gateway doesn't support token expiration check");
}

public function hasRecurrentToken(): bool
Expand Down

0 comments on commit 79cf1b3

Please sign in to comment.