Skip to content

Commit

Permalink
Merge pull request #466 from stripe/md-ifrs
Browse files Browse the repository at this point in the history
lib: add IssuerFraudRecords
  • Loading branch information
brandur-stripe authored May 9, 2018
2 parents 5323360 + 1c0e29f commit ec8bb99
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
require(dirname(__FILE__) . '/lib/FileUpload.php');
require(dirname(__FILE__) . '/lib/Invoice.php');
require(dirname(__FILE__) . '/lib/InvoiceItem.php');
require(dirname(__FILE__) . '/lib/IssuerFraudRecord.php');
require(dirname(__FILE__) . '/lib/LoginLink.php');
require(dirname(__FILE__) . '/lib/Order.php');
require(dirname(__FILE__) . '/lib/OrderReturn.php');
Expand Down
27 changes: 27 additions & 0 deletions lib/IssuerFraudRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Stripe;

/**
* Class IssuerFraudRecord
*
* @property string $id
* @property string $object
* @property string $charge
* @property int $created
* @property int $post_date
* @property string $fraud_type
* @property bool $livemode
*
* @package Stripe
*/
class IssuerFraudRecord extends ApiResource
{
use ApiOperations\All;
use ApiOperations\Retrieve;

public static function classUrl()
{
return "/v1/issuer_fraud_records";
}
}
1 change: 1 addition & 0 deletions lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function convertToStripeObject($resp, $opts)
'file_upload' => 'Stripe\\FileUpload',
'invoice' => 'Stripe\\Invoice',
'invoiceitem' => 'Stripe\\InvoiceItem',
'issuer_fraud_record' => 'Stripe\\IssuerFraudRecord',
'login_link' => 'Stripe\\LoginLink',
'order' => 'Stripe\\Order',
'order_return' => 'Stripe\\OrderReturn',
Expand Down
29 changes: 29 additions & 0 deletions tests/Stripe/IssuerFraudRecordTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Stripe;

class IssuerFraudRecordTest extends TestCase
{
const TEST_RESOURCE_ID = 'issfr_123';

public function testIsListable()
{
$this->expectsRequest(
'get',
'/v1/issuer_fraud_records'
);
$resources = IssuerFraudRecord::all();
$this->assertTrue(is_array($resources->data));
$this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resources->data[0]);
}

public function testIsRetrievable()
{
$this->expectsRequest(
'get',
'/v1/issuer_fraud_records/' . self::TEST_RESOURCE_ID
);
$resource = IssuerFraudRecord::retrieve(self::TEST_RESOURCE_ID);
$this->assertInstanceOf("Stripe\\IssuerFraudRecord", $resource);
}
}

0 comments on commit ec8bb99

Please sign in to comment.