From 97a51f193377713f9980794ac53393f540e840a7 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:28:26 -0400 Subject: [PATCH 1/5] Update generated code (#1718) * Update generated code for v1097 * Update generated code for v1105 * Update generated code for v1111 * Update generated code for v1112 * Update generated code for v1113 * Update generated code for v1115 * Update generated code for v1116 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/Billing/MeterEventSummary.php | 4 +- lib/Customer.php | 2 +- lib/CustomerSession.php | 14 +++---- lib/ErrorObject.php | 1 + lib/Invoice.php | 51 ++++++++++++++++++++++++++ lib/Service/CustomerSessionService.php | 2 +- lib/Service/InvoiceService.php | 51 ++++++++++++++++++++++++++ lib/Tax/Transaction.php | 1 + lib/Terminal/Configuration.php | 1 + 10 files changed, 117 insertions(+), 12 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index eb43ae0c9..dbdf3c1cb 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1095 \ No newline at end of file +v1116 \ No newline at end of file diff --git a/lib/Billing/MeterEventSummary.php b/lib/Billing/MeterEventSummary.php index bac4e3b32..e56ada7fd 100644 --- a/lib/Billing/MeterEventSummary.php +++ b/lib/Billing/MeterEventSummary.php @@ -11,10 +11,10 @@ * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property float $aggregated_value Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via default_aggregation. - * @property int $end_time End timestamp for this event summary (inclusive). + * @property int $end_time End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. * @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 string $meter The meter associated with this event summary. - * @property int $start_time Start timestamp for this event summary (inclusive). + * @property int $start_time Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. */ class MeterEventSummary extends \Stripe\ApiResource { diff --git a/lib/Customer.php b/lib/Customer.php index 00ef44342..ef337f701 100644 --- a/lib/Customer.php +++ b/lib/Customer.php @@ -27,7 +27,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|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. - * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). + * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. * @property null|string $phone The customer's phone number. * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. diff --git a/lib/CustomerSession.php b/lib/CustomerSession.php index 6c4db5d72..52ffe1814 100644 --- a/lib/CustomerSession.php +++ b/lib/CustomerSession.php @@ -5,15 +5,15 @@ namespace Stripe; /** - * A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) - * control over a customer. + * A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access + * control over a Customer. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $client_secret

The client secret of this customer session. Used on the client to set up secure access to the given customer.

The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.

- * @property null|\Stripe\StripeObject $components Configuration for the components supported by this customer session. + * @property string $client_secret

The client secret of this Customer Session. Used on the client to set up secure access to the given customer.

The client secret can be used to provide access to customer from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.

+ * @property null|\Stripe\StripeObject $components Configuration for the components supported by this Customer Session. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string|\Stripe\Customer $customer The customer the customer session was created for. - * @property int $expires_at The timestamp at which this customer session will expire. + * @property string|\Stripe\Customer $customer The Customer the Customer Session was created for. + * @property int $expires_at The timestamp at which this Customer Session will expire. * @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. */ class CustomerSession extends ApiResource @@ -21,7 +21,7 @@ class CustomerSession extends ApiResource const OBJECT_NAME = 'customer_session'; /** - * Creates a customer session object that includes a single-use client secret that + * Creates a Customer Session object that includes a single-use client secret that * you can use on your front-end to grant client-side API access for certain * customer resources. * diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php index 461130e87..47ffa0cbe 100644 --- a/lib/ErrorObject.php +++ b/lib/ErrorObject.php @@ -143,6 +143,7 @@ class ErrorObject extends StripeObject const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive'; const CODE_PAYMENT_INTENT_ACTION_REQUIRED = 'payment_intent_action_required'; const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure'; + const CODE_PAYMENT_INTENT_FX_QUOTE_INVALID = 'payment_intent_fx_quote_invalid'; const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method'; const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter'; const CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER = 'payment_intent_konbini_rejected_confirmation_number'; diff --git a/lib/Invoice.php b/lib/Invoice.php index d054acf38..499848796 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -271,6 +271,23 @@ public static function update($id, $params = null, $opts = null) const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; const BILLING_SEND_INVOICE = 'send_invoice'; + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the added invoice + */ + public function addLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/add_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts @@ -340,6 +357,23 @@ public function pay($params = null, $opts = null) return $this; } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the removed invoice + */ + public function removeLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/remove_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts @@ -393,6 +427,23 @@ public static function upcomingLines($params = null, $opts = null) return $obj; } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the updated invoice + */ + public function updateLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/update_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/Service/CustomerSessionService.php b/lib/Service/CustomerSessionService.php index 7b2d76f20..d3b0d685d 100644 --- a/lib/Service/CustomerSessionService.php +++ b/lib/Service/CustomerSessionService.php @@ -11,7 +11,7 @@ class CustomerSessionService extends \Stripe\Service\AbstractService { /** - * Creates a customer session object that includes a single-use client secret that + * Creates a Customer Session object that includes a single-use client secret that * you can use on your front-end to grant client-side API access for certain * customer resources. * diff --git a/lib/Service/InvoiceService.php b/lib/Service/InvoiceService.php index 1053b5a8f..a5cbd2228 100644 --- a/lib/Service/InvoiceService.php +++ b/lib/Service/InvoiceService.php @@ -10,6 +10,23 @@ */ class InvoiceService extends \Stripe\Service\AbstractService { + /** + * Adds multiple line items to an invoice. This is only possible when an invoice is + * still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function addLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/add_lines', $id), $params, $opts); + } + /** * You can list all invoices, or list the invoices for a specific customer. The * invoices are returned sorted by creation date, with the most recently created @@ -177,6 +194,23 @@ public function pay($id, $params = null, $opts = null) return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); } + /** + * Removes multiple line items from an invoice. This is only possible when an + * invoice is still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function removeLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/remove_lines', $id), $params, $opts); + } + /** * Retrieves the invoice with the given ID. * @@ -338,6 +372,23 @@ public function updateLine($parentId, $id, $params = null, $opts = null) return $this->request('post', $this->buildPath('/v1/invoices/%s/lines/%s', $parentId, $id), $params, $opts); } + /** + * Updates multiple line items on an invoice. This is only possible when an invoice + * is still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function updateLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/update_lines', $id), $params, $opts); + } + /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is * similar to deletion, however it only applies to diff --git a/lib/Tax/Transaction.php b/lib/Tax/Transaction.php index 7a6343a2b..13304b8ec 100644 --- a/lib/Tax/Transaction.php +++ b/lib/Tax/Transaction.php @@ -18,6 +18,7 @@ * @property null|\Stripe\Collection<\Stripe\Tax\TransactionLineItem> $line_items The tax collected or refunded, by line item. * @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 $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property int $posted_at The Unix timestamp representing when the tax liability is assumed or reduced. * @property string $reference A custom unique identifier, such as 'myOrder_123'. * @property null|\Stripe\StripeObject $reversal If type=reversal, contains information about what was reversed. * @property null|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address. 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 ce69d019941cf528c036ae0d1a3a9580c7389460 Mon Sep 17 00:00:00 2001 From: Prathmesh Ranaut Date: Fri, 5 Jul 2024 14:52:07 -0400 Subject: [PATCH 2/5] Bump version to 15.1.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cae0d1df4..23e7a4a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 15.1.0 - 2024-07-05 +* [#1718](https://github.com/stripe/stripe-php/pull/1718) Update generated code + * Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice` + * Add support for new value `payment_intent_fx_quote_invalid` on enum `StripeError.code` + * Add support for new values `multibanco`, `twint`, and `zip` on enum `PaymentLink.payment_method_types[]` + * Add support for `posted_at` on `Tax.Transaction` + * Add support for `reboot_window` on `Terminal.Configuration` + ## 15.0.0 - 2024-06-24 * [#1714](https://github.com/stripe/stripe-php/pull/1714) diff --git a/VERSION b/VERSION index 94188a748..d14dfbac3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.0.0 +15.1.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index 4f5d81405..29ce2a72c 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 = '15.0.0'; + const VERSION = '15.1.0'; /** * @return string the API key used for requests From ade4886a815fae6e37c1fb0061b1f7b444bff797 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:25:19 +0000 Subject: [PATCH 3/5] Update generated code for v1117 --- OPENAPI_VERSION | 2 +- lib/ErrorObject.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dbdf3c1cb..c24fb8a2b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1116 \ No newline at end of file +v1117 \ No newline at end of file diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php index fb65eb65f..360cde043 100644 --- a/lib/ErrorObject.php +++ b/lib/ErrorObject.php @@ -66,10 +66,6 @@ class ErrorObject extends StripeObject const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified'; const CODE_BANK_ACCOUNT_VERIFICATION_FAILED = 'bank_account_verification_failed'; const CODE_BILLING_INVALID_MANDATE = 'billing_invalid_mandate'; - const CODE_BILLING_POLICY_REMOTE_FUNCTION_RESPONSE_INVALID = 'billing_policy_remote_function_response_invalid'; - const CODE_BILLING_POLICY_REMOTE_FUNCTION_TIMEOUT = 'billing_policy_remote_function_timeout'; - const CODE_BILLING_POLICY_REMOTE_FUNCTION_UNEXPECTED_STATUS_CODE = 'billing_policy_remote_function_unexpected_status_code'; - const CODE_BILLING_POLICY_REMOTE_FUNCTION_UNREACHABLE = 'billing_policy_remote_function_unreachable'; const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required'; const CODE_CAPTURE_CHARGE_AUTHORIZATION_EXPIRED = 'capture_charge_authorization_expired'; const CODE_CAPTURE_UNAUTHORIZED_PAYMENT = 'capture_unauthorized_payment'; From bc310357a9fa8db3cabf814cd03fbdc98d0080b7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:02:06 +0000 Subject: [PATCH 4/5] Update generated code for v1120 --- OPENAPI_VERSION | 2 +- lib/ErrorObject.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c24fb8a2b..9ad4fa2a1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1117 \ No newline at end of file +v1120 \ No newline at end of file diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php index 360cde043..31e1c294b 100644 --- a/lib/ErrorObject.php +++ b/lib/ErrorObject.php @@ -143,7 +143,6 @@ class ErrorObject extends StripeObject const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive'; const CODE_PAYMENT_INTENT_ACTION_REQUIRED = 'payment_intent_action_required'; const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure'; - const CODE_PAYMENT_INTENT_FX_QUOTE_INVALID = 'payment_intent_fx_quote_invalid'; const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method'; const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter'; const CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER = 'payment_intent_konbini_rejected_confirmation_number'; From f0a12f6ca9fabf72660a0256ed2e3a37994862db Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:19:52 +0000 Subject: [PATCH 5/5] Update generated code for v1121 --- OPENAPI_VERSION | 2 +- lib/BillingPortal/Session.php | 2 +- lib/FinancialConnections/Institution.php | 6 +++--- lib/Service/SubscriptionService.php | 11 +++++++---- lib/Subscription.php | 11 +++++++---- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9ad4fa2a1..46c919fc1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1120 \ No newline at end of file +v1121 \ No newline at end of file diff --git a/lib/BillingPortal/Session.php b/lib/BillingPortal/Session.php index a6554278c..a94d5f9af 100644 --- a/lib/BillingPortal/Session.php +++ b/lib/BillingPortal/Session.php @@ -18,7 +18,7 @@ * Create sessions on-demand when customers intend to manage their subscriptions * and billing details. * - * Learn more in the integration guide. + * Related guide: Customer management * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. diff --git a/lib/FinancialConnections/Institution.php b/lib/FinancialConnections/Institution.php index 656d2ba87..cf270a5c8 100644 --- a/lib/FinancialConnections/Institution.php +++ b/lib/FinancialConnections/Institution.php @@ -5,16 +5,16 @@ namespace Stripe\FinancialConnections; /** - * An institution represents a banking institution which may be available for an end user to select in the Financial Connections authentication flow. + * An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property \Stripe\StripeObject $features * @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 string $name The name of this institution. - * @property string[] $routing_numbers A list of routing numbers which are known to correspond to this institution. + * @property string[] $routing_numbers A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions. * @property string $status The status of this institution in the Financial Connections authentication flow. - * @property null|string $url The URL for this institution's website. + * @property null|string $url A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution. */ class Institution extends \Stripe\ApiResource { diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php index ba7dcc729..fae6df831 100644 --- a/lib/Service/SubscriptionService.php +++ b/lib/Service/SubscriptionService.php @@ -162,8 +162,8 @@ public function search($params = null, $opts = null) * Updates an existing subscription to match the specified parameters. When * changing prices or quantities, we optionally prorate the price we charge next * month to make up for any price changes. To preview how the proration is - * calculated, use the upcoming invoice - * endpoint. + * calculated, use the create + * preview endpoint. * * By default, we prorate subscription changes. For example, if a customer signs up * on May 1 for a 100 price, they’ll be billed @@ -179,11 +179,14 @@ public function search($params = null, $opts = null) * immediate charge unless: * * + * yearly).
  • The subscription moves from free to paid.
  • A trial + * starts or ends.
  • * * In these cases, we apply a credit for the unused time on the previous price, * immediately charge the customer using the new price, and reset the billing date. + * Learn about how Stripe + * immediately attempts payment for subscription changes. * * If you want to charge for an upgrade immediately, pass * proration_behavior as always_invoice to create diff --git a/lib/Subscription.php b/lib/Subscription.php index 2fa86ae33..75230305c 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -150,8 +150,8 @@ public static function retrieve($id, $opts = null) * Updates an existing subscription to match the specified parameters. When * changing prices or quantities, we optionally prorate the price we charge next * month to make up for any price changes. To preview how the proration is - * calculated, use the upcoming invoice - * endpoint. + * calculated, use the create + * preview endpoint. * * By default, we prorate subscription changes. For example, if a customer signs up * on May 1 for a 100 price, they’ll be billed @@ -167,11 +167,14 @@ public static function retrieve($id, $opts = null) * immediate charge unless: * * + * yearly).
  • The subscription moves from free to paid.
  • A trial + * starts or ends.
  • * * In these cases, we apply a credit for the unused time on the previous price, * immediately charge the customer using the new price, and reset the billing date. + * Learn about how Stripe + * immediately attempts payment for subscription changes. * * If you want to charge for an upgrade immediately, pass * proration_behavior as always_invoice to create