-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Account trait and methods for user ID, username MD5
- Loading branch information
1 parent
b536222
commit 4dd34e6
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace Grayl\Gateway\MinFraud\Traits; | ||
|
||
use Grayl\Mixin\Common\Entity\KeyedDataBag; | ||
|
||
/** | ||
* Trait MinFraudAccountParametersTrait. | ||
* The trait for manipulating MinFraud account parameters in a MinFraudInsightsRequestData entity. | ||
* | ||
* @property KeyedDataBag $account_parameters Omnipay account parameters bag ( key = value format ) | ||
* @package Grayl\Gateway\MinFraud | ||
*/ | ||
trait MinFraudAccountParametersTrait | ||
{ | ||
|
||
/** | ||
* Gets the user ID | ||
* | ||
* @return int | ||
*/ | ||
public function getUserID (): int | ||
{ | ||
|
||
// Return it | ||
return $this->account_parameters->getVariable( 'user_id' ); | ||
} | ||
|
||
|
||
/** | ||
* Sets the user ID | ||
* | ||
* @param int $user_id The internal numerical ID of the user | ||
*/ | ||
public function setUserID ( int $user_id ): void | ||
{ | ||
|
||
// Set the user ID | ||
$this->account_parameters->setVariable( 'user_id', | ||
$user_id ); | ||
} | ||
|
||
|
||
/** | ||
* Gets the username MD5 | ||
* | ||
* @return string | ||
*/ | ||
public function getUsernameMD5 (): string | ||
{ | ||
|
||
// Return it | ||
return $this->account_parameters->getVariable( 'username_md5' ); | ||
} | ||
|
||
|
||
/** | ||
* Sets the username MD5 | ||
* | ||
* @param string $username_md5 An MD5 hash of the username itself | ||
*/ | ||
public function setUsernameMD5 ( string $username_md5 ): void | ||
{ | ||
|
||
// Set the username MD5 | ||
$this->account_parameters->setVariable( 'username_md5', | ||
$username_md5 ); | ||
} | ||
|
||
} |