Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer require tokenization response to include Transaction ID #14

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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