Skip to content

Commit

Permalink
Merge pull request #567 from stripe/remi-add-account-links
Browse files Browse the repository at this point in the history
Add support for the Account Link resource
  • Loading branch information
ob-stripe authored Dec 11, 2018
2 parents 913b20c + 60fb559 commit 46240a0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ php:

env:
global:
- STRIPE_MOCK_VERSION=0.38.0
- STRIPE_MOCK_VERSION=0.39.0
matrix:
- AUTOLOAD=1
- AUTOLOAD=0
Expand Down
1 change: 1 addition & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

// Stripe API Resources
require(dirname(__FILE__) . '/lib/Account.php');
require(dirname(__FILE__) . '/lib/AccountLink.php');
require(dirname(__FILE__) . '/lib/AlipayAccount.php');
require(dirname(__FILE__) . '/lib/ApplePayDomain.php');
require(dirname(__FILE__) . '/lib/ApplicationFee.php');
Expand Down
21 changes: 21 additions & 0 deletions lib/AccountLink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Stripe;

/**
* Class AccountLink
*
* @property string $object
* @property int $created
* @property int $expires_at
* @property string $url
*
* @package Stripe
*/
class AccountLink extends ApiResource
{

const OBJECT_NAME = "account_link";

use ApiOperations\Create;
}
1 change: 1 addition & 0 deletions lib/Util/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static function convertToStripeObject($resp, $opts)

// business objects
\Stripe\Account::OBJECT_NAME => 'Stripe\\Account',
\Stripe\AccountLink::OBJECT_NAME => 'Stripe\\AccountLink',
\Stripe\AlipayAccount::OBJECT_NAME => 'Stripe\\AlipayAccount',
\Stripe\ApplePayDomain::OBJECT_NAME => 'Stripe\\ApplePayDomain',
\Stripe\ApplicationFee::OBJECT_NAME => 'Stripe\\ApplicationFee',
Expand Down
21 changes: 21 additions & 0 deletions tests/Stripe/AccountLinkTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Stripe;

class AccountLinkTest extends TestCase
{
public function testIsCreatable()
{
$this->expectsRequest(
'post',
'/v1/account_links'
);
$resource = AccountLink::create([
"account" => "acct_123",
"failure_url" => "https://stripe.com/failure",
"success_url" => "https://stripe.com/success",
"type" => "custom_account_verification",
]);
$this->assertInstanceOf("Stripe\\AccountLink", $resource);
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

define("MOCK_MINIMUM_VERSION", "0.38.0");
define("MOCK_MINIMUM_VERSION", "0.39.0");
define("MOCK_PORT", getenv("STRIPE_MOCK_PORT") ?: 12111);

// Send a request to stripe-mock
Expand Down

0 comments on commit 46240a0

Please sign in to comment.