Commit 509e3f8d authored by mattwire's avatar mattwire Committed by mattwire

Update stripe-php library

parent 113517f0
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
"packages": [ "packages": [
{ {
"name": "stripe/stripe-php", "name": "stripe/stripe-php",
"version": "v6.30.4", "version": "v6.40.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/stripe/stripe-php.git", "url": "https://github.com/stripe/stripe-php.git",
"reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" "reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "url": "https://api.github.com/repos/stripe/stripe-php/zipball/9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
"payment processing", "payment processing",
"stripe" "stripe"
], ],
"time": "2019-02-27T18:07:30+00:00" "time": "2019-06-27T23:24:51+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
......
...@@ -279,7 +279,7 @@ class ClassLoader ...@@ -279,7 +279,7 @@ class ClassLoader
*/ */
public function setApcuPrefix($apcuPrefix) public function setApcuPrefix($apcuPrefix)
{ {
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
} }
/** /**
...@@ -377,7 +377,7 @@ class ClassLoader ...@@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class; $subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) { while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos); $subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\'; $search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) { if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) { foreach ($this->prefixDirsPsr4[$search] as $dir) {
......
[ [
{ {
"name": "stripe/stripe-php", "name": "stripe/stripe-php",
"version": "v6.30.4", "version": "v6.40.0",
"version_normalized": "6.30.4.0", "version_normalized": "6.40.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/stripe/stripe-php.git", "url": "https://github.com/stripe/stripe-php.git",
"reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" "reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "url": "https://api.github.com/repos/stripe/stripe-php/zipball/9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", "reference": "9c22ffab790ef4dae0f371929de50e8b53c9ec8d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"squizlabs/php_codesniffer": "~2.0", "squizlabs/php_codesniffer": "~2.0",
"symfony/process": "~2.8" "symfony/process": "~2.8"
}, },
"time": "2019-02-27T18:07:30+00:00", "time": "2019-06-27T23:24:51+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
......
# Changelog # Changelog
## 6.40.0 - 2019-06-27
* [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs
## 6.39.2 - 2019-06-26
* [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()`
## 6.39.1 - 2019-06-25
* [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice`
## 6.39.0 - 2019-06-24
* [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default
## 6.38.0 - 2019-06-17
* [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs
## 6.37.2 - 2019-06-17
* [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc
* [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session`
## 6.37.1 - 2019-06-14
* [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc
## 6.37.0 - 2019-05-23
* [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource
## 6.36.0 - 2019-05-22
* [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types
* [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types
## 6.35.2 - 2019-05-20
* [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses
* [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions
* [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc
## 6.35.1 - 2019-05-20
* [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance
## 6.35.0 - 2019-05-14
* [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs
## 6.34.6 - 2019-05-13
* [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant
## 6.34.5 - 2019-05-06
* [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations
## 6.34.4 - 2019-05-06
* [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types
## 6.34.3 - 2019-05-01
* [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis
* [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed`
## 6.34.2 - 2019-04-26
* [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries
## 6.34.1 - 2019-04-25
* [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs
## 6.34.0 - 2019-04-24
* [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs
* [#639](https://github.com/stripe/stripe-php/pull/639) Fix multiple phpdoc issues
## 6.33.0 - 2019-04-22
* [#630](https://github.com/stripe/stripe-php/pull/630) Add support for the `TaxId` resource and APIs
## 6.32.1 - 2019-04-19
* [#636](https://github.com/stripe/stripe-php/pull/636) Correct type of `$personId` in PHPDoc
## 6.32.0 - 2019-04-18
* [#621](https://github.com/stripe/stripe-php/pull/621) Add support for `CreditNote`
## 6.31.5 - 2019-04-12
* [#628](https://github.com/stripe/stripe-php/pull/628) Add constants for `person.*` event types
* [#628](https://github.com/stripe/stripe-php/pull/628) Add missing constants for `Account` and `Person`
## 6.31.4 - 2019-04-05
* [#624](https://github.com/stripe/stripe-php/pull/624) Fix encoding of nested parameters in multipart requests
## 6.31.3 - 2019-04-02
* [#623](https://github.com/stripe/stripe-php/pull/623) Only use HTTP/2 with curl >= 7.60.0
## 6.31.2 - 2019-03-25
* [#619](https://github.com/stripe/stripe-php/pull/619) Fix PHPDoc return types for list methods for nested resources
## 6.31.1 - 2019-03-22
* [#612](https://github.com/stripe/stripe-php/pull/612) Add a lot of constants
* [#614](https://github.com/stripe/stripe-php/pull/614) Add missing subscription status constants
## 6.31.0 - 2019-03-18
* [#600](https://github.com/stripe/stripe-php/pull/600) Add support for the `PaymentMethod` resource and APIs
* [#606](https://github.com/stripe/stripe-php/pull/606) Add support for retrieving a Checkout `Session`
* [#611](https://github.com/stripe/stripe-php/pull/611) Add support for deleting a Terminal `Location` and `Reader`
## 6.30.5 - 2019-03-11
* [#607](https://github.com/stripe/stripe-php/pull/607) Correctly handle case where a metadata key is called `metadata`
## 6.30.4 - 2019-02-27 ## 6.30.4 - 2019-02-27
* [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc. * [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc.
......
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) [![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master)
You can sign up for a Stripe account at https://stripe.com. The Stripe PHP library provides convenient access to the Stripe API from
applications written in the PHP language. It includes a pre-defined set of
classes for API resources that initialize themselves dynamically from API
responses which makes it compatible with a wide range of versions of the Stripe
API.
## Requirements ## Requirements
...@@ -56,7 +60,7 @@ echo $charge; ...@@ -56,7 +60,7 @@ echo $charge;
## Documentation ## Documentation
Please see https://stripe.com/docs/api for up-to-date documentation. See the [PHP API docs](https://stripe.com/docs/api/php#intro).
## Legacy Version Support ## Legacy Version Support
...@@ -179,6 +183,17 @@ an intermittent network problem: ...@@ -179,6 +183,17 @@ an intermittent network problem:
[Idempotency keys][idempotency-keys] are added to requests to guarantee that [Idempotency keys][idempotency-keys] are added to requests to guarantee that
retries are safe. retries are safe.
### Request latency telemetry
By default, the library sends request latency telemetry to Stripe. These
numbers help Stripe improve the overall latency of its API for all users.
You can disable this behavior if you prefer:
```php
\Stripe\Stripe::setEnableTelemetry(false);
```
## Development ## Development
Get [Composer][composer]. For example, on Mac OS: Get [Composer][composer]. For example, on Mac OS:
......
...@@ -67,13 +67,16 @@ require(dirname(__FILE__) . '/lib/BalanceTransaction.php'); ...@@ -67,13 +67,16 @@ require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
require(dirname(__FILE__) . '/lib/BankAccount.php'); require(dirname(__FILE__) . '/lib/BankAccount.php');
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php'); require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php'); require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
require(dirname(__FILE__) . '/lib/Capability.php');
require(dirname(__FILE__) . '/lib/Card.php'); require(dirname(__FILE__) . '/lib/Card.php');
require(dirname(__FILE__) . '/lib/Charge.php'); require(dirname(__FILE__) . '/lib/Charge.php');
require(dirname(__FILE__) . '/lib/Checkout/Session.php'); require(dirname(__FILE__) . '/lib/Checkout/Session.php');
require(dirname(__FILE__) . '/lib/Collection.php'); require(dirname(__FILE__) . '/lib/Collection.php');
require(dirname(__FILE__) . '/lib/CountrySpec.php'); require(dirname(__FILE__) . '/lib/CountrySpec.php');
require(dirname(__FILE__) . '/lib/Coupon.php'); require(dirname(__FILE__) . '/lib/Coupon.php');
require(dirname(__FILE__) . '/lib/CreditNote.php');
require(dirname(__FILE__) . '/lib/Customer.php'); require(dirname(__FILE__) . '/lib/Customer.php');
require(dirname(__FILE__) . '/lib/CustomerBalanceTransaction.php');
require(dirname(__FILE__) . '/lib/Discount.php'); require(dirname(__FILE__) . '/lib/Discount.php');
require(dirname(__FILE__) . '/lib/Dispute.php'); require(dirname(__FILE__) . '/lib/Dispute.php');
require(dirname(__FILE__) . '/lib/EphemeralKey.php'); require(dirname(__FILE__) . '/lib/EphemeralKey.php');
...@@ -97,10 +100,12 @@ require(dirname(__FILE__) . '/lib/Order.php'); ...@@ -97,10 +100,12 @@ require(dirname(__FILE__) . '/lib/Order.php');
require(dirname(__FILE__) . '/lib/OrderItem.php'); require(dirname(__FILE__) . '/lib/OrderItem.php');
require(dirname(__FILE__) . '/lib/OrderReturn.php'); require(dirname(__FILE__) . '/lib/OrderReturn.php');
require(dirname(__FILE__) . '/lib/PaymentIntent.php'); require(dirname(__FILE__) . '/lib/PaymentIntent.php');
require(dirname(__FILE__) . '/lib/PaymentMethod.php');
require(dirname(__FILE__) . '/lib/Payout.php'); require(dirname(__FILE__) . '/lib/Payout.php');
require(dirname(__FILE__) . '/lib/Person.php'); require(dirname(__FILE__) . '/lib/Person.php');
require(dirname(__FILE__) . '/lib/Plan.php'); require(dirname(__FILE__) . '/lib/Plan.php');
require(dirname(__FILE__) . '/lib/Product.php'); require(dirname(__FILE__) . '/lib/Product.php');
require(dirname(__FILE__) . '/lib/Radar/EarlyFraudWarning.php');
require(dirname(__FILE__) . '/lib/Radar/ValueList.php'); require(dirname(__FILE__) . '/lib/Radar/ValueList.php');
require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php'); require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php');
require(dirname(__FILE__) . '/lib/Recipient.php'); require(dirname(__FILE__) . '/lib/Recipient.php');
...@@ -109,6 +114,7 @@ require(dirname(__FILE__) . '/lib/Refund.php'); ...@@ -109,6 +114,7 @@ require(dirname(__FILE__) . '/lib/Refund.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php'); require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportType.php'); require(dirname(__FILE__) . '/lib/Reporting/ReportType.php');
require(dirname(__FILE__) . '/lib/Review.php'); require(dirname(__FILE__) . '/lib/Review.php');
require(dirname(__FILE__) . '/lib/SetupIntent.php');
require(dirname(__FILE__) . '/lib/SKU.php'); require(dirname(__FILE__) . '/lib/SKU.php');
require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php'); require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php');
require(dirname(__FILE__) . '/lib/Source.php'); require(dirname(__FILE__) . '/lib/Source.php');
...@@ -117,6 +123,8 @@ require(dirname(__FILE__) . '/lib/Subscription.php'); ...@@ -117,6 +123,8 @@ require(dirname(__FILE__) . '/lib/Subscription.php');
require(dirname(__FILE__) . '/lib/SubscriptionItem.php'); require(dirname(__FILE__) . '/lib/SubscriptionItem.php');
require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php'); require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php');
require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php'); require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php');
require(dirname(__FILE__) . '/lib/TaxId.php');
require(dirname(__FILE__) . '/lib/TaxRate.php');
require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php'); require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
require(dirname(__FILE__) . '/lib/Terminal/Location.php'); require(dirname(__FILE__) . '/lib/Terminal/Location.php');
require(dirname(__FILE__) . '/lib/Terminal/Reader.php'); require(dirname(__FILE__) . '/lib/Terminal/Reader.php');
......
...@@ -42,6 +42,37 @@ class Account extends ApiResource ...@@ -42,6 +42,37 @@ class Account extends ApiResource
} }
use ApiOperations\Update; use ApiOperations\Update;
/**
* Possible string representations of an account's business type.
* @link https://stripe.com/docs/api/accounts/object#account_object-business_type
*/
const BUSINESS_TYPE_COMPANY = 'company';
const BUSINESS_TYPE_INDIVIDUAL = 'individual';
/**
* Possible string representations of an account's capabilities.
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
*/
const CAPABILITY_CARD_PAYMENTS = 'card_payments';
const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments';
const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments';
/**
* Possible string representations of an account's capability status.
* @link https://stripe.com/docs/api/accounts/object#account_object-capabilities
*/
const CAPABILITY_STATUS_ACTIVE = 'active';
const CAPABILITY_STATUS_INACTIVE = 'inactive';
const CAPABILITY_STATUS_PENDING = 'pending';
/**
* Possible string representations of an account's type.
* @link https://stripe.com/docs/api/accounts/object#account_object-type
*/
const TYPE_CUSTOM = 'custom';
const TYPE_EXPRESS = 'express';
const TYPE_STANDARD = 'standard';
public static function getSavedNestedResources() public static function getSavedNestedResources()
{ {
static $savedNestedResources = null; static $savedNestedResources = null;
...@@ -54,6 +85,7 @@ class Account extends ApiResource ...@@ -54,6 +85,7 @@ class Account extends ApiResource
return $savedNestedResources; return $savedNestedResources;
} }
const PATH_CAPABILITIES = '/capabilities';
const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; const PATH_EXTERNAL_ACCOUNTS = '/external_accounts';
const PATH_LOGIN_LINKS = '/login_links'; const PATH_LOGIN_LINKS = '/login_links';
const PATH_PERSONS = '/persons'; const PATH_PERSONS = '/persons';
...@@ -97,21 +129,6 @@ class Account extends ApiResource ...@@ -97,21 +129,6 @@ class Account extends ApiResource
return $this; return $this;
} }
/**
* @param array|null $params
* @param array|string|null $options
*
* @return Collection The list of persons.
*/
public function persons($params = null, $options = null)
{
$url = $this->instanceUrl() . '/persons';
list($response, $opts) = $this->_request('get', $url, $params, $options);
$obj = Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);
return $obj;
}
/** /**
* @param array|null $clientId * @param array|null $clientId
* @param array|string|null $opts * @param array|string|null $opts
...@@ -127,8 +144,53 @@ class Account extends ApiResource ...@@ -127,8 +144,53 @@ class Account extends ApiResource
return OAuth::deauthorize($params, $opts); return OAuth::deauthorize($params, $opts);
} }
/*
* Capabilities methods
* We can not add the capabilities() method today as the Account object already has a
* capabilities property which is a hash and not the sub-list of capabilities.
*/
/**
* @param string $id The ID of the account to which the capability belongs.
* @param string $capabilityId The ID of the capability to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @return Capability
*/
public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
}
/**
* @param string $id The ID of the account to which the capability belongs.
* @param string $capabilityId The ID of the capability to update.
* @param array|null $params
* @param array|string|null $opts
*
* @return Capability
*/
public static function updateCapability($id, $capabilityId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts);
}
/**
* @param string $id The ID of the account on which to retrieve the capabilities.
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection The list of capabilities.
*/
public static function allCapabilities($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts);
}
/** /**
* @param string|null $id The ID of the account on which to create the external account. * @param string $id The ID of the account on which to create the external account.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -140,8 +202,8 @@ class Account extends ApiResource ...@@ -140,8 +202,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the external account belongs. * @param string $id The ID of the account to which the external account belongs.
* @param array|null $externalAccountId The ID of the external account to retrieve. * @param string $externalAccountId The ID of the external account to retrieve.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -153,8 +215,8 @@ class Account extends ApiResource ...@@ -153,8 +215,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the external account belongs. * @param string $id The ID of the account to which the external account belongs.
* @param array|null $externalAccountId The ID of the external account to update. * @param string $externalAccountId The ID of the external account to update.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -166,8 +228,8 @@ class Account extends ApiResource ...@@ -166,8 +228,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the external account belongs. * @param string $id The ID of the account to which the external account belongs.
* @param array|null $externalAccountId The ID of the external account to delete. * @param string $externalAccountId The ID of the external account to delete.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -179,11 +241,11 @@ class Account extends ApiResource ...@@ -179,11 +241,11 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account on which to retrieve the external accounts. * @param string $id The ID of the account on which to retrieve the external accounts.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
* @return BankAccount|Card * @return Collection The list of external accounts (BankAccount or Card).
*/ */
public static function allExternalAccounts($id, $params = null, $opts = null) public static function allExternalAccounts($id, $params = null, $opts = null)
{ {
...@@ -191,7 +253,7 @@ class Account extends ApiResource ...@@ -191,7 +253,7 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account on which to create the login link. * @param string $id The ID of the account on which to create the login link.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -203,7 +265,22 @@ class Account extends ApiResource ...@@ -203,7 +265,22 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account on which to create the person. * @param array|null $params
* @param array|string|null $options
*
* @return Collection The list of persons.
*/
public function persons($params = null, $options = null)
{
$url = $this->instanceUrl() . '/persons';
list($response, $opts) = $this->_request('get', $url, $params, $options);
$obj = Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param string $id The ID of the account on which to create the person.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -215,8 +292,8 @@ class Account extends ApiResource ...@@ -215,8 +292,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the person belongs. * @param string $id The ID of the account to which the person belongs.
* @param array|null $personId The ID of the person to retrieve. * @param string $personId The ID of the person to retrieve.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -228,8 +305,8 @@ class Account extends ApiResource ...@@ -228,8 +305,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the person belongs. * @param string $id The ID of the account to which the person belongs.
* @param array|null $personId The ID of the person to update. * @param string $personId The ID of the person to update.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -241,8 +318,8 @@ class Account extends ApiResource ...@@ -241,8 +318,8 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account to which the person belongs. * @param string $id The ID of the account to which the person belongs.
* @param array|null $personId The ID of the person to delete. * @param string $personId The ID of the person to delete.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
...@@ -254,11 +331,11 @@ class Account extends ApiResource ...@@ -254,11 +331,11 @@ class Account extends ApiResource
} }
/** /**
* @param string|null $id The ID of the account on which to retrieve the persons. * @param string $id The ID of the account on which to retrieve the persons.
* @param array|null $params * @param array|null $params
* @param array|string|null $opts * @param array|string|null $opts
* *
* @return Person * @return Collection The list of persons.
*/ */
public static function allPersons($id, $params = null, $opts = null) public static function allPersons($id, $params = null, $opts = null)
{