Skip to content

Commit

Permalink
No longer require tokenization response to include Transaction ID #14
Browse files Browse the repository at this point in the history
No longer require tokenization response to include Transaction ID
  • Loading branch information
azuradara authored Mar 30, 2022
2 parents 4c9afd0 + 3e50cea commit 1468c78
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/Models/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,9 @@ class Token
/** @var string */
private $id;

/** @var string */
private $transactionId;

public function __construct(string $id, string $transactionId)
public function __construct(string $id)
{
$this->id = $id;
$this->transactionId = $transactionId;
}

public function getTransactionId(): string
{
return $this->transactionId;
}

public function getId(): string
Expand All @@ -34,14 +25,13 @@ public static function createFromArray(array $attributes)
{
$hasMissingKeys = !isset(
$attributes['id'],
$attributes['transaction_id']
);

if ($hasMissingKeys) {
throw new InvalidArgumentException('missing keys in token response');
}

return new self($attributes['id'], $attributes['transaction_id']);
return new self($attributes['id']);
}

public function getPaymentURL($lang = 'en'): string
Expand Down

0 comments on commit 1468c78

Please sign in to comment.