-
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 new MinFraudConfig and MinFraudAPIEnpoint classes
- Loading branch information
1 parent
b9f75d7
commit a9d2944
Showing
4 changed files
with
150 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?php | ||
|
||
namespace Grayl\Gateway\MinFraud\Config; | ||
|
||
use Grayl\Gateway\Common\Config\GatewayAPIEndpointAbstract; | ||
|
||
/** | ||
* Class MinFraudAPIEndpoint | ||
* The class of a single MinFraud API endpoint | ||
* | ||
* @package Grayl\Gateway\MinFraud | ||
*/ | ||
class MinFraudAPIEndpoint extends GatewayAPIEndpointAbstract | ||
{ | ||
|
||
/** | ||
* The MinFraud user ID | ||
* | ||
* @var string | ||
*/ | ||
protected string $user_id; | ||
|
||
/** | ||
* The MinFraud license key | ||
* | ||
* @var string | ||
*/ | ||
protected string $license_key; | ||
|
||
|
||
/** | ||
* Class constructor | ||
* | ||
* @param string $api_endpoint_id The ID of this API endpoint (default, provision, etc.) | ||
* @param string $user_id The MinFraud user ID | ||
* @param string $license_key The MinFraud license key | ||
*/ | ||
public function __construct ( string $api_endpoint_id, | ||
string $user_id, | ||
string $license_key ) | ||
{ | ||
|
||
// Call the parent constructor | ||
parent::__construct( $api_endpoint_id ); | ||
|
||
// Set the class data | ||
$this->setUserID( $user_id ); | ||
$this->setLicenseKey( $license_key ); | ||
} | ||
|
||
|
||
/** | ||
* Gets the Minfraud User ID | ||
* | ||
* @return string | ||
*/ | ||
public function getUserID (): string | ||
{ | ||
|
||
// Return it | ||
return $this->user_id; | ||
} | ||
|
||
|
||
/** | ||
* Sets the MinFraud user ID | ||
* | ||
* @param string $user_id The MinFraud user ID | ||
*/ | ||
public function setUserID ( string $user_id ): void | ||
{ | ||
|
||
// Set the MinFraud user ID | ||
$this->user_id = $user_id; | ||
} | ||
|
||
|
||
/** | ||
* Gets the MinFraud license key | ||
* | ||
* @return string | ||
*/ | ||
public function getLicenseKey (): string | ||
{ | ||
|
||
// Return it | ||
return $this->license_key; | ||
} | ||
|
||
|
||
/** | ||
* Sets the MinFraud license key | ||
* | ||
* @param string $license_key The MinFraud license key | ||
*/ | ||
public function setLicenseKey ( string $license_key ): void | ||
{ | ||
|
||
// Set the MinFraud license key | ||
$this->license_key = $license_key; | ||
} | ||
|
||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Grayl\Gateway\MinFraud\Config; | ||
|
||
use Grayl\Gateway\Common\Config\GatewayConfigAbstract; | ||
|
||
/** | ||
* Class MinFraudGatewayData | ||
* The class of the config for MinFraud gateways | ||
* @method MinFraudAPIEndpoint getLiveAPIEndpoint( string $api_endpoint_id ) | ||
* @method void setLiveAPIEndpoint( MinFraudAPIEndpoint $api_endpoint ) | ||
* @method MinFraudAPIEndpoint getSandboxAPIEndpoint( string $api_endpoint_id ) | ||
* @method void setSandboxAPIEndpoint( MinFraudAPIEndpoint $api_endpoint ) | ||
* | ||
* @package Grayl\Gateway\MinFraud | ||
*/ | ||
class MinFraudConfig extends GatewayConfigAbstract | ||
{ | ||
|
||
// No overrides to the abstract class | ||
|
||
} |
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