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

Update generated code for beta #1699

Merged
merged 3 commits into from
May 30, 2024
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
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1044
v1058
126 changes: 123 additions & 3 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class Account extends ApiResource
{
const OBJECT_NAME = 'account';

use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Update;

Expand All @@ -62,6 +59,129 @@ class Account extends ApiResource
const TYPE_NONE = 'none';
const TYPE_STANDARD = 'standard';

/**
* With <a href="/docs/connect">Connect</a>, you can create Stripe accounts for
* your users. To do this, you’ll first need to <a
* href="https://dashboard.stripe.com/account/applications/settings">register your
* platform</a>.
*
* If you’ve already collected information for your connected accounts, you <a
* href="/docs/connect/best-practices#onboarding">can prefill that information</a>
* when creating the account. Connect Onboarding won’t ask for the prefilled
* information during account onboarding. You can prefill any information on the
* account.
*
* @param null|array $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Account the created resource
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();

list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* With <a href="/connect">Connect</a>, you can delete accounts you manage.
*
* Test-mode accounts can be deleted at any time.
*
* Live-mode accounts where Stripe is responsible for negative account balances
* cannot be deleted, which includes Standard accounts. Live-mode accounts where
* your platform is liable for negative account balances, which includes Custom and
* Express accounts, can be deleted when all <a
* href="/api/balance/balanace_object">balances</a> are zero.
*
* If you want to delete your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">account information tab in
* your account settings</a> instead.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Account the deleted resource
*/
public function delete($params = null, $opts = null)
{
self::_validateParams($params);

$url = $this->instanceUrl();
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* Returns a list of accounts connected to your platform via <a
* href="/docs/connect">Connect</a>. If you’re not a platform, the list is empty.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Account> of ApiResources
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();

return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}

/**
* Updates a <a href="/connect/accounts">connected account</a> by setting the
* values of the parameters passed. Any parameters not provided are left unchanged.
*
* For accounts where <a
* href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is <code>application</code>, which includes Custom accounts, you can update any
* information on the account.
*
* For accounts where <a
* href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is <code>stripe</code>, which includes Standard and Express accounts, you can
* update all information until you create an <a href="/api/account_links">Account
* Link</a> or <a href="/api/account_sessions">Account Session</a> to start Connect
* onboarding, after which some properties can no longer be updated.
*
* To update your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">Dashboard</a>. Refer to our
* <a href="/docs/connect/updating-accounts">Connect</a> documentation to learn
* more about updating accounts.
*
* @param string $id the ID of the resource to update
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Account the updated resource
*/
public static function update($id, $params = null, $opts = null)
{
self::_validateParams($params);
$url = static::resourceUrl($id);

list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

use ApiOperations\Retrieve {
retrieve as protected _retrieve;
}
Expand Down
24 changes: 23 additions & 1 deletion lib/AccountLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,27 @@ class AccountLink extends ApiResource
{
const OBJECT_NAME = 'account_link';

use ApiOperations\Create;
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the
* platform can redirect their user to in order to take them through the Connect
* Onboarding flow.
*
* @param null|array $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\AccountLink the created resource
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();

list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}
}
63 changes: 61 additions & 2 deletions lib/AccountNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class AccountNotice extends ApiResource
{
const OBJECT_NAME = 'account_notice';

use ApiOperations\All;
use ApiOperations\Retrieve;
use ApiOperations\Update;

const REASON_ISSUING_ACCOUNT_CLOSED_FOR_INACTIVITY = 'issuing.account_closed_for_inactivity';
Expand All @@ -38,4 +36,65 @@ class AccountNotice extends ApiResource
const REASON_ISSUING_DISPUTE_LOST = 'issuing.dispute_lost';
const REASON_ISSUING_DISPUTE_SUBMITTED = 'issuing.dispute_submitted';
const REASON_ISSUING_DISPUTE_WON = 'issuing.dispute_won';

/**
* Retrieves a list of <code>AccountNotice</code> objects. The objects are sorted
* in descending order by creation date, with the most-recently-created object
* appearing first.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\AccountNotice> of ApiResources
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();

return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}

/**
* Retrieves an <code>AccountNotice</code> object.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\AccountNotice
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();

return $instance;
}

/**
* Updates an <code>AccountNotice</code> object.
*
* @param string $id the ID of the resource to update
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\AccountNotice the updated resource
*/
public static function update($id, $params = null, $opts = null)
{
self::_validateParams($params);
$url = static::resourceUrl($id);

list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}
}
23 changes: 22 additions & 1 deletion lib/AccountSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,26 @@ class AccountSession extends ApiResource
{
const OBJECT_NAME = 'account_session';

use ApiOperations\Create;
/**
* Creates a AccountSession object that includes a single-use token that the
* platform can use on their front-end to grant client-side API access.
*
* @param null|array $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\AccountSession the created resource
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();

list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}
}
82 changes: 78 additions & 4 deletions lib/ApplePayDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,84 @@ class ApplePayDomain extends ApiResource
{
const OBJECT_NAME = 'apple_pay_domain';

use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
/**
* Create an apple pay domain.
*
* @param null|array $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\ApplePayDomain the created resource
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();

list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* Delete an apple pay domain.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\ApplePayDomain the deleted resource
*/
public function delete($params = null, $opts = null)
{
self::_validateParams($params);

$url = $this->instanceUrl();
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* List apple pay domains.
*
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\ApplePayDomain> of ApiResources
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();

return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}

/**
* Retrieve an apple pay domain.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\ApplePayDomain
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();

return $instance;
}

/**
* @return string The class URL for this resource. It needs to be special
Expand Down
Loading
Loading