diff --git a/CHANGELOG.md b/CHANGELOG.md index 24daafc57..59f50262d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,25 @@ # Changelog +## 15.4.0 - 2024-07-25 +* [#1726](https://github.com/stripe/stripe-php/pull/1726) Update generated code + * Add support for `update` method on resource `Checkout.Session` + * Add support for new values `invoice.overdue` and `invoice.will_be_due` on enum `Event.type` + * Add support for `twint` on `PaymentMethodConfiguration` + +## 15.3.0 - 2024-07-18 +* [#1724](https://github.com/stripe/stripe-php/pull/1724) Update generated code + * Add support for new value `issuing_dispute.funds_rescinded` on enum `Event.type` + * Add support for new value `stripe_s700` on enum `Terminal.Reader.device_type` +* [#1722](https://github.com/stripe/stripe-php/pull/1722) Update changelog + ## 15.3.0-beta.1 - 2024-07-11 * [#1720](https://github.com/stripe/stripe-php/pull/1720) Update generated code for beta +## 15.2.0 - 2024-07-11 +* [#1721](https://github.com/stripe/stripe-php/pull/1721) Update generated code + * ⚠️ Remove support for values `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, and `billing_policy_remote_function_unreachable` from enum `StripeError.code`. + * ⚠️ Remove support for value `payment_intent_fx_quote_invalid` from enum `StripeError.code`. The was mistakenly released last week. + * Add support for `payment_method_options` on `ConfirmationToken` ## 15.2.0-beta.1 - 2024-07-05 * [#1719](https://github.com/stripe/stripe-php/pull/1719) Update generated code for beta diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 46c919fc1..0560d3ff7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1121 \ No newline at end of file +v1157 \ No newline at end of file diff --git a/init.php b/init.php index d90169cc4..8b12bca38 100644 --- a/init.php +++ b/init.php @@ -94,6 +94,8 @@ require __DIR__ . '/lib/Balance.php'; require __DIR__ . '/lib/BalanceTransaction.php'; require __DIR__ . '/lib/BankAccount.php'; +require __DIR__ . '/lib/Billing/Alert.php'; +require __DIR__ . '/lib/Billing/AlertTriggered.php'; require __DIR__ . '/lib/Billing/Meter.php'; require __DIR__ . '/lib/Billing/MeterEvent.php'; require __DIR__ . '/lib/Billing/MeterEventAdjustment.php'; @@ -197,6 +199,7 @@ require __DIR__ . '/lib/Service/Apps/SecretService.php'; require __DIR__ . '/lib/Service/BalanceService.php'; require __DIR__ . '/lib/Service/BalanceTransactionService.php'; +require __DIR__ . '/lib/Service/Billing/AlertService.php'; require __DIR__ . '/lib/Service/Billing/BillingServiceFactory.php'; require __DIR__ . '/lib/Service/Billing/MeterEventAdjustmentService.php'; require __DIR__ . '/lib/Service/Billing/MeterEventService.php'; @@ -289,6 +292,7 @@ require __DIR__ . '/lib/Service/SubscriptionItemService.php'; require __DIR__ . '/lib/Service/SubscriptionScheduleService.php'; require __DIR__ . '/lib/Service/SubscriptionService.php'; +require __DIR__ . '/lib/Service/Tax/AssociationService.php'; require __DIR__ . '/lib/Service/Tax/CalculationService.php'; require __DIR__ . '/lib/Service/Tax/FormService.php'; require __DIR__ . '/lib/Service/Tax/RegistrationService.php'; @@ -346,6 +350,7 @@ require __DIR__ . '/lib/Subscription.php'; require __DIR__ . '/lib/SubscriptionItem.php'; require __DIR__ . '/lib/SubscriptionSchedule.php'; +require __DIR__ . '/lib/Tax/Association.php'; require __DIR__ . '/lib/Tax/Calculation.php'; require __DIR__ . '/lib/Tax/CalculationLineItem.php'; require __DIR__ . '/lib/Tax/Form.php'; diff --git a/lib/AccountNotice.php b/lib/AccountNotice.php index 5727b59f3..94e1571a1 100644 --- a/lib/AccountNotice.php +++ b/lib/AccountNotice.php @@ -27,6 +27,9 @@ class AccountNotice extends ApiResource use ApiOperations\Update; const REASON_ISSUING_ACCOUNT_CLOSED_FOR_INACTIVITY = 'issuing.account_closed_for_inactivity'; + const REASON_ISSUING_ACCOUNT_CLOSED_FOR_NOT_PROVIDING_BUSINESS_MODEL_CLARIFICATION = 'issuing.account_closed_for_not_providing_business_model_clarification'; + const REASON_ISSUING_ACCOUNT_CLOSED_FOR_NOT_PROVIDING_URL_CLARIFICATION = 'issuing.account_closed_for_not_providing_url_clarification'; + const REASON_ISSUING_ACCOUNT_CLOSED_FOR_NOT_PROVIDING_USE_CASE_CLARIFICATION = 'issuing.account_closed_for_not_providing_use_case_clarification'; const REASON_ISSUING_ACCOUNT_CLOSED_FOR_TERMS_OF_SERVICE_VIOLATION = 'issuing.account_closed_for_terms_of_service_violation'; const REASON_ISSUING_APPLICATION_REJECTED_FOR_FAILURE_TO_VERIFY = 'issuing.application_rejected_for_failure_to_verify'; const REASON_ISSUING_CREDIT_APPLICATION_REJECTED = 'issuing.credit_application_rejected'; diff --git a/lib/Billing/Alert.php b/lib/Billing/Alert.php new file mode 100644 index 000000000..5846efb1a --- /dev/null +++ b/lib/Billing/Alert.php @@ -0,0 +1,135 @@ +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|string $status Status of the alert. This can be active, inactive or archived. + * @property string $title Title of the alert. + * @property null|\Stripe\StripeObject $usage_threshold_config Encapsulates configuration of the alert to monitor usage on a specific Billing Meter. + */ +class Alert extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing.alert'; + + const STATUS_ACTIVE = 'active'; + const STATUS_ARCHIVED = 'archived'; + const STATUS_INACTIVE = 'inactive'; + + /** + * Creates a billing alert. + * + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert the created resource + */ + public static function create($params = null, $options = null) + { + self::_validateParams($params); + $url = static::classUrl(); + + list($response, $opts) = static::_staticRequest('post', $url, $params, $options); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * Lists billing active and inactive alerts. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Billing\Alert> of ApiResources + */ + public static function all($params = null, $opts = null) + { + $url = static::classUrl(); + + return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); + } + + /** + * Retrieves a billing alert given an ID. + * + * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert + */ + public static function retrieve($id, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + $instance = new static($id, $opts); + $instance->refresh(); + + return $instance; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert the activated alert + */ + public function activate($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/activate'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert the archived alert + */ + public function archive($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/archive'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert the deactivated alert + */ + public function deactivate($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/deactivate'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/lib/Billing/AlertTriggered.php b/lib/Billing/AlertTriggered.php new file mode 100644 index 000000000..04bae44d0 --- /dev/null +++ b/lib/Billing/AlertTriggered.php @@ -0,0 +1,18 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $value The value triggering the alert + */ +class AlertTriggered extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing.alert_triggered'; +} diff --git a/lib/Charge.php b/lib/Charge.php index 7c4a47fdc..5198a9997 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -21,7 +21,7 @@ * @property null|string $authorization_code Authorization code on the charge. * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). * @property \Stripe\StripeObject $billing_details - * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This only works for card payments. * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index b66c1ead8..d2a05afc1 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -80,6 +80,8 @@ class Session extends \Stripe\ApiResource { const OBJECT_NAME = 'checkout.session'; + use \Stripe\ApiOperations\Update; + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; @@ -171,6 +173,29 @@ public static function retrieve($id, $opts = null) return $instance; } + /** + * Updates a Session object. + * + * @param string $id the ID of the resource to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session the updated resource + */ + public static function update($id, $params = null, $opts = null) + { + self::_validateParams($params); + $url = static::resourceUrl($id); + + list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/Event.php b/lib/Event.php index 50f3eb26c..3c2e884b2 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -67,6 +67,7 @@ class Event extends ApiResource const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; const BALANCE_AVAILABLE = 'balance.available'; + const BILLING_ALERT_TRIGGERED = 'billing.alert.triggered'; const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; @@ -160,6 +161,7 @@ class Event extends ApiResource const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; const INVOICE_FINALIZED = 'invoice.finalized'; const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const INVOICE_OVERDUE = 'invoice.overdue'; const INVOICE_PAID = 'invoice.paid'; const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; @@ -169,6 +171,7 @@ class Event extends ApiResource const INVOICE_UPCOMING = 'invoice.upcoming'; const INVOICE_UPDATED = 'invoice.updated'; const INVOICE_VOIDED = 'invoice.voided'; + const INVOICE_WILL_BE_DUE = 'invoice.will_be_due'; const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; @@ -179,6 +182,7 @@ class Event extends ApiResource const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; + const ISSUING_DISPUTE_FUNDS_RESCINDED = 'issuing_dispute.funds_rescinded'; const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; const ISSUING_PERSONALIZATION_DESIGN_ACTIVATED = 'issuing_personalization_design.activated'; @@ -326,6 +330,7 @@ class Event extends ApiResource const TYPE_APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; const TYPE_APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; const TYPE_BALANCE_AVAILABLE = 'balance.available'; + const TYPE_BILLING_ALERT_TRIGGERED = 'billing.alert.triggered'; const TYPE_BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; const TYPE_BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; const TYPE_BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; @@ -419,6 +424,7 @@ class Event extends ApiResource const TYPE_INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; const TYPE_INVOICE_FINALIZED = 'invoice.finalized'; const TYPE_INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const TYPE_INVOICE_OVERDUE = 'invoice.overdue'; const TYPE_INVOICE_PAID = 'invoice.paid'; const TYPE_INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; const TYPE_INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; @@ -428,6 +434,7 @@ class Event extends ApiResource const TYPE_INVOICE_UPCOMING = 'invoice.upcoming'; const TYPE_INVOICE_UPDATED = 'invoice.updated'; const TYPE_INVOICE_VOIDED = 'invoice.voided'; + const TYPE_INVOICE_WILL_BE_DUE = 'invoice.will_be_due'; const TYPE_ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; const TYPE_ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; const TYPE_ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; @@ -438,6 +445,7 @@ class Event extends ApiResource const TYPE_ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; const TYPE_ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; const TYPE_ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; + const TYPE_ISSUING_DISPUTE_FUNDS_RESCINDED = 'issuing_dispute.funds_rescinded'; const TYPE_ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; const TYPE_ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; const TYPE_ISSUING_PERSONALIZATION_DESIGN_ACTIVATED = 'issuing_personalization_design.activated'; @@ -595,8 +603,8 @@ public static function all($params = null, $opts = null) } /** - * Retrieves the details of an event. Supply the unique identifier of the event, - * which you might have received in a webhook. + * Retrieves the details of an event if it was created in the last 30 days. Supply + * the unique identifier of the event, which you might have received in a webhook. * * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key * @param null|array|string $opts diff --git a/lib/Identity/VerificationReport.php b/lib/Identity/VerificationReport.php index 77fa02c68..6ecfa3f0d 100644 --- a/lib/Identity/VerificationReport.php +++ b/lib/Identity/VerificationReport.php @@ -15,7 +15,7 @@ * API. To configure and create VerificationReports, use the * VerificationSession API. * - * Related guides: Accessing verification results. + * Related guide: Accessing verification results. * * @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/InvoicePayment.php b/lib/InvoicePayment.php index bee30277b..f097437fe 100644 --- a/lib/InvoicePayment.php +++ b/lib/InvoicePayment.php @@ -12,13 +12,12 @@ * @property null|int $amount_overpaid Excess payment that was received for this invoice and credited to the customer’s invoice_credit_balance. This field is null until the payment is paid. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more. * @property null|int $amount_paid Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is paid. This amount can be less than the amount_requested if the PaymentIntent’s amount_received is not sufficient to pay all of the invoices that it is attached to. * @property int $amount_requested Amount intended to be paid toward this invoice, in cents (or local equivalent) - * @property null|string|\Stripe\Charge $charge ID of the successful charge for this payment. This field is null when the payment is open or canceled. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string|\Stripe\Invoice $invoice The invoice that was paid. * @property null|bool $is_default Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s amount_remaining. The PaymentIntent associated with the default payment can’t be edited or canceled directly. * @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|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this payment. Note: This property is only populated for invoices finalized on or after March 15th, 2019. + * @property \Stripe\StripeObject $payment * @property string $status The status of the payment, one of open, paid, or canceled. * @property \Stripe\StripeObject $status_transitions */ diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index 9d6cf0e5b..ec2dffcc6 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -25,6 +25,7 @@ * @property int $amount_received Amount that this PaymentIntent collects. * @property null|string|\Stripe\Application $application ID of the Connect application that created the PaymentIntent. * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. + * @property null|\Stripe\StripeObject $async_workflows * @property null|\Stripe\StripeObject $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). @@ -37,7 +38,7 @@ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. * @property null|\Stripe\StripeObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. - * @property null|string|\Stripe\Charge $latest_charge The latest charge created by this PaymentIntent. + * @property null|string|\Stripe\Charge $latest_charge ID of the latest Charge object created by this PaymentIntent. This property is null until PaymentIntent confirmation is attempted. * @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 \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. Learn more about storing information in metadata. * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. diff --git a/lib/PaymentMethodConfiguration.php b/lib/PaymentMethodConfiguration.php index ec8d60e8d..6a79b7570 100644 --- a/lib/PaymentMethodConfiguration.php +++ b/lib/PaymentMethodConfiguration.php @@ -59,11 +59,13 @@ * @property null|string $parent For child configs, the configuration's parent configuration. * @property null|\Stripe\StripeObject $paynow * @property null|\Stripe\StripeObject $paypal + * @property null|\Stripe\StripeObject $payto * @property null|\Stripe\StripeObject $promptpay * @property null|\Stripe\StripeObject $revolut_pay * @property null|\Stripe\StripeObject $sepa_debit * @property null|\Stripe\StripeObject $sofort * @property null|\Stripe\StripeObject $swish + * @property null|\Stripe\StripeObject $twint * @property null|\Stripe\StripeObject $us_bank_account * @property null|\Stripe\StripeObject $wechat_pay * @property null|\Stripe\StripeObject $zip diff --git a/lib/PaymentMethodDomain.php b/lib/PaymentMethodDomain.php index 2121adcc0..810ccb4de 100644 --- a/lib/PaymentMethodDomain.php +++ b/lib/PaymentMethodDomain.php @@ -8,7 +8,7 @@ * A payment method domain represents a web domain that you have registered with Stripe. * Stripe Elements use registered payment method domains to control where certain payment methods are shown. * - * Related guides: Payment method domains. + * Related guide: Payment method domains. * * @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/QuotePreviewInvoice.php b/lib/QuotePreviewInvoice.php index 5c04178f4..bd1024f35 100644 --- a/lib/QuotePreviewInvoice.php +++ b/lib/QuotePreviewInvoice.php @@ -105,7 +105,7 @@ * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. + * @property null|string|\Stripe\Subscription $subscription * @property null|\Stripe\StripeObject $subscription_details Details about the subscription that created this invoice. * @property null|int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated diff --git a/lib/Refund.php b/lib/Refund.php index 039d3b602..9e59f8c68 100644 --- a/lib/Refund.php +++ b/lib/Refund.php @@ -89,7 +89,7 @@ public static function create($params = null, $options = null) /** * Returns a list of all refunds you created. We return the refunds in sorted - * order, with the most recent refunds appearing first The 10 most recent refunds + * order, with the most recent refunds appearing first. The 10 most recent refunds * are always available by default on the Charge object. * * @param null|array $params diff --git a/lib/Service/Billing/AlertService.php b/lib/Service/Billing/AlertService.php new file mode 100644 index 000000000..8baafb1bf --- /dev/null +++ b/lib/Service/Billing/AlertService.php @@ -0,0 +1,107 @@ +request('post', $this->buildPath('/v1/billing/alerts/%s/activate', $id), $params, $opts); + } + + /** + * Lists billing active and inactive alerts. + * + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Billing\Alert> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/billing/alerts', $params, $opts); + } + + /** + * Archives this alert, removing it from the list view and APIs. This is + * non-reversible. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert + */ + public function archive($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing/alerts/%s/archive', $id), $params, $opts); + } + + /** + * Creates a billing alert. + * + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/billing/alerts', $params, $opts); + } + + /** + * Deactivates this alert, preventing it from triggering. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert + */ + public function deactivate($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing/alerts/%s/deactivate', $id), $params, $opts); + } + + /** + * Retrieves a billing alert given an ID. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Billing\Alert + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/billing/alerts/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/Billing/BillingServiceFactory.php b/lib/Service/Billing/BillingServiceFactory.php index 234dd822c..809febe62 100644 --- a/lib/Service/Billing/BillingServiceFactory.php +++ b/lib/Service/Billing/BillingServiceFactory.php @@ -7,6 +7,7 @@ /** * Service factory class for API resources in the Billing namespace. * + * @property AlertService $alerts * @property MeterEventAdjustmentService $meterEventAdjustments * @property MeterEventService $meterEvents * @property MeterService $meters @@ -17,6 +18,7 @@ class BillingServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'alerts' => AlertService::class, 'meterEventAdjustments' => MeterEventAdjustmentService::class, 'meterEvents' => MeterEventService::class, 'meters' => MeterService::class, diff --git a/lib/Service/Checkout/SessionService.php b/lib/Service/Checkout/SessionService.php index bed354656..c419a5050 100644 --- a/lib/Service/Checkout/SessionService.php +++ b/lib/Service/Checkout/SessionService.php @@ -93,4 +93,20 @@ public function retrieve($id, $params = null, $opts = null) { return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); } + + /** + * Updates a Session object. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); + } } diff --git a/lib/Service/EventService.php b/lib/Service/EventService.php index 0901293af..7b02e408f 100644 --- a/lib/Service/EventService.php +++ b/lib/Service/EventService.php @@ -30,8 +30,8 @@ public function all($params = null, $opts = null) } /** - * Retrieves the details of an event. Supply the unique identifier of the event, - * which you might have received in a webhook. + * Retrieves the details of an event if it was created in the last 30 days. Supply + * the unique identifier of the event, which you might have received in a webhook. * * @param string $id * @param null|array $params diff --git a/lib/Service/RefundService.php b/lib/Service/RefundService.php index d8dcef2be..f86b20905 100644 --- a/lib/Service/RefundService.php +++ b/lib/Service/RefundService.php @@ -12,7 +12,7 @@ class RefundService extends \Stripe\Service\AbstractService { /** * Returns a list of all refunds you created. We return the refunds in sorted - * order, with the most recent refunds appearing first The 10 most recent refunds + * order, with the most recent refunds appearing first. The 10 most recent refunds * are always available by default on the Charge object. * * @param null|array $params diff --git a/lib/Service/Tax/AssociationService.php b/lib/Service/Tax/AssociationService.php new file mode 100644 index 000000000..95307cab5 --- /dev/null +++ b/lib/Service/Tax/AssociationService.php @@ -0,0 +1,27 @@ +request('get', '/v1/tax/associations/find', $params, $opts); + } +} diff --git a/lib/Service/Tax/TaxServiceFactory.php b/lib/Service/Tax/TaxServiceFactory.php index f0f33d853..3965b641f 100644 --- a/lib/Service/Tax/TaxServiceFactory.php +++ b/lib/Service/Tax/TaxServiceFactory.php @@ -7,6 +7,7 @@ /** * Service factory class for API resources in the Tax namespace. * + * @property AssociationService $associations * @property CalculationService $calculations * @property FormService $forms * @property RegistrationService $registrations @@ -19,6 +20,7 @@ class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'associations' => AssociationService::class, 'calculations' => CalculationService::class, 'forms' => FormService::class, 'registrations' => RegistrationService::class, diff --git a/lib/Tax/Association.php b/lib/Tax/Association.php new file mode 100644 index 000000000..abe07dff7 --- /dev/null +++ b/lib/Tax/Association.php @@ -0,0 +1,23 @@ +Tax Calculation that was included in PaymentIntent. + * @property string $payment_intent The PaymentIntent that this Tax Association is tracking. + * @property string $status Status of the Tax Association. + * @property \Stripe\StripeObject $status_details + */ +class Association extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'tax.association'; + + const STATUS_COMMITTED = 'committed'; + const STATUS_ERRORED = 'errored'; +} diff --git a/lib/Tax/Calculation.php b/lib/Tax/Calculation.php index d9155267d..26d9890ad 100644 --- a/lib/Tax/Calculation.php +++ b/lib/Tax/Calculation.php @@ -11,7 +11,7 @@ * * @property null|string $id Unique identifier for the calculation. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount_total Total after taxes. + * @property int $amount_total Total amount after taxes in the smallest currency unit. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $customer The ID of an existing Customer used for the resource. * @property \Stripe\StripeObject $customer_details diff --git a/lib/Terminal/Reader.php b/lib/Terminal/Reader.php index 497fc81bc..97a33ac28 100644 --- a/lib/Terminal/Reader.php +++ b/lib/Terminal/Reader.php @@ -13,7 +13,7 @@ * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\StripeObject $action The most recent action performed by the reader. * @property null|string $device_sw_version The current software version of the reader. - * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, simulated_wisepos_e, or mobile_phone_reader. + * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, stripe_s700, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, simulated_wisepos_e, or mobile_phone_reader. * @property null|string $ip_address The local IP address of the reader. * @property string $label Custom label given to the reader for easier identification. * @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. @@ -34,6 +34,7 @@ class Reader extends \Stripe\ApiResource const DEVICE_TYPE_MOBILE_PHONE_READER = 'mobile_phone_reader'; const DEVICE_TYPE_SIMULATED_WISEPOS_E = 'simulated_wisepos_e'; const DEVICE_TYPE_STRIPE_M2 = 'stripe_m2'; + const DEVICE_TYPE_STRIPE_S700 = 'stripe_s700'; const DEVICE_TYPE_VERIFONE_P400 = 'verifone_P400'; const STATUS_OFFLINE = 'offline'; diff --git a/lib/Treasury/FinancialAccount.php b/lib/Treasury/FinancialAccount.php index f72f533ea..0cccf05d3 100644 --- a/lib/Treasury/FinancialAccount.php +++ b/lib/Treasury/FinancialAccount.php @@ -14,6 +14,7 @@ * @property \Stripe\StripeObject $balance Balance information for the FinancialAccount * @property string $country Two-letter country code (ISO 3166-1 alpha-2). * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $display_name The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the nickname field, display_name is not internal metadata and will be exposed to connected accounts. * @property null|\Stripe\Treasury\FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a status enum and associated status_details. Stripe or the platform can control Features via the requested field. * @property \Stripe\StripeObject[] $financial_addresses The set of credentials that resolve to a FinancialAccount. * @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. diff --git a/lib/Util/ApiVersion.php b/lib/Util/ApiVersion.php index 481a81dcd..59fc3e38e 100644 --- a/lib/Util/ApiVersion.php +++ b/lib/Util/ApiVersion.php @@ -7,5 +7,5 @@ class ApiVersion { const CURRENT = '2024-06-20'; - const PREVIEW = '2024-05-23.preview-v2'; + const PREVIEW = '2024-07-16.preview-v2'; } diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 8fe1b0d05..d679a96db 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -26,6 +26,8 @@ class ObjectTypes \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\Billing\Alert::OBJECT_NAME => \Stripe\Billing\Alert::class, + \Stripe\Billing\AlertTriggered::OBJECT_NAME => \Stripe\Billing\AlertTriggered::class, \Stripe\Billing\Meter::OBJECT_NAME => \Stripe\Billing\Meter::class, \Stripe\Billing\MeterEvent::OBJECT_NAME => \Stripe\Billing\MeterEvent::class, \Stripe\Billing\MeterEventAdjustment::OBJECT_NAME => \Stripe\Billing\MeterEventAdjustment::class, @@ -129,6 +131,7 @@ class ObjectTypes \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\Tax\Association::OBJECT_NAME => \Stripe\Tax\Association::class, \Stripe\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class, \Stripe\Tax\CalculationLineItem::OBJECT_NAME => \Stripe\Tax\CalculationLineItem::class, \Stripe\Tax\Form::OBJECT_NAME => \Stripe\Tax\Form::class,