add_lines, remove_lines, and update_lines methods on resource Invoicepayment_intent_fx_quote_invalid on enum StripeError.codemultibanco, twint, and zip on enum PaymentLink.payment_method_types[]posted_at on Tax.Transactionreboot_window on Terminal.ConfigurationThis release changes the pinned API version to 2024-06-20. Please read the API Upgrade Guide 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
finalize_amount test helper method on resource Issuing.Authorizationfleet and fuel on Issuing.Authorizationch_uid on enum TaxId.typemultibanco on PaymentMethodConfiguration and PaymentMethodtwint on PaymentMethodmultibanco and twint on enum PaymentMethod.typeinvoice_settings on Subscriptionde_stn on enum TaxId.typeissuing_personalization_design.activated, issuing_personalization_design.deactivated, issuing_personalization_design.rejected, and issuing_personalization_design.updated on enum Event.typecreate, update, delete, all, retrieve methods after moving them out of traits.StripeClient can now accept $appInfo as a $config option, so AppInfo can be set per-client. If not passed in, will fall back on the global AppInfo set by Stripe::setAppInfo().$appInfo to be of type array{name: string, version?: string, url?: string, partner_id?: string}terminal_reader_invalid_location_for_payment on enum StripeError.codefee_source on ApplicationFeeloss_reason on Issuing.Disputeapplication_fee_amount and application_fee on Payoutstripe_s700 on Terminal.Configurationupdate test helper method on resources Treasury.OutboundPayment and Treasury.OutboundTransfertreasury.outbound_payment.tracking_details_updated and treasury.outbound_transfer.tracking_details_updated on enum Event.typeallow_redisplay on PaymentMethodtracking_details on Treasury.OutboundPayment and Treasury.OutboundTransfershipping_address_invalid on enum StripeError.codeship_from_details on Tax.Calculation and Tax.TransactionEntitlements.ActiveEntitlement.feature from string to expandable($Entitlements.Feature)mobilepay on PaymentMethodConfigurationcreate_preview method on resource Invoicesaved_payment_method_options on Checkout.SessionEntitlements.ActiveEntitlementSummaryentitlements.active_entitlement_summary.updated on enum Event.typeconfig on Forwarding.Request. This field is no longer used by the Forwarding Request API.swish on PaymentMethodConfigurationbilling_policy_remote_function_response_invalid, billing_policy_remote_function_timeout, billing_policy_remote_function_unexpected_status_code, and billing_policy_remote_function_unreachable on enum StripeError.codeBilling.MeterEventAdjustment.cancel from BillingMeterResourceBillingMeterEventAdjustmentCancel to nullable(BillingMeterResourceBillingMeterEventAdjustmentCancel)amazon_pay on PaymentMethodConfiguration and PaymentMethodamazon_pay on enum PaymentMethod.typebh_vat, kz_bin, ng_tin, and om_vat on enum TaxId.type2024-04-10. Please read the API Upgrade Guide and carefully review the API changes before upgrading.### ⚠️ Breaking changes
features to marketing_features on ProductDo not force resolution to IPv4 - Forcing IPv4 was causing hard-to-understand failures for users in IPv6-only environments. If you want to force IPv4 yourself, you can do so by telling the API client to use a CurlClient other than the default
$curl = new \Stripe\HttpClient\CurlClient([
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4
]);
\Stripe\ApiRequestor::setHttpClient($curl);
#### ⚠️ Removal of enum values, properties and events that are no longer part of the publicly documented Stripe API
BalanceTransaction.Type
obligation_inboundobligation_payoutobligation_payout_failureobligation_reversal_outboundvarious on the enum Climate.Supplier.RemovalPathwayinvoiceitem.updatedorder.createdrecipient.createdrecipient.deletedrecipient.updatedsku.createdsku.deletedsku.updatedservice_tax on the enum TaxRate.TaxTypeid_bank_transfer, multibanco, netbanking, pay_by_bank, and upi on PaymentMethodConfigurationrendering_options in Invoice. Use rendering instead.Entitlements.ActiveEntitlement and Entitlements.Featureall and retrieve methods on resource ActiveEntitlementall, create, retrieve, and update methods on resource Featurenone on enum Account.typecancel, event_name, and type on Billing.MeterEventAdjustmentsubscription_item on Discountemail and phone on Identity.VerificationReportverification_flow on Identity.VerificationReport and Identity.VerificationSessionverification_flow on enums Identity.VerificationReport.type and Identity.VerificationSession.typeprovided_details on Identity.VerificationSessionInvoice.discounts from nullable(array(expandable(deletable($Discount)))) to array(expandable(deletable($Discount)))zip on PaymentMethodConfigurationdiscounts on SubscriptionItem and Subscriptionmobile_phone_reader on enum Terminal.Reader.device_typeBilling.MeterEventAdjustment, Billing.MeterEvent, and Billing.Meterall, create, deactivate, reactivate, retrieve, and update methods on resource Metercreate method on resources MeterEventAdjustment and MeterEventmeter on PlanConfirmationToken and Forwarding.Requestretrieve method on resource ConfirmationTokenall, create, and retrieve methods on resource Requestforwarding_api_inactive, forwarding_api_invalid_parameter, forwarding_api_upstream_connection_error, and forwarding_api_upstream_connection_timeout on enum StripeError.codemobilepay on PaymentMethodmobilepay on enum PaymentMethod.typename on Terminal.ConfigurationIssuing.PersonalizationDesign and Issuing.PhysicalBundleall, create, retrieve, and update methods on resource PersonalizationDesignall and retrieve methods on resource PhysicalBundlepersonalization_design on Issuing.CardIdentity.VerificationSession.type from nullable(enum('document'|'id_number')) to enum('document'|'id_number')Application, ConnectCollectionTransfer, PlatformTaxFee, ReserveTransaction, SourceMandateNotification, and TaxDeductedAtSource. These classes have no methods on them, and are used to provide more complete types for PHPDocs.client_reference_id on Identity.VerificationReport and Identity.VerificationSessionservice_tax from enum TaxRate.tax_typeall, create, delete, and retrieve methods on resource TaxIdinstanceUrl function on TaxId now returns the top-level /v1/tax_ids/{id} path instead of the /v1/customers/{customer}/tax_ids/{id} path.networks on Cardfinancial_connections.account.refreshed_ownership on enum Event.typeCustomerCashBalanceTransaction::all and CustomerCashBalanceTransaction::retrieve. These methods were included in the library unintentionally and never functioned.swish on enum PaymentLink.payment_method_types[]swish on PaymentMethodswish on enum PaymentMethod.typejurisdiction_level on TaxRateTerminal.Reader.status from string to enum('offline'|'online')issuer on Invoicecustomer_balance on PaymentMethodConfigurationCustomerSessioncreate method on resource CustomerSessionobligation_inbound, obligation_payout_failure, obligation_payout, and obligation_reversal_outbound from enum BalanceTransaction.typebilling_cycle_anchor_config on Subscriptionretrieve method on resource Tax.RegistrationFinancialConnections.Transactionall and retrieve methods on resource Transactionsubscribe and unsubscribe methods on resource FinancialConnections.Accountfinancial_connections.account.refreshed_transactions on enum Event.typesubscriptions and transaction_refresh on FinancialConnections.Accounttransactions on enum FinancialConnections.Session.prefetch[]revolut_pay on PaymentMethodConfigurationid_bank_transfer, multibanco, netbanking, pay_by_bank, and upi on PaymentMethodConfigurationQuote.invoice_settings from nullable(InvoiceSettingQuoteSetting) to InvoiceSettingQuoteSettingdestination_details on Refundcustomer_tax_location_invalid and financial_connections_no_successful_transaction_refresh on enum StripeError.codepayment_network_reserve_hold and payment_network_reserve_release on enum BalanceTransaction.typevarious from enum Climate.Supplier.removal_pathwayinactive_message and restrictions on PaymentLink.save and of StripeClient in X-Stripe-Client-Telemetry. (You can disable telemetry via \Stripe\Stripe::setEnableTelemetry(false);, see the README.)Climate.Order, Climate.Product, and Climate.Supplierall, cancel, create, retrieve, and update methods on resource Orderall and retrieve methods on resources Product and Supplierfinancial_connections_account_inactive on enum StripeError.codeclimate_order_purchase and climate_order_refund on enum BalanceTransaction.typeclimate.order.canceled, climate.order.created, climate.order.delayed, climate.order.delivered, climate.order.product_substituted, climate.product.created, and climate.product.pricing_updated on enum Event.typetransferred_to_balance to CustomerCashBalanceTransactionnetwork_data on Issuing.Transactionterminal_reader_hardware_fault on enum StripeError.codeTax.Registrationall, create, and update methods on resource Registrationtoken_card_network_invalid on enum StripeError.codepayment_unreconciled on enum BalanceTransaction.typerevolut_pay on PaymentMethodrevolut_pay on enum PaymentMethod.typebalance_invalid_parameter on enum StripeError.code2023-10-16. Please read the API Upgrade Guide and carefully review the API changes before upgrading stripe-php package.additional_tos_acceptances field on Personissuing_token.created and issuing_token.updated on enum Event.typeclient_secret, redirect_on_completion, return_url, and ui_mode on Checkout.Sessionoffline on Terminal.ConfigurationIssuing.Tokenall, retrieve, and update methods on resource Tokentoken on Issuing.Authorization and Issuing.Transactionfriendsofphp/php-cs-fixerrendering on Invoiceinvoiceitem.updated webhook event. This was mistakenly removed in v12.2.0.squizlabs/php_codesnifferphpunit.xsd as installed with composerPaymentMethodConfigurationall, create, retrieve, and update methods on resource PaymentMethodConfigurationpayment_method_configuration_details on Checkout.Session, PaymentIntent, and SetupIntentcapture, create, expire, increment, and reverse test helper methods on resource Issuing.Authorizationcreate_force_capture, create_unlinked_refund, and refund test helper methods on resource Issuing.Transactionstripe_tax_inactive on enum StripeError.codePaymentMethodDomainall, create, retrieve, update, and validate methods on resource PaymentMethodDomaintreasury.credit_reversal.created, treasury.credit_reversal.posted, treasury.debit_reversal.completed, treasury.debit_reversal.created, treasury.debit_reversal.initial_credit_granted, treasury.financial_account.closed, treasury.financial_account.created, treasury.financial_account.features_status_updated, treasury.inbound_transfer.canceled, treasury.inbound_transfer.created, treasury.inbound_transfer.failed, treasury.inbound_transfer.succeeded, treasury.outbound_payment.canceled, treasury.outbound_payment.created, treasury.outbound_payment.expected_arrival_date_updated, treasury.outbound_payment.failed, treasury.outbound_payment.posted, treasury.outbound_payment.returned, treasury.outbound_transfer.canceled, treasury.outbound_transfer.created, treasury.outbound_transfer.expected_arrival_date_updated, treasury.outbound_transfer.failed, treasury.outbound_transfer.posted, treasury.outbound_transfer.returned, treasury.received_credit.created, treasury.received_credit.failed, treasury.received_credit.succeeded, and treasury.received_debit.created on enum Event.typeinvoiceitem.updated from enum Event.typefeatures on ProductAccountSessioncreate method on resource AccountSessionobligation_inbound, obligation_outbound, obligation_payout_failure, obligation_payout, obligation_reversal_inbound, and obligation_reversal_outbound on enum BalanceTransaction.typeEvent.type from string to enumapplication on PaymentLinkpayment_method_details on Disputeprefetch on FinancialConnections.Session⚠️ ACTION REQUIRED: the breaking change in this release likely affects you ⚠️
In this release, Stripe API Version 2023-08-16 (the latest at time of release) will be sent by default on all requests. This is a significant change with wide ramifications. The API version affects the properties you see on responses, the parameters you are allowed to send on requests, and so on. The previous default was to use your Stripe account's default API version.
To successfully upgrade to stripe-php v12, you must either
2023-08-16.Please read the API Changelog carefully for each API Version from 2023-08-16 back to your Stripe account's default API version. Determine if you are using any of the APIs that have changed in a breaking way, and adjust your integration accordingly. Carefully test your changes with Stripe Test Mode before deploying them to production.
You can read the v12 migration guide for more detailed instructions.
(Alternative option) Specify a version other than 2023-08-16 when initializing stripe-php.
If you were previously initializing stripe-php without an explicit API Version, you can postpone modifying your integration by specifying a version equal to your Stripe account's default API version. For example:
// if using StripeClient
- $stripe = new \Stripe\StripeClient('sk_test_xyz');
+ $stripe = new \Stripe\StripeClient([
+ 'api_key' => 'sk_test_xyz',
'stripe_version' => '2020-08-27',
+ ]);
// if using the global client
Stripe.apiKey = "sk_test_xyz";
+ Stripe::setApiVersion('2020-08-27');
If you were already initializing stripe-php with an explicit API Version, upgrading to v12 will not affect your integration.
Read the v12 migration guide for more details.
Going forward, each major release of this library will be pinned by default to the latest Stripe API Version at the time of release.
That is, instead of upgrading stripe-php and separately upgrading your Stripe API Version through the Stripe Dashboard, whenever you upgrade major versions of stripe-php, you should also upgrade your integration to be compatible with the latest Stripe API version.
" ⚠️" symbol highlights breaking changes.
#1553⚠️ Remove deprecated enum value Invoice.STATUS_DELETE
#1550 PHPDoc changes
alternate_statement_descriptors, destination, and dispute on Chargecharge_refunded from enum Dispute.statusrendering on Invoiceattributes, caption, and deactivate_on on ProductPlease do not use stripe-php v11. It did not correctly apply the pinning behavior and was removed from packagist
payment_reversal on enum BalanceTransaction.typeadjusted_for_overdraft on enum CustomerBalanceTransaction.typesubscription_details on Invoicesepa_debit_fingerprint and us_bank_account_fingerprint on enum Radar.ValueList.item_typeApplicationFee.refundsdeleted on Apps.Secretservice_tax on enum TaxRate.tax_typeservice_tax on enum TaxRate.tax_typeTax.Settingsretrieve and update methods on resource Settingsinvalid_tax_location on enum StripeError.codeproduct on Tax.TransactionLineItemtax.settings.updated webhook eventapplication_fees_not_allowed on enum StripeError.codeeffective_at on CreditNote and Invoiceon_behalf_of on MandateCheckout.Session.success_url from string to nullable(string)preferred_locales on Issuing.Cardholderzip on PaymentMethodzip on enum PaymentMethod.type#1501 Update generated code
#1499 Update generated code
amusement_tax and communications_tax on enum TaxRate.tax_typepaypal on PaymentMethodeffective_percentage on TaxRate#1483 Update generated code
#1480 Update generated code
Identity.VerificationSession.options from VerificationSessionOptions to nullable(VerificationSessionOptions)Identity.VerificationSession.type from enum('document'|'id_number') to nullable(enum('document'|'id_number'))#1478 Update generated code
#1475 Update generated code
deleted from Invoice.status.create method on resource Tax.TransactioncreateFromCalculation method.deleted from enum Invoice.statusTax.CalculationLineItem, Tax.Calculation, Tax.TransactionLineItem, and Tax.Transactioncreate and list_line_items methods on resource Calculationcreate_from_calculation, create_reversal, create, list_line_items, and retrieve methods on resource Transactioncurrency_conversion on Checkout.Sessionautomatic_async on enum PaymentIntent.capture_methodlink on enum PaymentLink.payment_method_types[]automatic_payment_methods on SetupIntentfuture_requirements and requirements on BankAccountautomatic_async on enum PaymentIntent.capture_methodcashapp on enum PaymentLink.payment_method_types[]cashapp on PaymentMethodcashapp on enum PaymentMethod.typecashapp on enum PaymentLink.payment_method_types[]cashapp on PaymentMethodcashapp on enum PaymentMethod.type#1450 API Updates
cancellation_details on Subscription#1446 stripe->customers->retrievePaymentMethod returns the wrong class (type hint)
reconciliation_status on Payoutlease_tax on enum TaxRate.tax_typeigst on enum TaxRate.tax_typerefund_payment method on resource Terminal.Readercustom_fields on Checkout.Session and PaymentLinkactions/checkoutvisibility_required fixeractions/cacheresume method on resource Subscriptionamount_shipping and shipping_cost on CreditNote and Invoiceshipping_details on Invoiceinvoice_creation on PaymentLinktrial_settings on Subscriptionpaused on enum Subscription.status#1424 API Updates
REFUND_CREATED, REFUND_UPDATED event definitions.#1426 Ignore PHP version for formatting
#1425 Fix Stripe::setAccountId parameter type
#1418 Switch to mb_convert_encoding to fix utf8_encode deprecation warning
CheckoutSession.cancel_url to be nullable.invoice_overpaid on enum CustomerBalanceTransaction.typeflow on BillingPortal.SessionOrder and Skuall, cancel, create, list_line_items, reopen, retrieve, submit, and update methods on resource Orderall, create, delete, retrieve, and update methods on resource Skucustom_text on Checkout.Session and PaymentLinkinvoice_creation and invoice on Checkout.Sessionproduct on LineItemlatest_charge on PaymentIntentcharges on PaymentIntentBreaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15.
"⚠️" symbol highlights breaking changes.
#1382 Mark resource.save as deprecated. Prefer the static update method that doesn't require retrieval of the resource to update it.
// before
$resource = Price::retrieve(self::TEST_RESOURCE_ID);
$resource->metadata['key'] = 'value';
$resource->save();
// after
$resource = Price::update('price_123', [
'metadata' => ['key' => 'value'],
]);
Sku resource and serviceOrders resource and serviceProduct field from the LineItemAlipayAccount resourcecharges field on PaymentIntent and replace it with latest_charge.eg_tin, ph_tin, and tr_tin on enum TaxId.typeon_behalf_of on Subscriptionjp_trn and ke_pin on enum TaxId.typefriendsofphp/php-cs-fixernetwork_data on Issuing.Authorizationcreated on Checkout.Sessionfrom_invoice and latest_revision on Invoicepix on enum PaymentLink.payment_method_types[]pix on PaymentMethodpix on enum PaymentMethod.typecreated on Treasury.CreditReversal and Treasury.DebitReversalterminal_reader_splashscreen on enum File.purposelogin_page on BillingPortal.ConfigurationInvoice.last_finalization_error, PaymentIntent.last_payment_error, SetupAttempt.setup_error and SetupIntent.setup_error type to be StripeObject.ErrorObject for these fields, so the type annotation was incorrect.Treasury.OutboundTransfer.destination_payment_method from string to string | nullCustomerService.fundCashBalance test helper from CustomerBalanceTransaction to CustomerCashBalanceTransaction.CustomerCashBalanceTransactioncurrency on PaymentLinkcustomer_cash_balance_transaction.created webhook event.#1348 API Updates
payment_method_collection on Checkout.Session and PaymentLink#1346 API Updates
expires_at on Apps.SecretBreaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v9. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01.
"⚠️" symbol highlights breaking changes.
alternate_statement_descriptors, authorization_code, and level3 properties to Charge resource.previewLines method to CreditNote resource.transfer_data property to Subscription resource.SOURCE_TYPE_FPX constant to Transfer resource.ErrorObject.shipping_cost and shipping_details on Checkout.Sessionparams parameter to close method in Dispute resource.AlipayAccount, BitcoinReceiver, BitcoinTransaction, Recipient, RecipientTransfer, and ThreeDSecure resources.CAPABILITY_CARD_PAYMENTS, CAPABILITY_LEGACY_PAYMENTS, CAPABILITY_PLATFORM_PAYMENTS, CAPABILITY_TRANSFERS, CAPABILITY_STATUS_ACTIVE, CAPABILITY_STATUS_INACTIVE, and CAPABILITY_STATUS_PENDING constants from Account resource. Please use up-to-date values from https://stripe.com/docs/connect/account-capabilities.AssociatedObjects array property from EphemeralKey resource. The field was undocumented and unsupported.details method from Card resource. The endpoint was deprecated and no longer exists.recipient property from Card resource. The property was deprecated.Card resources for a particular Recipient.sources property from Card resource. The property was deprecated.FAILURE_REASON constant from Refund resource. The value was deprecated.Recipient resource. The resource was deprecated.OrderItem resource. The resource was deprecated.all method from LineItem.cancel method from Transfer and TransferService. This method is deprecated.allTransactions method from SourceService service. Please use allSourceTransactions method instead.persons method from Account resource. Please use allPersons method instead.sourceTransactions method from Source resource. Please use allSourceTransactions method instead.usageRecordSummaries method from SubscriptionItem resource. Please use allUsageRecordSummaries method instead.SOURCE_TYPE_ALIPAY_ACCOUNT and SOURCE_TYPE_FINANCING constants from Transfer resource. The values were deprecated and are no longer in use.ErrorObject: CODE_ACCOUNT_ALREADY_EXISTS, CODE_ORDER_CREATION_FAILED, CODE_ORDER_REQUIRED_SETTINGS, CODE_ORDER_STATUS_INVALID, CODE_ORDER_UPSTREAM_TIMEOUT, and CODE_UPSTREAM_ORDER_CREATION_FAILED.Webhook: ISSUER_FRAUD_RECORD_CREATED, ORDER_PAYMENT_FAILED, ORDER_PAYMENT_SUCCEEDED, ORDER_UPDATED, ORDER_RETURN_CREATED, PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED, PING, PROMOTION_CODE_DELETED, and TREASURY_RECEIVED_CREDIT_REVERSED. The events are deprecated and no longer sent by Stripe.default_currency and invoice_credit_balance on Customerblik on enum PaymentLink.payment_method_types[]blik on PaymentMethodblik on enum PaymentMethod.typeInvoice.upcomingLines method.SourceService.allSourceTransactions method.source_type on Transfer from nullable string to string (comment-only change)currency_options on Coupon and Pricecurrency on SubscriptionEvent.deliver_card, fail_card, return_card, and ship_card test helper methods on resource Issuing.Cardsubtotal_excluding_tax on CreditNote and Invoiceamount_excluding_tax and unit_amount_excluding_tax on CreditNoteLineItem and InvoiceLineItemtotal_excluding_tax on InvoicePaymentLink.payment_method_types[] from literal('card') to enumpromptpay on PaymentMethodpromptpay on enum PaymentMethod.typehosted_regulatory_receipt_url and reversal_details on Treasury.ReceivedCredit and Treasury.ReceivedDebitDocumentation updates.
fund_cash_balance test helper method on resource Customertotal_excluding_tax on CreditNoterendering_options on Invoicecustom_unit_amount on PriceDocumentation updates.
attach_to_self and flow_directions on SetupAttemptradar_options on Charge and PaymentMethodsimulated_wisepos_e on enum Terminal.Reader.device_typepersons method on resource Accountbalance_transactions method on resource Customerid_number_secondary_provided on PersonApps.Secretaffirm and link on PaymentMethodaffirm and link on enum PaymentMethod.typeTreasury.CreditReversal, Treasury.DebitReversal, Treasury.FinancialAccountFeatures, Treasury.FinancialAccount, Treasury.FlowDetails, Treasury.InboundTransfer, Treasury.OutboundPayment, Treasury.OutboundTransfer, Treasury.ReceivedCredit, Treasury.ReceivedDebit, Treasury.TransactionEntry, and Treasury.Transactionretrieve_payment_method method on resource Customerall and list_owners methods on resource FinancialConnections.Accounttreasury on Issuing.Authorization, Issuing.Dispute, and Issuing.Transactionfinancial_account on Issuing.Cardclient_secret on Orderattach_to_self and flow_directions on SetupIntentconsent_collection, customer_creation, payment_intent_data, shipping_options, submit_type, and tax_id_collection on PaymentLinkdescription on SubscriptionOrder API with the new Order API.Order.cancel, list_line_items, reopen, and submitpay and return_orderOrderItem and OrderReturnCharge.order\FinancialConnections\Account.refresh method to \FinancialConnections\Account.refresh_accountamount_discount, amount_tax, and product on LineItemdefault_price on Productinstructions_email on RefundFinancialConnections.AccountOwner, FinancialConnections.AccountOwnership, FinancialConnections.Account, and FinancialConnections.Sessionregistered_address on PersonCashBalanceBillingPortal.Configuration.application from $Application to deletable($Application)cash_balance on Customerapplication on Invoice, Quote, SubscriptionSchedule, and Subscriptioneu_oss_vat on enum TaxId.typeexpire test helper method on resource RefundFundingInstructions and Terminal.Configurationcreate_funding_instructions method on resource Customeramount_details on PaymentIntentcustomer_balance on PaymentMethodcustomer_balance on enum PaymentMethod.typeconfiguration_overrides on Terminal.Locationincrement_authorization method on resource PaymentIntentapply_customer_balance method on resource PaymentIntent#1259 API Updates
payment_intent.partially_funded, terminal.reader.action_failed, and terminal.reader.action_succeeded events.cancel_action, process_payment_intent, process_setup_intent, and set_reader_display methods on resource Terminal.Readeraction on Terminal.Readersearch method on resources Charge, Customer, Invoice, PaymentIntent, Price, Product, and Subscriptionpaynow and us_bank_account on PaymentMethodpaynow and us_bank_account on enum PaymentMethod.typefailure_balance_transaction on Chargecancel method on resource Refundbg_uic, hu_tin, and si_tin on enum TaxId.typetest_helpers.test_clock.advancing, test_helpers.test_clock.created, test_helpers.test_clock.deleted, test_helpers.test_clock.internal_failure, and test_helpers.test_clock.ready events.status on Cardproration_details on InvoiceLineItemTestHelpers.TestClocktest_clock on Customer, Invoice, InvoiceItem, Quote, Subscription, and SubscriptionSchedulenext_action on Refundkonbini on PaymentMethodbbpos_wisepad3 and stripe_m2 on enum Terminal.Reader.device_typeverify_microdeposits method on resources PaymentIntent and SetupIntentREASON_EXPIRED_UNCAPTURED_CHARGE enum value on Refund.phone_number_collection on PaymentLinkis_vat on enum TaxId.typePaymentLinkpayment_link on Checkout.Sessionpaid_out_of_band on Invoiceprocessing on PaymentIntentmetadata on BillingPortal.Configurationwallets on Issuing.Cardge_vat and ua_vat on enum TaxId.typejct on enum TaxRate.tax_typeautomatic_payment_methods on PaymentIntentShippingRateshipping_options and shipping_rate on Checkout.Sessionexpire method on resource Checkout.Sessionstatus on Checkout.Sessionklarna on PaymentMethod.list_payment_methods method on resource Customerphone_number_collection on Checkout.Sessioncustomer_id on enum Radar.ValueList.item_typebbpos_wisepos_e on enum Terminal.Reader.device_typefull_name_aliases on Personrst on enum TaxRate.tax_typefuture_requirements on Account, Capability, and Personafter_expiration, consent, consent_collection, expires_at, and recovered_from on Checkout.Sessionfil on enum Checkout.Session.localeau_arn on enum TaxId.type#1172 API Updates
locale on BillingPortal.Session#1171 Fix typo in docblock CurlClient::executeStreamingRequestWithRetries
account_type on BankAccountredacted on enum Review.closed_reasonhr, ko, and vi on enum Checkout.Session.localepayment_settings on Subscriptionwallet on Issuing.Transactionlist_computed_upfront_line_items method on resource QuoteQuotequote on Invoicequote_accept on enum Invoice.billing_reasonsetStreamingHttpClient and streamingHttpClient to ApiRequestorgetStreamingClient and requestStream to AbstractServicerequestStream to BaseStripeClient\Stripe\RequestOptions::parse now clones its input if it is already a RequestOptions object, to prevent accidental mutation.mode constants into Checkout\Sessionwechat_pay on PaymentMethodboleto on PaymentMethod.il_vat as a member of the TaxID.Type enum.ca_pst_mb, ca_pst_bc, ca_gst_hst, and ca_pst_sk.url on Checkout\Sessiontax_id_collection on Checkout\Session and Checkout\Session#createLocation to be expandable on Terminal\Readercontroller on Account.TaxCodeautomatic_tax Invoice andCheckout.Session.tax_behavior on Pricetax_code on Producttax on Customertax_type enum on TaxRateIdentity.VerificationReportIdentity.VerificationSessionFile#list.purpose and File.purpose added new enum members: identity_document_downloadable and selfie.Radar.EarlyFraudWarning.payment_intentacss_debit on PaymentMethodpayment_method_options on Checkout\Sessionamount_shipping on Checkout.Session.total_detailsafterpay_clearpay on PaymentMethod.afterpay_clearpay_payments on Account.capabilitiespayment_settings on Invoicenationality on Persongb_vat of TaxID enumDiscountproration_behavior on Subscriptionjp_rn and ru_kpp as a type on TaxIdSetupAttempt resource and List APITYPE_CONTRIBUTION as a constant on BalanceTransactionpayment_status on Checkout SessionPromotionCode resource and APIsfirst() and last() functions to Collectionpolitical_exposure on Personpurpose on Filebilling_address_collection on Checkout Sessionpayment_behavior on SubscriptionEventid_npwp and my_frp as type on TaxIdae_trn, cl_tin and sa_vat as type on TaxIdanticipation_repayment as a type on BalanceTransactionissuing_dispute as a type on BalanceTransactionLineItem resource and APIsPrice resource and APIsSession resource and APIs on the BillingPortal namespaceTYPE_ADJUSTEMENT enum.StripeObject::toArray()type on TaxId\Stripe\Collection implement \Countablenative_function_invocation PHPStan ruleStripeObject -> ErrorObject where appropriateTYPE_ES_CIF on TaxIdTaxIdUnexpectedValueException instantiationCreditNoteLineItemApiErrorException.get/setJsonBody() methodsTYPE_SG_UEN to TaxIdThrowableSubscriptionCreditNote preview.Invoice::allLines()array_key_exists cannot be nullMandateTaxIdRequestOptions debug infopayment_intent.canceled and setup_intent.canceled eventstoArray() on objects onlySetupIntent eventsCaseInsensitiveArray countable and traversableSignatureVerificationException in PHPDoc blocksMajor version release. The migration guide contains a detailed list of backwards-incompatible changes with upgrade instructions.
Pull requests included in this release (cf. #552) (⚠️ = breaking changes):
CURLFile check (#555)FileUpload alias (#557)curl_reset check (#570)\Stripe\<class>::class constant instead of strings (#643)array_column to flatten params (#686)IssuerFraudRecord (#696)ErrorObject to Stripe exceptions (#705)Collection improvements / fixes (#715)toArray() calls (#719)LoggerInterface::error compatible with its PSR-3 counterpartpending_setup_intent property in SubscriptionApiResponseSubscriptionItem::createUsageRecord methodSubscriptionScheduleRevision
/v1/balance_transactionsSetupIntent resource and APIsCustomerBalanceTransaction::update()collection_method on InvoiceCustomerBalanceTransaction resource and APIsradar.early_fraud_warning resourceEvent::PAYMENT_METHOD_ATTACHED constantstatic to improve static analysispayment_intent.payment_failedTaxId resource and APIs$personId in PHPDocCreditNotePaymentMethod resource and APIsSessionLocation and Readermetadatasubscription_schedule to Subscription for PHPDoc.Source object to cover all types of Sources currently supported.SubscriptionSchedule and SubscriptionScheduleRevisionSubscriptionSchedule and SubscriptionScheduleRevisionCheckoutSession to Session and move it under the Checkout namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach.individual on Account objectsCollection instancesCheckoutSession resourceValueList and ValueListItem for RadarException class properties from OAuthBase errorInvoice resource.\Stripe\PaymentIntent to properly pass arguments to the API.\Stripe\FileUpload class aliasflow (FLOW_*), status (STATUS_*) and usage (USAGE_*) on \Stripe\Source\Stripe\FileUpload to \Stripe\FileisDeleted() method to \Stripe\StripeObject\Stripe\Sigma\ScheduledQueryRun) for Sigma\Stripe\ApiResource.classUrl() methodauto_advance on \Stripe\Invoice$appPartnerId to Stripe::setAppInfo()Account.deauthorize() return the StripeObject from the APIApiRequestor and others, especially regarding thrown errors\Stripe\Discount and \Stripe\OrderItem classes, add more PHPDoc describing object attributesCHARGE_EXPIRED event type\Stripe\InvoiceLineItemOBJECT_NAME constant to all API resource classes, add \Stripe\InvoiceLineItem classmetadata subobjectsaccount on \Stripe\Eventreason (REASON_*) and status (STATUS_*) on \Stripe\Disputeamount_paid and amount_remaining on \Stripe\Invoice\Stripe\Event classcode attribute on all Stripe exceptionsMajor version release. List of backwards incompatible changes to watch out for:
The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version.
\Stripe\AttachedObject no longer exists. Attributes that used to be instances of \Stripe\AttachedObject (such as metadata) are now instances of \Stripe\StripeObject.
Attributes that used to be PHP arrays (such as legal_entity->additional_owners on \Stripe\Account instances) are now instances of \Stripe\StripeObject, except when they are empty. \Stripe\StripeObject has array semantics so this should not be an issue unless you are actively checking types.
\Stripe\Collection now derives from \Stripe\StripeObject rather than from \Stripe\ApiResource.
Pull requests included in this release:
ExternalAccount class__debugInfo() magic method to StripeObjectUtil::convertToStripeObject() and add missing resourcespersonal_address_kana and personal_address_kanji to be updated on an accountAccount gains methods for external accounts and login links (e.g. createExternalAccount, createLoginLink)ApplicationFee gains methods for refundsCustomer gains methods for sourcesTransfer gains methods for reversalsdelete to detach (and deprecate the former)CardFileUpload objectsshipping nested attributeInvalidClient OAuth erroraddress_kana and address_kanji to be updated for custom accountsautoPagingIterator() (was missing namespace)/v1/order_returnspay on invoice now takes params as well as optsgetUserAgentInfo() to add additional user agent informationCountable for AttachedObject (metadata and additional_owners)$id parameter for retrieve methodspayout_schedule to be updated\Stripe\Stripe::setLogger() to support an external PSR-3 compatible loggerowner parameter when updating sourcesPlanStripe::setAppInfo to allow plugins to register user agent informationSource model for generic payment sourcesgetDeclineCode to card errorsSTATUS_ constants for subscriptionsiterator_to_arrayThreeDSecure model for 3-D secure paymentsupdate method to all resources that can be changed.Expects: 100-continue, even on large request bodiesinventory under SKU to list of keys that have nested data and can be updatedlist, create, update, retrieve, and delete methods to the Subscription classrefreshFrom on StripeObject would not take an $opts array$opts not passed to parent save method in Accountreverse in TransferCurlClient to be initialized with default CURLOPT_* optionsApplicationFee's refund.reject on Account to support the new API featureautoPagingIterator()Stripe::setAccountId()CountrySpec model for looking up country payment information\Stripe\Object to \Stripe\StripeObject (PHP 7 compatibility)getCode and getParam in exceptions to getStripeCode and getStripeParamjson_encode on Stripe objects in PHP 5.4+tos_acceptance and personal_address to be set properlyFileUpload)Stripe_Coupon instead of Stripe_Object, and support updating metadatacreate, retrieve, all) on upcoming invoice items now works__toString now returns the name of the object in addition to its JSON representationid wasn't in the result