Skip to content

Commit

Permalink
Merge pull request #1712 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Jun 27, 2024
2 parents 775efd5 + 6096a1b commit 2073e74
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ charset = utf-8
[*.{json,yml}]
indent_size = 2

[*.neon]
[*.{neon,neon.dist}]
indent_style = tab

[Makefile]
Expand Down
9 changes: 4 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"recommendations": [
"felixfbecker.php-intellisense",
"ikappas.phpcs",
"emallin.phpunit",
"EditorConfig.editorconfig",
"sophisticode.php-formatter"
"EditorConfig.editorconfig", // standard
"bmewburn.vscode-intelephense-client", // intellisense
"emallin.phpunit", // nice unit-testing runners
"SanderRonde.phpstan-vscode" // linting
]
}
11 changes: 5 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

"editor.renderWhitespace": "all",

"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
},

// Formatting
"editor.formatOnSave": true,
"phpformatter.composer": true,
"phpformatter.arguments": [""],

// Linting
"phpcs.enable": true,
"phpcs.standard": "PSR2"
"intelephense.format.braces": "psr12"
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 15.0.0 - 2024-06-24
* [#1714](https://github.com/stripe/stripe-php/pull/1714)

This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading.

### ⚠️ Breaking changes

* Remove the unused resource `PlatformTaxFee`
* Remove the protected method `_searchResource` on resources Charge, Customer, Invoice, PaymentIntent, Price, Product, and Subscription as it is no longer used.

### Additions

* Add support for `finalize_amount` test helper method on resource `Issuing.Authorization`
* Add support for `fleet` and `fuel` on `Issuing.Authorization`
* Add support for new value `ch_uid` on enum `TaxId.type`

## 14.11.0-beta.1 - 2024-06-13
* [#1705](https://github.com/stripe/stripe-php/pull/1705) Syncing changes from 14.10.0 release

Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1077
v1102
1 change: 0 additions & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
require __DIR__ . '/lib/Payout.php';
require __DIR__ . '/lib/Person.php';
require __DIR__ . '/lib/Plan.php';
require __DIR__ . '/lib/PlatformTaxFee.php';
require __DIR__ . '/lib/Price.php';
require __DIR__ . '/lib/Product.php';
require __DIR__ . '/lib/ProductFeature.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/BalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
* @property int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by <code>amount</code> - <code>fee</code>
* @property string $reporting_category Learn more about how <a href="https://stripe.com/docs/reports/reporting-categories">reporting categories</a> can help you understand balance transactions from an accounting perspective.
* @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\ConnectCollectionTransfer|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\PlatformTaxFee|\Stripe\Refund|\Stripe\ReserveTransaction|\Stripe\TaxDeductedAtSource|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object.
* @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\ConnectCollectionTransfer|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\Refund|\Stripe\ReserveTransaction|\Stripe\TaxDeductedAtSource|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object.
* @property string $status The transaction's net funds status in the Stripe balance, which are either <code>available</code> or <code>pending</code>.
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>climate_order_purchase</code>, <code>climate_order_refund</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_network_reserve_hold</code>, <code>payment_network_reserve_release</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payment_unreconciled</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
*/
Expand Down
1 change: 0 additions & 1 deletion lib/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class Charge extends ApiResource
const OBJECT_NAME = 'charge';

use ApiOperations\NestedResource;
use ApiOperations\Search;
use ApiOperations\Update;

const STATUS_FAILED = 'failed';
Expand Down
1 change: 0 additions & 1 deletion lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class Customer extends ApiResource
const OBJECT_NAME = 'customer';

use ApiOperations\NestedResource;
use ApiOperations\Search;
use ApiOperations\Update;

const TAX_EXEMPT_EXEMPT = 'exempt';
Expand Down
1 change: 0 additions & 1 deletion lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class Invoice extends ApiResource
const OBJECT_NAME = 'invoice';

use ApiOperations\NestedResource;
use ApiOperations\Search;
use ApiOperations\Update;

const BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE = 'automatic_pending_invoice_item_invoice';
Expand Down
2 changes: 2 additions & 0 deletions lib/Issuing/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency The currency of the cardholder. This currency can be different from the currency presented at authorization and the <code>merchant_currency</code> field on this authorization. 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 null|\Stripe\StripeObject $fleet Fleet-specific information for authorizations using Fleet cards.
* @property null|\Stripe\StripeObject $fuel Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed.
* @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 int $merchant_amount The total amount that was authorized or rejected. This amount is in the <code>merchant_currency</code> and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. <code>merchant_amount</code> should be the same as <code>amount</code>, unless <code>merchant_currency</code> and <code>currency</code> are different.
* @property string $merchant_currency The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the <code>currency</code> field on this authorization. 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>.
Expand Down
2 changes: 1 addition & 1 deletion lib/Margin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Margin extends ApiResource

/**
* Create a margin object to be used with invoices, invoice items, and invoice line
* items for a customer to represent a partner discount.A margin has a
* items for a customer to represent a partner discount. A margin has a
* <code>percent_off</code> which is the percent that will be taken off the
* subtotal after all items and other discounts and promotions) of any invoices for
* a customer. Calculation of prorations do not include any partner margins applied
Expand Down
1 change: 0 additions & 1 deletion lib/PaymentIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class PaymentIntent extends ApiResource
{
const OBJECT_NAME = 'payment_intent';

use ApiOperations\Search;
use ApiOperations\Update;

const CANCELLATION_REASON_ABANDONED = 'abandoned';
Expand Down
17 changes: 0 additions & 17 deletions lib/PlatformTaxFee.php

This file was deleted.

1 change: 0 additions & 1 deletion lib/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Price extends ApiResource
{
const OBJECT_NAME = 'price';

use ApiOperations\Search;
use ApiOperations\Update;

const BILLING_SCHEME_PER_UNIT = 'per_unit';
Expand Down
1 change: 0 additions & 1 deletion lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Product extends ApiResource
const OBJECT_NAME = 'product';

use ApiOperations\NestedResource;
use ApiOperations\Search;
use ApiOperations\Update;

const TYPE_GOOD = 'good';
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/MarginService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function all($params = null, $opts = null)

/**
* Create a margin object to be used with invoices, invoice items, and invoice line
* items for a customer to represent a partner discount.A margin has a
* items for a customer to represent a partner discount. A margin has a
* <code>percent_off</code> which is the percent that will be taken off the
* subtotal after all items and other discounts and promotions) of any invoices for
* a customer. Calculation of prorations do not include any partner margins applied
Expand Down
6 changes: 4 additions & 2 deletions lib/Service/Tax/CalculationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
class CalculationService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a persisted tax calculation as a collection.
* Retrieves the line items of a tax calculation as a collection, if the
* calculation hasn’t expired.
*
* @param string $id
* @param null|array $params
Expand All @@ -27,7 +28,8 @@ public function allLineItems($id, $params = null, $opts = null)
}

/**
* Calculates tax based on input and returns a Tax <code>Calculation</code> object.
* Calculates tax based on the input and returns a Tax <code>Calculation</code>
* object.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
Expand Down
17 changes: 17 additions & 0 deletions lib/Service/TestHelpers/Issuing/AuthorizationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ public function expire($id, $params = null, $opts = null)
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/expire', $id), $params, $opts);
}

/**
* Finalize the amount on an Authorization prior to capture, when the initial
* authorization was for an estimated amount.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\Authorization
*/
public function finalizeAmount($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/finalize_amount', $id), $params, $opts);
}

/**
* Increment a test-mode Authorization.
*
Expand Down
1 change: 0 additions & 1 deletion lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class Subscription extends ApiResource
{
const OBJECT_NAME = 'subscription';

use ApiOperations\Search;
use ApiOperations\Update;

const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
Expand Down
3 changes: 2 additions & 1 deletion lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class Calculation extends \Stripe\ApiResource
const OBJECT_NAME = 'tax.calculation';

/**
* Calculates tax based on input and returns a Tax <code>Calculation</code> object.
* Calculates tax based on the input and returns a Tax <code>Calculation</code>
* object.
*
* @param null|array $params
* @param null|array|string $options
Expand Down
3 changes: 2 additions & 1 deletion lib/TaxId.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @property null|string|\Stripe\Customer $customer ID of the customer.
* @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|\Stripe\StripeObject $owner The account or customer the tax ID belongs to.
* @property string $type Type of the tax ID, one of <code>ad_nrt</code>, <code>ae_trn</code>, <code>ar_cuit</code>, <code>au_abn</code>, <code>au_arn</code>, <code>bg_uic</code>, <code>bh_vat</code>, <code>bo_tin</code>, <code>br_cnpj</code>, <code>br_cpf</code>, <code>ca_bn</code>, <code>ca_gst_hst</code>, <code>ca_pst_bc</code>, <code>ca_pst_mb</code>, <code>ca_pst_sk</code>, <code>ca_qst</code>, <code>ch_vat</code>, <code>cl_tin</code>, <code>cn_tin</code>, <code>co_nit</code>, <code>cr_tin</code>, <code>de_stn</code>, <code>do_rcn</code>, <code>ec_ruc</code>, <code>eg_tin</code>, <code>es_cif</code>, <code>eu_oss_vat</code>, <code>eu_vat</code>, <code>gb_vat</code>, <code>ge_vat</code>, <code>hk_br</code>, <code>hu_tin</code>, <code>id_npwp</code>, <code>il_vat</code>, <code>in_gst</code>, <code>is_vat</code>, <code>jp_cn</code>, <code>jp_rn</code>, <code>jp_trn</code>, <code>ke_pin</code>, <code>kr_brn</code>, <code>kz_bin</code>, <code>li_uid</code>, <code>mx_rfc</code>, <code>my_frp</code>, <code>my_itn</code>, <code>my_sst</code>, <code>ng_tin</code>, <code>no_vat</code>, <code>no_voec</code>, <code>nz_gst</code>, <code>om_vat</code>, <code>pe_ruc</code>, <code>ph_tin</code>, <code>ro_tin</code>, <code>rs_pib</code>, <code>ru_inn</code>, <code>ru_kpp</code>, <code>sa_vat</code>, <code>sg_gst</code>, <code>sg_uen</code>, <code>si_tin</code>, <code>sv_nit</code>, <code>th_vat</code>, <code>tr_tin</code>, <code>tw_vat</code>, <code>ua_vat</code>, <code>us_ein</code>, <code>uy_ruc</code>, <code>ve_rif</code>, <code>vn_tin</code>, or <code>za_vat</code>. Note that some legacy tax IDs have type <code>unknown</code>
* @property string $type Type of the tax ID, one of <code>ad_nrt</code>, <code>ae_trn</code>, <code>ar_cuit</code>, <code>au_abn</code>, <code>au_arn</code>, <code>bg_uic</code>, <code>bh_vat</code>, <code>bo_tin</code>, <code>br_cnpj</code>, <code>br_cpf</code>, <code>ca_bn</code>, <code>ca_gst_hst</code>, <code>ca_pst_bc</code>, <code>ca_pst_mb</code>, <code>ca_pst_sk</code>, <code>ca_qst</code>, <code>ch_uid</code>, <code>ch_vat</code>, <code>cl_tin</code>, <code>cn_tin</code>, <code>co_nit</code>, <code>cr_tin</code>, <code>de_stn</code>, <code>do_rcn</code>, <code>ec_ruc</code>, <code>eg_tin</code>, <code>es_cif</code>, <code>eu_oss_vat</code>, <code>eu_vat</code>, <code>gb_vat</code>, <code>ge_vat</code>, <code>hk_br</code>, <code>hu_tin</code>, <code>id_npwp</code>, <code>il_vat</code>, <code>in_gst</code>, <code>is_vat</code>, <code>jp_cn</code>, <code>jp_rn</code>, <code>jp_trn</code>, <code>ke_pin</code>, <code>kr_brn</code>, <code>kz_bin</code>, <code>li_uid</code>, <code>mx_rfc</code>, <code>my_frp</code>, <code>my_itn</code>, <code>my_sst</code>, <code>ng_tin</code>, <code>no_vat</code>, <code>no_voec</code>, <code>nz_gst</code>, <code>om_vat</code>, <code>pe_ruc</code>, <code>ph_tin</code>, <code>ro_tin</code>, <code>rs_pib</code>, <code>ru_inn</code>, <code>ru_kpp</code>, <code>sa_vat</code>, <code>sg_gst</code>, <code>sg_uen</code>, <code>si_tin</code>, <code>sv_nit</code>, <code>th_vat</code>, <code>tr_tin</code>, <code>tw_vat</code>, <code>ua_vat</code>, <code>us_ein</code>, <code>uy_ruc</code>, <code>ve_rif</code>, <code>vn_tin</code>, or <code>za_vat</code>. Note that some legacy tax IDs have type <code>unknown</code>
* @property string $value Value of the tax ID.
* @property null|\Stripe\StripeObject $verification Tax ID verification information.
*/
Expand All @@ -41,6 +41,7 @@ class TaxId extends ApiResource
const TYPE_CA_PST_MB = 'ca_pst_mb';
const TYPE_CA_PST_SK = 'ca_pst_sk';
const TYPE_CA_QST = 'ca_qst';
const TYPE_CH_UID = 'ch_uid';
const TYPE_CH_VAT = 'ch_vat';
const TYPE_CL_TIN = 'cl_tin';
const TYPE_CN_TIN = 'cn_tin';
Expand Down
1 change: 1 addition & 0 deletions lib/Terminal/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @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 $name String indicating the name of the Configuration object, set by the user
* @property null|\Stripe\StripeObject $offline
* @property null|\Stripe\StripeObject $reboot_window
* @property null|\Stripe\StripeObject $stripe_s700
* @property null|\Stripe\StripeObject $tipping
* @property null|\Stripe\StripeObject $verifone_p400
Expand Down
2 changes: 1 addition & 1 deletion lib/Terminal/ConnectionToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Related guide: <a href="https://stripe.com/docs/terminal/fleet/locations">Fleet management</a>
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property null|string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see <a href="https://stripe.com/docs/terminal/fleet/locations#connection-tokens">the docs on scoping connection tokens</a>.
* @property null|string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see <a href="https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens">the docs on scoping connection tokens</a>.
* @property string $secret Your application should pass this token to the Stripe Terminal SDK.
*/
class ConnectionToken extends \Stripe\ApiResource
Expand Down
2 changes: 1 addition & 1 deletion lib/Util/ApiVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

class ApiVersion
{
const CURRENT = '2024-04-10';
const CURRENT = '2024-06-20';
const PREVIEW = '2024-05-23.preview-v2';
}
1 change: 0 additions & 1 deletion lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class ObjectTypes
\Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
\Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
\Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class,
\Stripe\PlatformTaxFee::OBJECT_NAME => \Stripe\PlatformTaxFee::class,
\Stripe\Price::OBJECT_NAME => \Stripe\Price::class,
\Stripe\Product::OBJECT_NAME => \Stripe\Product::class,
\Stripe\ProductFeature::OBJECT_NAME => \Stripe\ProductFeature::class,
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ parameters:
- '#Unsafe usage of new static\(\).#'

reportUnmatchedIgnoredErrors: false

paths:
- lib
- tests
Loading

0 comments on commit 2073e74

Please sign in to comment.