Skip to content

Commit

Permalink
Merge pull request #1440 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
API Updates for beta branch
  • Loading branch information
richardm-stripe authored Feb 2, 2023
2 parents 0a1826d + 02416a2 commit 814b07d
Show file tree
Hide file tree
Showing 19 changed files with 205 additions and 2 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Changelog

## 10.5.0 - 2023-02-02
* [#1439](https://github.com/stripe/stripe-php/pull/1439) API Updates
* Add support for `resume` method on resource `Subscription`
* Add support for `amount_shipping` and `shipping_cost` on `CreditNote` and `Invoice`
* Add support for `shipping_details` on `Invoice`
* Add support for `invoice_creation` on `PaymentLink`
* Add support for `trial_settings` on `Subscription`
* Add support for new value `paused` on enum `Subscription.status`

## 10.5.0-beta.2 - 2023-01-26
* [#1429](https://github.com/stripe/stripe-php/pull/1429) API Updates for beta branch
* Updated stable APIs to the latest version
* Add support for `list_transactions` method on resource `Tax.Transaction`
* Add support for `list_transactions` method on resource `Tax.Transaction`

## 10.5.0-beta.1 - 2023-01-19
* [#1427](https://github.com/stripe/stripe-php/pull/1427) API Updates for beta branch
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v221
v223
3 changes: 3 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
require __DIR__ . '/lib/FinancialConnections/Account.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwner.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwnership.php';
require __DIR__ . '/lib/FinancialConnections/InferredBalance.php';
require __DIR__ . '/lib/FinancialConnections/Session.php';
require __DIR__ . '/lib/FinancialConnections/Transaction.php';
require __DIR__ . '/lib/FundingInstructions.php';
require __DIR__ . '/lib/GiftCards/Card.php';
require __DIR__ . '/lib/GiftCards/Transaction.php';
Expand Down Expand Up @@ -223,6 +225,7 @@
require __DIR__ . '/lib/Service/FileLinkService.php';
require __DIR__ . '/lib/Service/FinancialConnections/AccountService.php';
require __DIR__ . '/lib/Service/FinancialConnections/SessionService.php';
require __DIR__ . '/lib/Service/FinancialConnections/TransactionService.php';
require __DIR__ . '/lib/Service/GiftCards/CardService.php';
require __DIR__ . '/lib/Service/GiftCards/TransactionService.php';
require __DIR__ . '/lib/Service/Identity/VerificationReportService.php';
Expand Down
2 changes: 2 additions & 0 deletions lib/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @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 int $amount The integer amount in %s representing the total amount of the credit note, including tax.
* @property int $amount_shipping This is the sum of all the shipping amounts.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property string|\Stripe\Customer $customer ID of the customer.
Expand All @@ -30,6 +31,7 @@
* @property string $pdf The link to download the PDF of the credit note.
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
* @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
* @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
* @property null|int $subtotal_excluding_tax The integer amount in %s representing the amount of the credit note, excluding all tax and invoice level discounts.
Expand Down
1 change: 1 addition & 0 deletions lib/CustomerCashBalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CustomerCashBalanceTransaction extends ApiResource

const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment';
const TYPE_FUNDED = 'funded';
const TYPE_FUNDING_REVERSED = 'funding_reversed';
const TYPE_REFUNDED_FROM_PAYMENT = 'refunded_from_payment';
const TYPE_RETURN_CANCELED = 'return_canceled';
const TYPE_RETURN_INITIATED = 'return_initiated';
Expand Down
6 changes: 6 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ class Event extends ApiResource
const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
const CUSTOMER_SUBSCRIPTION_PAUSED = 'customer.subscription.paused';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
const CUSTOMER_SUBSCRIPTION_RESUMED = 'customer.subscription.resumed';
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
Expand All @@ -125,6 +127,10 @@ class Event extends ApiResource
const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected';
const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_INFERRED_BALANCES = 'financial_connections.account.refreshed_inferred_balances';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_OWNERSHIP = 'financial_connections.account.refreshed_ownership';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_TRANSACTIONS = 'financial_connections.account.refreshed_transactions';
const FINANCIAL_CONNECTIONS_SESSION_UPDATED = 'financial_connections.session.updated';
const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled';
const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created';
const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing';
Expand Down
20 changes: 20 additions & 0 deletions lib/FinancialConnections/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property string $category The type of the account. Account category is further divided in <code>subcategory</code>.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution.
* @property null|\Stripe\StripeObject $inferred_balances_refresh The state of the most recent attempt to refresh the account's inferred balance history.
* @property string $institution_name The name of the institution that holds this account.
* @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters.
* @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.
Expand All @@ -24,13 +25,16 @@
* @property null|string[] $permissions The list of permissions granted by this account.
* @property string $status The status of the link to the account.
* @property string $subcategory <p>If <code>category</code> is <code>cash</code>, one of:</p><p>- <code>checking</code> - <code>savings</code> - <code>other</code></p><p>If <code>category</code> is <code>credit</code>, one of:</p><p>- <code>mortgage</code> - <code>line_of_credit</code> - <code>credit_card</code> - <code>other</code></p><p>If <code>category</code> is <code>investment</code> or <code>other</code>, this will be <code>other</code>.</p>
* @property null|string[] $subscriptions The list of data refresh subscriptions requested on this account.
* @property string[] $supported_payment_method_types The <a href="https://stripe.com/docs/api/payment_methods/object#payment_method_object-type">PaymentMethod type</a>(s) that can be created from this account.
* @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions.
*/
class Account extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\NestedResource;
use \Stripe\ApiOperations\Retrieve;

const CATEGORY_CASH = 'cash';
Expand Down Expand Up @@ -101,4 +105,20 @@ public function refreshAccount($params = null, $opts = null)

return $this;
}

const PATH_INFERRED_BALANCES = '/inferred_balances';

/**
* @param string $id the ID of the account on which to retrieve the financial connections account inferred balances
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\FinancialConnectionsAccountInferredBalance> the list of financial connections account inferred balances
*/
public static function allInferredBalances($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_INFERRED_BALANCES, $params, $opts);
}
}
22 changes: 22 additions & 0 deletions lib/FinancialConnections/InferredBalance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\FinancialConnections;

/**
* A historical balance for the account on a particular day. It may be sourced from
* a balance snapshot provided by a financial institution, or inferred using
* transactions data.
*
* @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 int $as_of The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC.
* @property \Stripe\StripeObject $current <p>The balances owed to (or by) the account holder.</p><p>Each key is a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.</p><p>Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.</p>
*/
class InferredBalance extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account_inferred_balance';

use \Stripe\ApiOperations\All;
}
9 changes: 9 additions & 0 deletions lib/FinancialConnections/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@
* @property string $client_secret A value that will be passed to the client to launch the authentication flow.
* @property \Stripe\StripeObject $filters
* @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 $manual_entry
* @property string[] $permissions Permissions requested for accounts collected during this session.
* @property null|string[] $prefetch Data features requested to be retrieved upon account creation.
* @property string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
* @property string $status The current state of the session.
* @property \Stripe\StripeObject $status_details
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.session';

use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;

const STATUS_CANCELLED = 'cancelled';
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
}
33 changes: 33 additions & 0 deletions lib/FinancialConnections/Transaction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\FinancialConnections;

/**
* A Transaction represents a real transaction that affects a Financial Connections
* Account balance.
*
* @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 string $account The ID of the Financial Connections Account this transaction belongs to.
* @property int $amount The amount of this transaction, in %s.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property string $description The description of this 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 $status The status of the transaction.
* @property \Stripe\StripeObject $status_transitions
* @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch.
* @property string $transaction_refresh The transaction_refresh object that last updated or created this transaction.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.transaction';

use \Stripe\ApiOperations\All;

const STATUS_PENDING = 'pending';
const STATUS_POSTED = 'posted';
const STATUS_VOID = 'void';
}
3 changes: 3 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the <code>amount_due</code> may be 0. If there is a positive <code>starting_balance</code> for the invoice (the customer owes money), the <code>amount_due</code> will also take that into account. The charge that gets generated for the invoice will be for the amount specified in <code>amount_due</code>.
* @property int $amount_paid The amount, in %s, that was paid.
* @property int $amount_remaining The difference between amount_due and amount_paid, in %s.
* @property int $amount_shipping This is the sum of all the shipping amounts.
* @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice.
* @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
* @property null|\Stripe\StripeObject $applies_to
Expand Down Expand Up @@ -101,6 +102,8 @@
* @property null|string|\Stripe\Quote $quote The quote this invoice was generated from.
* @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice.
* @property null|\Stripe\StripeObject $rendering_options Options for invoice PDF rendering.
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice.
* @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the <code>shipping_details</code> value if it is set, otherwise the PDF will render the shipping address from the customer.
* @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
* @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement.
* @property null|string $status The status of the invoice, one of <code>draft</code>, <code>open</code>, <code>paid</code>, <code>uncollectible</code>, or <code>void</code>. <a href="https://stripe.com/docs/billing/invoices/workflow#workflow-overview">Learn more</a>
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property \Stripe\StripeObject $custom_text
* @property string $customer_creation Configuration for Customer creation during checkout.
* @property null|\Stripe\StripeObject $invoice_creation Configuration for creating invoice for payment mode payment links.
* @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold.
* @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.
Expand Down
17 changes: 17 additions & 0 deletions lib/Service/FinancialConnections/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ public function all($params = null, $opts = null)
return $this->requestCollection('get', '/v1/financial_connections/accounts', $params, $opts);
}

/**
* Lists the recorded inferred balances for a Financial Connections
* <code>Account</code>.
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\InferredBalance>
*/
public function allInferredBalances($parentId, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/financial_connections/accounts/%s/inferred_balances', $parentId), $params, $opts);
}

/**
* Lists all owners for a given <code>Account</code>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @property AccountService $accounts
* @property SessionService $sessions
* @property TransactionService $transactions
*/
class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
Expand All @@ -18,6 +19,7 @@ class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractService
private static $classMap = [
'accounts' => AccountService::class,
'sessions' => SessionService::class,
'transactions' => TransactionService::class,
];

protected function getServiceClass($name)
Expand Down
23 changes: 23 additions & 0 deletions lib/Service/FinancialConnections/TransactionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\FinancialConnections;

class TransactionService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of Financial Connections <code>Transaction</code> objects.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/financial_connections/transactions', $params, $opts);
}
}
Loading

0 comments on commit 814b07d

Please sign in to comment.