-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for radar.early_fraud_warning resource
- Loading branch information
Showing
6 changed files
with
69 additions
and
2 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,36 @@ | ||
<?php | ||
|
||
namespace Stripe\Radar; | ||
|
||
/** | ||
* Class EarlyFraudWarning | ||
* | ||
* @property string $id | ||
* @property string $object | ||
* @property bool $actionable | ||
* @property string $charge | ||
* @property int $created | ||
* @property string $fraud_type | ||
* @property bool $livemode | ||
* | ||
* @package Stripe\Radar | ||
*/ | ||
class EarlyFraudWarning extends \Stripe\ApiResource | ||
{ | ||
const OBJECT_NAME = "radar.early_fraud_warning"; | ||
|
||
use \Stripe\ApiOperations\All; | ||
use \Stripe\ApiOperations\Retrieve; | ||
|
||
/** | ||
* Possible string representations of an early fraud warning's fraud type. | ||
* @link https://stripe.com/docs/api/early_fraud_warnings/object#early_fraud_warning_object-fraud_type | ||
*/ | ||
const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; | ||
const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; | ||
const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; | ||
const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; | ||
const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; | ||
const FRAUD_TYPE_MISC = 'misc'; | ||
const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; | ||
} |
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,29 @@ | ||
<?php | ||
|
||
namespace Stripe\Radar; | ||
|
||
class EarlyFraudWarningTest extends \Stripe\TestCase | ||
{ | ||
const TEST_RESOURCE_ID = 'issfr_123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v1/radar/early_fraud_warnings' | ||
); | ||
$resources = EarlyFraudWarning::all(); | ||
$this->assertTrue(is_array($resources->data)); | ||
$this->assertInstanceOf("Stripe\\Radar\\EarlyFraudWarning", $resources->data[0]); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v1/radar/early_fraud_warnings/' . self::TEST_RESOURCE_ID | ||
); | ||
$resource = EarlyFraudWarning::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf("Stripe\\Radar\\EarlyFraudWarning", $resource); | ||
} | ||
} |
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