-
Notifications
You must be signed in to change notification settings - Fork 850
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from stripe/ob-source-transactions
Add support for listing source_transactions
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
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,13 @@ | ||
<?php | ||
|
||
namespace Stripe; | ||
|
||
/** | ||
* Class SourceTransaction | ||
* | ||
* @package Stripe | ||
*/ | ||
class SourceTransaction extends ApiResource | ||
{ | ||
|
||
} |
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; | ||
|
||
class SourceTransactionTest extends TestCase | ||
{ | ||
public function testList() | ||
{ | ||
$this->mockRequest( | ||
'GET', | ||
'/v1/sources/src_foo/source_transactions', | ||
array(), | ||
array( | ||
'object' => 'list', | ||
'url' => '/v1/sources/src_foo/source_transactions', | ||
'data' => array( | ||
array( | ||
'id' => 'srctxn_bar', | ||
'object' => 'source_transaction', | ||
), | ||
), | ||
'has_more' => false, | ||
) | ||
); | ||
|
||
$source = \Stripe\Source::constructFrom( | ||
array('id' => 'src_foo', 'object' => 'source'), | ||
new \Stripe\Util\RequestOptions() | ||
); | ||
|
||
$transactions = $source->sourceTransactions(); | ||
|
||
$this->assertTrue(is_array($transactions->data)); | ||
$this->assertSame('source_transaction', $transactions->data[0]->object); | ||
} | ||
} |