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

API Updates for beta branch #1442

Merged
merged 14 commits into from
Feb 16, 2023
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
14 changes: 12 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@

# A list of files and folders those will be excluded from archives and the
# Composer package (for purposes of making it smaller).
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.php-cs-fixer.php export-ignore
/.vscode export-ignore
/build.php export-ignore
/CODE_OF_CONDUCT.md export-ignore
/examples export-ignore
/phpunit.xml export-ignore
/init.php export-ignore
/Makefile export-ignore
/phpdoc.dist.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.no_autoload.xml export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/update_certs.php export-ignore
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:3.4.0
Expand All @@ -42,7 +42,7 @@ jobs:
- "8.1"

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -54,7 +54,7 @@ jobs:
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Conventionally you would hash "composer.lock", but we don't commit
Expand Down Expand Up @@ -95,9 +95,10 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -109,7 +110,7 @@ jobs:
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
Expand Down
9 changes: 7 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@
// needs to be a raw `StripeObject`.
'self_accessor' => false,

// Visibility annotations are not supported by php5.6
'visibility_required' => false,
// Visibility for constants requires PHP 7.1, but we support PHP 5.6
'visibility_required' => [
'elements' => [
'method',
'property',
],
],

// Apparently "uninitialized" is distinct from "null" in some versions of PHP
// so I am defensively disabling this rule so as to not cause breaking changes
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v223
v226
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ composer require stripe/stripe-php
To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```php
require_once('vendor/autoload.php');
require_once 'vendor/autoload.php';
```

## Manual Installation

If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file.

```php
require_once('/path/to/stripe-php/init.php');
require_once '/path/to/stripe-php/init.php';
```

## Dependencies
Expand Down
47 changes: 26 additions & 21 deletions lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,40 @@

/**
* This is an object representing a Stripe account. You can retrieve it to see
* properties on the account like its current e-mail address or if the account is
* enabled yet to make live charges.
* properties on the account like its current requirements or if the account is
* enabled to make live charges or receive payouts.
*
* Some properties, marked below, are available only to platforms that want to <a
* href="https://stripe.com/docs/connect/accounts">create and manage Express or
* Custom accounts</a>.
* For Custom accounts, the properties below are always returned. For other
* accounts, some properties are returned until that account has started to go
* through Connect Onboarding. Once you create an <a
* href="https://stripe.com/docs/api/account_links">Account Link</a> for a Standard
* or Express account, some parameters are no longer returned. These are marked as
* <strong>Custom Only</strong> or <strong>Custom and Express</strong> below. Learn
* about the differences <a href="https://stripe.com/docs/connect/accounts">between
* accounts</a>.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property null|\Stripe\StripeObject $business_profile Business information about the account.
* @property null|string $business_type The business type.
* @property \Stripe\StripeObject $capabilities
* @property bool $charges_enabled Whether the account can create live charges.
* @property \Stripe\StripeObject $company
* @property \Stripe\StripeObject $controller
* @property string $country The account's country.
* @property int $created Time at which the account was connected. Measured in seconds since the Unix epoch.
* @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that <a href="https://stripe.com/docs/payouts">Stripe supports in the account's country</a>.
* @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true.
* @property null|\Stripe\StripeObject $capabilities
* @property null|bool $charges_enabled Whether the account can create live charges.
* @property null|\Stripe\StripeObject $company
* @property null|\Stripe\StripeObject $controller
* @property null|string $country The account's country.
* @property null|int $created Time at which the account was connected. Measured in seconds since the Unix epoch.
* @property null|string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that <a href="https://stripe.com/docs/payouts">Stripe supports in the account's country</a>.
* @property null|bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true.
* @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders.
* @property \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account
* @property \Stripe\StripeObject $future_requirements
* @property \Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the <a href="https://stripe.com/docs/connect/standard-accounts">Standard onboarding</a> or <a href="https://stripe.com/docs/connect/express-accounts">Express onboarding documentation</a> for information about platform pre-filling and account onboarding steps.</p><p>Related guide: <a href="https://stripe.com/docs/connect/identity-verification-api#person-information">Handling Identity Verification with the API</a>.</p>
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property bool $payouts_enabled Whether Stripe can send payouts to this account.
* @property \Stripe\StripeObject $requirements
* @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account
* @property null|\Stripe\StripeObject $future_requirements
* @property null|\Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the <a href="https://stripe.com/docs/connect/standard-accounts">Standard onboarding</a> or <a href="https://stripe.com/docs/connect/express-accounts">Express onboarding documentation</a> for information about platform pre-filling and account onboarding steps.</p><p>Related guide: <a href="https://stripe.com/docs/connect/identity-verification-api#person-information">Handling Identity Verification with the API</a>.</p>
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|bool $payouts_enabled Whether Stripe can send payouts to this account.
* @property null|\Stripe\StripeObject $requirements
* @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe.
* @property \Stripe\StripeObject $tos_acceptance
* @property string $type The Stripe account type. Can be <code>standard</code>, <code>express</code>, or <code>custom</code>.
* @property null|\Stripe\StripeObject $tos_acceptance
* @property null|string $type The Stripe account type. Can be <code>standard</code>, <code>express</code>, or <code>custom</code>.
*/
class Account extends ApiResource
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. The available balance for each currency and payment type can be found in the <code>source_types</code> property.
* @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the <code>source_types</code> property.
* @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts.
* @property \Stripe\StripeObject $issuing
* @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the <code>source_types</code> property.
* @property null|\Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts.
* @property null|\Stripe\StripeObject $issuing
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the <code>source_types</code> property.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/BillingPortal/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $customer The ID of the customer for this session.
* @property null|\Stripe\StripeObject $flow Information about a specific flow for the customer to go through.
* @property null|\Stripe\StripeObject $flow Information about a specific flow for the customer to go through. See the <a href="https://stripe.com/docs/customer-management/portal-deep-links">docs</a> to learn more about using customer portal deep links and flows.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s <code>preferred_locales</code> or browser’s locale is used.
* @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this <code>on_behalf_of</code> account appear in the portal. For more information, see the <a href="https://stripe.com/docs/connect/charges-transfers#on-behalf-of">docs</a>. Use the <a href="https://stripe.com/docs/api/accounts/object#account_object-settings-branding">Accounts API</a> to modify the <code>on_behalf_of</code> account's branding settings, which the portal displays.
Expand Down
4 changes: 2 additions & 2 deletions lib/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* @property string $id The identifier for the capability.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string|\Stripe\Account $account The account for which the capability enables functionality.
* @property \Stripe\StripeObject $future_requirements
* @property null|\Stripe\StripeObject $future_requirements
* @property bool $requested Whether the capability has been requested.
* @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch.
* @property \Stripe\StripeObject $requirements
* @property null|\Stripe\StripeObject $requirements
* @property string $status The status of the capability. Can be <code>active</code>, <code>inactive</code>, <code>pending</code>, or <code>unrequested</code>.
*/
class Capability extends ApiResource
Expand Down
16 changes: 8 additions & 8 deletions lib/Capital/FinancingOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
*
* @property string $id A unique identifier for the financing object.
* @property string $object The object type: financing_offer.
* @property \Stripe\StripeObject $accepted_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents the terms accepted by the Connected account, which may differ from those offered.
* @property null|\Stripe\StripeObject $accepted_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents the terms accepted by the Connected account, which may differ from those offered.
* @property string $account The ID of the merchant associated with this financing object.
* @property int $created Time at which the offer was created. Given in seconds since unix epoch.
* @property float $expires_after Time at which the offer expires. Given in seconds since unix epoch.
* @property string $financing_type The type of financing being offered.
* @property null|string $financing_type The type of financing being offered.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property \Stripe\StripeObject $offered_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents both the terms offered to the Connected account.
* @property string $product_type Financing product identifier.
* @property string $replacement The ID of the financing offer that replaced this offer.
* @property string $replacement_for The ID of the financing offer that this offer is a replacement for.
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|\Stripe\StripeObject $offered_terms This is an object representing the terms of an offer of financing from Stripe Capital to a Connected account. This resource represents both the terms offered to the Connected account.
* @property null|string $product_type Financing product identifier.
* @property null|string $replacement The ID of the financing offer that replaced this offer.
* @property null|string $replacement_for The ID of the financing offer that this offer is a replacement for.
* @property string $status The current status of the offer.
* @property string $type See <a href="https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type">financing_type</a>.
* @property null|string $type See <a href="https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type">financing_type</a>.
*/
class FinancingOffer extends \Stripe\ApiResource
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Capital/FinancingTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @property int $created_at Time at which the financing transaction was created. Given in seconds since unix epoch.
* @property \Stripe\StripeObject $details This is an object representing a transaction on a Capital financing offer.
* @property null|string $financing_offer The Capital financing offer for this financing transaction.
* @property string $legacy_balance_transaction_source The Capital transaction object that predates the Financing Transactions API and corresponds with the balance transaction that was created as a result of this financing transaction.
* @property null|string $legacy_balance_transaction_source The Capital transaction object that predates the Financing Transactions API and corresponds with the balance transaction that was created as a result of this financing transaction.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property string $type The type of the financing transaction.
* @property null|string $user_facing_description A human-friendly description of the financing transaction.
Expand Down
Loading