From acc9805f1cde66b3b4837213bb3ad492d08c0589 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:15:58 +0000 Subject: [PATCH 01/13] Update generated code for v1078 --- OPENAPI_VERSION | 2 +- lib/Terminal/ConnectionToken.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ebd06a813..b6130d4d5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1077 \ No newline at end of file +v1078 \ No newline at end of file diff --git a/lib/Terminal/ConnectionToken.php b/lib/Terminal/ConnectionToken.php index dd8ce032a..276ec2ad5 100644 --- a/lib/Terminal/ConnectionToken.php +++ b/lib/Terminal/ConnectionToken.php @@ -10,7 +10,7 @@ * Related guide: Fleet management * * @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 the docs on scoping connection tokens. + * @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 the docs on scoping connection tokens. * @property string $secret Your application should pass this token to the Stripe Terminal SDK. */ class ConnectionToken extends \Stripe\ApiResource From 23d14c402fd250604e8c5ed03626f6a77227e6b4 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:06:38 +0000 Subject: [PATCH 02/13] Update generated code for v1079 --- OPENAPI_VERSION | 2 +- lib/Service/Tax/CalculationService.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b6130d4d5..ac0cc575d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1078 \ No newline at end of file +v1079 \ No newline at end of file diff --git a/lib/Service/Tax/CalculationService.php b/lib/Service/Tax/CalculationService.php index 252c599c2..1b74dc81b 100644 --- a/lib/Service/Tax/CalculationService.php +++ b/lib/Service/Tax/CalculationService.php @@ -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 From dcaf245c86a220be28ae67177b7126dd6f7bbe8f Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:08:26 -0700 Subject: [PATCH 03/13] Update generated code (#1711) * Update generated code for v1078 * Update generated code for v1079 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/Service/Tax/CalculationService.php | 3 ++- lib/Terminal/ConnectionToken.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ebd06a813..ac0cc575d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1077 \ No newline at end of file +v1079 \ No newline at end of file diff --git a/lib/Service/Tax/CalculationService.php b/lib/Service/Tax/CalculationService.php index 252c599c2..1b74dc81b 100644 --- a/lib/Service/Tax/CalculationService.php +++ b/lib/Service/Tax/CalculationService.php @@ -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 diff --git a/lib/Terminal/ConnectionToken.php b/lib/Terminal/ConnectionToken.php index dd8ce032a..276ec2ad5 100644 --- a/lib/Terminal/ConnectionToken.php +++ b/lib/Terminal/ConnectionToken.php @@ -10,7 +10,7 @@ * Related guide: Fleet management * * @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 the docs on scoping connection tokens. + * @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 the docs on scoping connection tokens. * @property string $secret Your application should pass this token to the Stripe Terminal SDK. */ class ConnectionToken extends \Stripe\ApiResource From cf9e62d36dbf2343e61229767ff9f28f7a191055 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:41:14 +0000 Subject: [PATCH 04/13] Update generated code for v1088 --- OPENAPI_VERSION | 2 +- lib/Util/ApiVersion.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f3f79ffe4..9398b2807 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1087 \ No newline at end of file +v1088 \ No newline at end of file diff --git a/lib/Util/ApiVersion.php b/lib/Util/ApiVersion.php index e180c3166..481a81dcd 100644 --- a/lib/Util/ApiVersion.php +++ b/lib/Util/ApiVersion.php @@ -6,6 +6,6 @@ class ApiVersion { - const CURRENT = '2024-04-10'; + const CURRENT = '2024-06-20'; const PREVIEW = '2024-05-23.preview-v2'; } From dbef4294b888b7ee8cd9e75df8e570c2594c107d Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:17:04 -0700 Subject: [PATCH 05/13] update recommended extensions and settings (#1709) --- .editorconfig | 2 +- .vscode/extensions.json | 9 ++++----- .vscode/settings.json | 11 +++++------ phpstan.neon.dist | 4 ++++ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index 174e9120b..2d0fec721 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,7 @@ charset = utf-8 [*.{json,yml}] indent_size = 2 -[*.neon] +[*.{neon,neon.dist}] indent_style = tab [Makefile] diff --git a/.vscode/extensions.json b/.vscode/extensions.json index db1056ca7..45314f805 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -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 ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index d1ae331e1..2a97389de 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 983b38e60..0f6df7019 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -11,3 +11,7 @@ parameters: - '#Unsafe usage of new static\(\).#' reportUnmatchedIgnoredErrors: false + + paths: + - lib + - tests From 8ee639d4902b05ee6aab0471ffd8ed9d6cb205da Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:59:22 +0000 Subject: [PATCH 06/13] Update generated code for v1092 --- OPENAPI_VERSION | 2 +- lib/Issuing/Authorization.php | 2 ++ .../Issuing/AuthorizationService.php | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f9b98cc9a..db2bdf5f0 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1091 \ No newline at end of file +v1092 \ No newline at end of file diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index f675cb167..ed14cd4e8 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -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 merchant_currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @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 true if the object exists in live mode or the value false if the object exists in test mode. * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. merchant_amount should be the same as amount, unless merchant_currency and currency 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 currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. diff --git a/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/lib/Service/TestHelpers/Issuing/AuthorizationService.php index 50db7c836..82faeff47 100644 --- a/lib/Service/TestHelpers/Issuing/AuthorizationService.php +++ b/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -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. * From 4da7796bfbd0544b8de73aea4506c97a95ce55e1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:31:39 +0000 Subject: [PATCH 07/13] Update generated code for v1093 --- OPENAPI_VERSION | 2 +- lib/Service/Tax/CalculationService.php | 3 ++- lib/Tax/Calculation.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index db2bdf5f0..1dbca34fc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1092 \ No newline at end of file +v1093 \ No newline at end of file diff --git a/lib/Service/Tax/CalculationService.php b/lib/Service/Tax/CalculationService.php index 1b74dc81b..60cb3ea4f 100644 --- a/lib/Service/Tax/CalculationService.php +++ b/lib/Service/Tax/CalculationService.php @@ -28,7 +28,8 @@ public function allLineItems($id, $params = null, $opts = null) } /** - * Calculates tax based on input and returns a Tax Calculation object. + * Calculates tax based on the input and returns a Tax Calculation + * object. * * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts diff --git a/lib/Tax/Calculation.php b/lib/Tax/Calculation.php index f70b46593..d9155267d 100644 --- a/lib/Tax/Calculation.php +++ b/lib/Tax/Calculation.php @@ -30,7 +30,8 @@ class Calculation extends \Stripe\ApiResource const OBJECT_NAME = 'tax.calculation'; /** - * Calculates tax based on input and returns a Tax Calculation object. + * Calculates tax based on the input and returns a Tax Calculation + * object. * * @param null|array $params * @param null|array|string $options From 688c341a85528facaf3030db0340dbcf92ca766a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:16:40 +0000 Subject: [PATCH 08/13] Update generated code for v1094 --- OPENAPI_VERSION | 2 +- lib/TaxId.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1dbca34fc..ef0925653 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1093 \ No newline at end of file +v1094 \ No newline at end of file diff --git a/lib/TaxId.php b/lib/TaxId.php index 18a214c83..e69a22a88 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -17,7 +17,7 @@ * @property null|string|\Stripe\Customer $customer ID of the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false 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 ad_nrt, ae_trn, ar_cuit, au_abn, au_arn, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, kz_bin, li_uid, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sv_nit, th_vat, tr_tin, tw_vat, ua_vat, us_ein, uy_ruc, ve_rif, vn_tin, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $type Type of the tax ID, one of ad_nrt, ae_trn, ar_cuit, au_abn, au_arn, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_uid, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, kz_bin, li_uid, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sv_nit, th_vat, tr_tin, tw_vat, ua_vat, us_ein, uy_ruc, ve_rif, vn_tin, or za_vat. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. * @property null|\Stripe\StripeObject $verification Tax ID verification information. */ @@ -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'; From f4300d6d04175958ae1a4481b91803e38b314466 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:08:53 +0000 Subject: [PATCH 09/13] Update generated code for v1095 --- OPENAPI_VERSION | 2 +- init.php | 1 - lib/BalanceTransaction.php | 2 +- lib/Charge.php | 1 - lib/Customer.php | 1 - lib/Invoice.php | 1 - lib/PaymentIntent.php | 1 - lib/PlatformTaxFee.php | 17 ----------------- lib/Price.php | 1 - lib/Product.php | 1 - lib/Subscription.php | 1 - lib/Util/ObjectTypes.php | 1 - 12 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 lib/PlatformTaxFee.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ef0925653..eb43ae0c9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1094 \ No newline at end of file +v1095 \ No newline at end of file diff --git a/init.php b/init.php index c78f8ce2d..0439b7e86 100644 --- a/init.php +++ b/init.php @@ -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'; diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index d88cf9b52..5691d9573 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -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 amount - fee * @property string $reporting_category Learn more about how reporting categories 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 available or pending. * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ diff --git a/lib/Charge.php b/lib/Charge.php index 4b1d575ec..7c4a47fdc 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -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'; diff --git a/lib/Customer.php b/lib/Customer.php index a89347462..00ef44342 100644 --- a/lib/Customer.php +++ b/lib/Customer.php @@ -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'; diff --git a/lib/Invoice.php b/lib/Invoice.php index e313d7d03..6ac5ae130 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -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'; diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index 740592bd0..9d6cf0e5b 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -64,7 +64,6 @@ class PaymentIntent extends ApiResource { const OBJECT_NAME = 'payment_intent'; - use ApiOperations\Search; use ApiOperations\Update; const CANCELLATION_REASON_ABANDONED = 'abandoned'; diff --git a/lib/PlatformTaxFee.php b/lib/PlatformTaxFee.php deleted file mode 100644 index cb9fea7db..000000000 --- a/lib/PlatformTaxFee.php +++ /dev/null @@ -1,17 +0,0 @@ - \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, From 495881774406f80f7dfa73d0f86bc6e7a724b2e7 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:48:24 -0700 Subject: [PATCH 10/13] Update generated code (#1714) * Update generated code for v1087 * Update generated code for v1088 * Update generated code for v1092 * Update generated code for v1093 * Update generated code for v1094 * Update generated code for v1095 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- init.php | 1 - lib/BalanceTransaction.php | 2 +- lib/Charge.php | 1 - lib/Customer.php | 1 - lib/Invoice.php | 1 - lib/Issuing/Authorization.php | 2 ++ lib/PaymentIntent.php | 1 - lib/PlatformTaxFee.php | 17 ----------------- lib/Price.php | 1 - lib/Product.php | 1 - lib/Service/Tax/CalculationService.php | 3 ++- .../Issuing/AuthorizationService.php | 17 +++++++++++++++++ lib/Subscription.php | 1 - lib/Tax/Calculation.php | 3 ++- lib/TaxId.php | 3 ++- lib/Util/ApiVersion.php | 2 +- lib/Util/ObjectTypes.php | 1 - tests/Stripe/GeneratedExamplesTest.php | 6 +++--- 19 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 lib/PlatformTaxFee.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ac0cc575d..eb43ae0c9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1079 \ No newline at end of file +v1095 \ No newline at end of file diff --git a/init.php b/init.php index 9f2a11ebc..58131a84f 100644 --- a/init.php +++ b/init.php @@ -157,7 +157,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'; diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index d88cf9b52..5691d9573 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -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 amount - fee * @property string $reporting_category Learn more about how reporting categories 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 available or pending. * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ diff --git a/lib/Charge.php b/lib/Charge.php index 4b1d575ec..7c4a47fdc 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -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'; diff --git a/lib/Customer.php b/lib/Customer.php index a89347462..00ef44342 100644 --- a/lib/Customer.php +++ b/lib/Customer.php @@ -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'; diff --git a/lib/Invoice.php b/lib/Invoice.php index ad158fc3f..d054acf38 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -126,7 +126,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'; diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index f675cb167..ed14cd4e8 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -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 merchant_currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @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 true if the object exists in live mode or the value false if the object exists in test mode. * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. merchant_amount should be the same as amount, unless merchant_currency and currency 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 currency field on this authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index f3b122237..b5fc22a58 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -62,7 +62,6 @@ class PaymentIntent extends ApiResource { const OBJECT_NAME = 'payment_intent'; - use ApiOperations\Search; use ApiOperations\Update; const CANCELLATION_REASON_ABANDONED = 'abandoned'; diff --git a/lib/PlatformTaxFee.php b/lib/PlatformTaxFee.php deleted file mode 100644 index cb9fea7db..000000000 --- a/lib/PlatformTaxFee.php +++ /dev/null @@ -1,17 +0,0 @@ -Calculation object. + * Calculates tax based on the input and returns a Tax Calculation + * object. * * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts diff --git a/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/lib/Service/TestHelpers/Issuing/AuthorizationService.php index 50db7c836..82faeff47 100644 --- a/lib/Service/TestHelpers/Issuing/AuthorizationService.php +++ b/lib/Service/TestHelpers/Issuing/AuthorizationService.php @@ -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. * diff --git a/lib/Subscription.php b/lib/Subscription.php index ea78481c7..89233a9b0 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -60,7 +60,6 @@ class Subscription extends ApiResource { const OBJECT_NAME = 'subscription'; - use ApiOperations\Search; use ApiOperations\Update; const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; diff --git a/lib/Tax/Calculation.php b/lib/Tax/Calculation.php index f70b46593..d9155267d 100644 --- a/lib/Tax/Calculation.php +++ b/lib/Tax/Calculation.php @@ -30,7 +30,8 @@ class Calculation extends \Stripe\ApiResource const OBJECT_NAME = 'tax.calculation'; /** - * Calculates tax based on input and returns a Tax Calculation object. + * Calculates tax based on the input and returns a Tax Calculation + * object. * * @param null|array $params * @param null|array|string $options diff --git a/lib/TaxId.php b/lib/TaxId.php index 18a214c83..e69a22a88 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -17,7 +17,7 @@ * @property null|string|\Stripe\Customer $customer ID of the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false 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 ad_nrt, ae_trn, ar_cuit, au_abn, au_arn, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, kz_bin, li_uid, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sv_nit, th_vat, tr_tin, tw_vat, ua_vat, us_ein, uy_ruc, ve_rif, vn_tin, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $type Type of the tax ID, one of ad_nrt, ae_trn, ar_cuit, au_abn, au_arn, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_uid, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, de_stn, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, kz_bin, li_uid, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sv_nit, th_vat, tr_tin, tw_vat, ua_vat, us_ein, uy_ruc, ve_rif, vn_tin, or za_vat. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. * @property null|\Stripe\StripeObject $verification Tax ID verification information. */ @@ -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'; diff --git a/lib/Util/ApiVersion.php b/lib/Util/ApiVersion.php index 1c5578dc2..ccf8dc380 100644 --- a/lib/Util/ApiVersion.php +++ b/lib/Util/ApiVersion.php @@ -6,5 +6,5 @@ class ApiVersion { - const CURRENT = '2024-04-10'; + const CURRENT = '2024-06-20'; } diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 4bcda072c..07d750092 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -90,7 +90,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, diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index de9c2ef01..e7c8eabcc 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -3645,7 +3645,7 @@ public function testTestHelpersIssuingAuthorizationsCapturePost() 'type' => 'diesel', 'unit' => 'liter', 'unit_cost_decimal' => '3.5', - 'volume_decimal' => '10', + 'quantity_decimal' => '10', ], 'lodging' => [ 'check_in_at' => 1633651200, @@ -3878,7 +3878,7 @@ public function testTestHelpersIssuingTransactionsCreateForceCapturePost() 'type' => 'diesel', 'unit' => 'liter', 'unit_cost_decimal' => '3.5', - 'volume_decimal' => '10', + 'quantity_decimal' => '10', ], 'lodging' => [ 'check_in_at' => 1533651200, @@ -3939,7 +3939,7 @@ public function testTestHelpersIssuingTransactionsCreateUnlinkedRefundPost() 'type' => 'diesel', 'unit' => 'liter', 'unit_cost_decimal' => '3.5', - 'volume_decimal' => '10', + 'quantity_decimal' => '10', ], 'lodging' => [ 'check_in_at' => 1533651200, From 96f0dbe9c2b5365d716f86d92a27feecca2cbaee Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Mon, 24 Jun 2024 16:05:11 -0700 Subject: [PATCH 11/13] Bump version to 15.0.0 --- CHANGELOG.md | 16 ++++++++++++++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d037cc75f..cae0d1df4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.10.0 - 2024-06-13 * [#1706](https://github.com/stripe/stripe-php/pull/1706) Update generated code * Add support for `multibanco` on `PaymentMethodConfiguration` and `PaymentMethod` diff --git a/VERSION b/VERSION index 6242bb49d..94188a748 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -14.10.0 +15.0.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index 5dde4f592..4f5d81405 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '14.10.0'; + const VERSION = '15.0.0'; /** * @return string the API key used for requests From 4e1243e4ec1ceb65a8fa5e31e1a161db4c0c752d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:40:17 +0000 Subject: [PATCH 12/13] Update generated code for v1097 --- OPENAPI_VERSION | 2 +- lib/Terminal/Configuration.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eb43ae0c9..4b02d1b94 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1095 \ No newline at end of file +v1097 \ No newline at end of file diff --git a/lib/Terminal/Configuration.php b/lib/Terminal/Configuration.php index 7a0e411b1..66a6e6673 100644 --- a/lib/Terminal/Configuration.php +++ b/lib/Terminal/Configuration.php @@ -14,6 +14,7 @@ * @property bool $livemode Has the value true if the object exists in live mode or the value false 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 From 6096a1b6252a9535a97452831f011209ac55f6be Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:21:12 +0000 Subject: [PATCH 13/13] Update generated code for v1102 --- OPENAPI_VERSION | 2 +- lib/Margin.php | 2 +- lib/Service/MarginService.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4b02d1b94..cd25cb7e2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1097 \ No newline at end of file +v1102 \ No newline at end of file diff --git a/lib/Margin.php b/lib/Margin.php index f3c2aaf3a..ad4a52fe1 100644 --- a/lib/Margin.php +++ b/lib/Margin.php @@ -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 * percent_off 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 diff --git a/lib/Service/MarginService.php b/lib/Service/MarginService.php index a10f979f8..bbf28a4f5 100644 --- a/lib/Service/MarginService.php +++ b/lib/Service/MarginService.php @@ -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 * percent_off 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