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

lib: add IssuerFraudRecords #466

Merged
merged 1 commit into from
May 9, 2018
Merged
Show file tree
Hide file tree
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
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);
}
}