src/Domain/Payment/Model/PaymentToken.php line 13

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domain\Payment\Model;
  4. use Payum\Core\Model\Identity;
  5. use Payum\Core\Security\TokenInterface;
  6. use Payum\Core\Security\Util\Random;
  7. use Payum\Core\Storage\IdentityInterface;
  8. use Symfony\Component\Uid\Uuid;
  9. class PaymentToken implements TokenInterface
  10. {
  11.     private string $hash;
  12.     private string $afterUrl;
  13.     private string $targetUrl;
  14.     private string $gatewayName;
  15.     private object $details;
  16.     public function __construct()
  17.     {
  18.         $this->hash Random::generateToken();
  19.     }
  20.     public function setDetails($details): void
  21.     {
  22.         if ($details instanceof IdentityInterface && $details->getId() instanceof Uuid) {
  23.             $details = new Identity((string) $details->getId(), $details->getClass());
  24.         }
  25.         $this->details $details;
  26.     }
  27.     public function getHash(): string
  28.     {
  29.         return $this->hash;
  30.     }
  31.     public function setHash($hash): void
  32.     {
  33.         $this->hash $hash;
  34.     }
  35.     public function getTargetUrl(): string
  36.     {
  37.         return $this->targetUrl;
  38.     }
  39.     public function setTargetUrl($targetUrl): void
  40.     {
  41.         $this->targetUrl $targetUrl;
  42.     }
  43.     public function getAfterUrl(): string
  44.     {
  45.         return $this->afterUrl;
  46.     }
  47.     public function setAfterUrl($afterUrl): void
  48.     {
  49.         $this->afterUrl $afterUrl;
  50.     }
  51.     public function getGatewayName(): string
  52.     {
  53.         return $this->gatewayName;
  54.     }
  55.     public function setGatewayName($gatewayName): void
  56.     {
  57.         $this->gatewayName $gatewayName;
  58.     }
  59.     public function getDetails(): object
  60.     {
  61.         return $this->details;
  62.     }
  63. }