From 0cfa628ca9dce400b063478e911c995f6bbf579e Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 19:23:27 +0000 Subject: [PATCH 01/10] Update generated code (#1654) * Update generated code for v840 * Update generated code for v841 * Update generated code for v849 * Update generated code for v851 * Update generated code for v852 * Update generated code for v853 * Update generated code for v855 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- init.php | 6 +++++ lib/Application.php | 15 ++++++++++++ lib/ApplicationFee.php | 2 +- lib/BalanceTransaction.php | 2 +- lib/BankAccount.php | 2 +- lib/BillingPortal/Configuration.php | 2 +- lib/Capability.php | 4 ++-- lib/Charge.php | 34 +++++++++++++++++++++++++++- lib/Checkout/Session.php | 10 ++++---- lib/ConnectCollectionTransfer.php | 18 +++++++++++++++ lib/Identity/VerificationReport.php | 2 +- lib/Identity/VerificationSession.php | 2 +- lib/Invoice.php | 2 +- lib/PaymentIntent.php | 2 +- lib/PaymentLink.php | 6 ++--- lib/Person.php | 6 ++--- lib/PlatformTaxFee.php | 17 ++++++++++++++ lib/Quote.php | 2 +- lib/ReserveTransaction.php | 17 ++++++++++++++ lib/SetupAttempt.php | 2 +- lib/SetupIntent.php | 2 +- lib/SourceMandateNotification.php | 28 +++++++++++++++++++++++ lib/Subscription.php | 2 +- lib/SubscriptionSchedule.php | 2 +- lib/TaxDeductedAtSource.php | 17 ++++++++++++++ lib/Util/ObjectTypes.php | 6 +++++ 27 files changed, 184 insertions(+), 28 deletions(-) create mode 100644 lib/Application.php create mode 100644 lib/ConnectCollectionTransfer.php create mode 100644 lib/PlatformTaxFee.php create mode 100644 lib/ReserveTransaction.php create mode 100644 lib/SourceMandateNotification.php create mode 100644 lib/TaxDeductedAtSource.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e3b365910..adddc73de 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v840 \ No newline at end of file +v855 \ No newline at end of file diff --git a/init.php b/init.php index 2500ca394..bbe7551c8 100644 --- a/init.php +++ b/init.php @@ -85,6 +85,7 @@ require __DIR__ . '/lib/AccountLink.php'; require __DIR__ . '/lib/AccountSession.php'; require __DIR__ . '/lib/ApplePayDomain.php'; +require __DIR__ . '/lib/Application.php'; require __DIR__ . '/lib/ApplicationFee.php'; require __DIR__ . '/lib/ApplicationFeeRefund.php'; require __DIR__ . '/lib/Apps/Secret.php'; @@ -101,6 +102,7 @@ require __DIR__ . '/lib/Climate/Order.php'; require __DIR__ . '/lib/Climate/Product.php'; require __DIR__ . '/lib/Climate/Supplier.php'; +require __DIR__ . '/lib/ConnectCollectionTransfer.php'; require __DIR__ . '/lib/CountrySpec.php'; require __DIR__ . '/lib/Coupon.php'; require __DIR__ . '/lib/CreditNote.php'; @@ -144,6 +146,7 @@ require __DIR__ . '/lib/Payout.php'; require __DIR__ . '/lib/Person.php'; require __DIR__ . '/lib/Plan.php'; +require __DIR__ . '/lib/PlatformTaxFee.php'; require __DIR__ . '/lib/Price.php'; require __DIR__ . '/lib/Product.php'; require __DIR__ . '/lib/PromotionCode.php'; @@ -154,6 +157,7 @@ require __DIR__ . '/lib/Refund.php'; require __DIR__ . '/lib/Reporting/ReportRun.php'; require __DIR__ . '/lib/Reporting/ReportType.php'; +require __DIR__ . '/lib/ReserveTransaction.php'; require __DIR__ . '/lib/Review.php'; require __DIR__ . '/lib/Service/AccountLinkService.php'; require __DIR__ . '/lib/Service/AccountService.php'; @@ -281,6 +285,7 @@ require __DIR__ . '/lib/ShippingRate.php'; require __DIR__ . '/lib/Sigma/ScheduledQueryRun.php'; require __DIR__ . '/lib/Source.php'; +require __DIR__ . '/lib/SourceMandateNotification.php'; require __DIR__ . '/lib/SourceTransaction.php'; require __DIR__ . '/lib/Subscription.php'; require __DIR__ . '/lib/SubscriptionItem.php'; @@ -292,6 +297,7 @@ require __DIR__ . '/lib/Tax/Transaction.php'; require __DIR__ . '/lib/Tax/TransactionLineItem.php'; require __DIR__ . '/lib/TaxCode.php'; +require __DIR__ . '/lib/TaxDeductedAtSource.php'; require __DIR__ . '/lib/TaxId.php'; require __DIR__ . '/lib/TaxRate.php'; require __DIR__ . '/lib/Terminal/Configuration.php'; diff --git a/lib/Application.php b/lib/Application.php new file mode 100644 index 000000000..e74ef025b --- /dev/null +++ b/lib/Application.php @@ -0,0 +1,15 @@ +amount - fee * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. - * @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\Refund|\Stripe\StripeObject|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object. + * @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\ConnectCollectionTransfer|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\PlatformTaxFee|\Stripe\Refund|\Stripe\ReserveTransaction|\Stripe\TaxDeductedAtSource|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object. * @property string $status The transaction's net funds status in the Stripe balance, which are either available or pending. * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ diff --git a/lib/BankAccount.php b/lib/BankAccount.php index 31bbadea4..93e8f38e8 100644 --- a/lib/BankAccount.php +++ b/lib/BankAccount.php @@ -31,7 +31,7 @@ * @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|\Stripe\StripeObject $requirements Information about the requirements for the bank account, including what information needs to be collected. * @property null|string $routing_number The routing transit number for the bank account. - * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a payout sent to this bank account fails, we'll set the status to errored and will not continue to send scheduled payouts until the bank details are updated.

For external accounts, possible values are new, errored and verification_failed. If a payouts fails, the status is set to errored and scheduled payouts are stopped until account details are updated. In India, if we can't verify the owner of the bank account, we'll set the status to verification_failed. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.

+ * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a payout sent to this bank account fails, we'll set the status to errored and will not continue to send scheduled payouts until the bank details are updated.

For external accounts, possible values are new, errored and verification_failed. If a payout fails, the status is set to errored and scheduled payouts are stopped until account details are updated. In the US and India, if we can't verify the owner of the bank account, we'll set the status to verification_failed. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.

*/ class BankAccount extends ApiResource { diff --git a/lib/BillingPortal/Configuration.php b/lib/BillingPortal/Configuration.php index e9c4488f9..bc730eb9b 100644 --- a/lib/BillingPortal/Configuration.php +++ b/lib/BillingPortal/Configuration.php @@ -10,7 +10,7 @@ * @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 bool $active Whether the configuration is active and can be used to create portal sessions. - * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the configuration. + * @property null|string|\Stripe\Application $application ID of the Connect Application that created the configuration. * @property \Stripe\StripeObject $business_profile * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $default_return_url The default URL to redirect customers to when they click on the portal's link to return to your website. This can be overriden when creating the session. diff --git a/lib/Capability.php b/lib/Capability.php index 3bc5ebe22..7f03c98e5 100644 --- a/lib/Capability.php +++ b/lib/Capability.php @@ -22,13 +22,13 @@ class Capability extends ApiResource { const OBJECT_NAME = 'capability'; - use ApiOperations\Update; - const STATUS_ACTIVE = 'active'; const STATUS_INACTIVE = 'inactive'; const STATUS_PENDING = 'pending'; const STATUS_UNREQUESTED = 'unrequested'; + use ApiOperations\Update; + /** * @return string the API URL for this Stripe account reversal */ diff --git a/lib/Charge.php b/lib/Charge.php index 000a159d6..5457371bb 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -15,7 +15,7 @@ * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_captured Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). * @property int $amount_refunded Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. + * @property null|string|\Stripe\Application $application ID of the Connect application that created the charge. * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. * @property null|string $authorization_code Authorization code on the charge. @@ -65,6 +65,7 @@ class Charge extends ApiResource use ApiOperations\All; use ApiOperations\Create; + use ApiOperations\NestedResource; use ApiOperations\Retrieve; use ApiOperations\Search; use ApiOperations\Update; @@ -157,4 +158,35 @@ public static function search($params = null, $opts = null) return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts); } + + const PATH_REFUNDS = '/refunds'; + + /** + * @param string $id the ID of the charge on which to retrieve the refunds + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Refund> the list of refunds + */ + public static function allRefunds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the charge to which the refund belongs + * @param string $refundId the ID of the refund to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public static function retrieveRefund($id, $refundId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } } diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index d4e690046..cf398ac34 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -27,7 +27,7 @@ * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. * @property null|int $amount_total Total of all items after discounts and taxes are applied. * @property \Stripe\StripeObject $automatic_tax - * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. + * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. Defaults to auto. * @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. * @property null|string $client_secret Client secret to be used when initializing Stripe.js embedded checkout. @@ -40,7 +40,7 @@ * @property \Stripe\StripeObject $custom_text * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in subscription mode or Checkout Sessions with customer_creation set as always in payment mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. * @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes. - * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in setup mode. + * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in setup mode. * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. * @property int $expires_at The timestamp at which the Checkout Session will expire. * @property null|string|\Stripe\Invoice $invoice ID of the invoice created by the Checkout Session, if it exists. @@ -52,14 +52,14 @@ * @property string $mode The mode of the Checkout Session. * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session. - * @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method. + * @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method. Defaults to always. * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Checkout session if using dynamic payment methods. * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. * @property null|\Stripe\StripeObject $phone_number_collection * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. - * @property null|string $redirect_on_completion Applies to Checkout Sessions with ui_mode: embedded. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set redirect_on_completion: 'if_required', then we will only redirect if your user chooses a redirect-based payment method. + * @property null|string $redirect_on_completion This parameter applies to ui_mode: embedded. Learn more about the redirect behavior of embedded sessions. Defaults to always. * @property null|string $return_url Applies to Checkout Sessions with ui_mode: embedded. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. @@ -72,7 +72,7 @@ * @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. * @property null|\Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. - * @property null|string $ui_mode The UI mode of the Session. Can be hosted (default) or embedded. + * @property null|string $ui_mode The UI mode of the Session. Defaults to hosted. * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. */ class Session extends \Stripe\ApiResource diff --git a/lib/ConnectCollectionTransfer.php b/lib/ConnectCollectionTransfer.php new file mode 100644 index 000000000..69f961d0a --- /dev/null +++ b/lib/ConnectCollectionTransfer.php @@ -0,0 +1,18 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Account $destination ID of the account that funds are being collected for. + * @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 ConnectCollectionTransfer extends ApiResource +{ + const OBJECT_NAME = 'connect_collection_transfer'; +} diff --git a/lib/Identity/VerificationReport.php b/lib/Identity/VerificationReport.php index 2b23299b7..8bf4333d0 100644 --- a/lib/Identity/VerificationReport.php +++ b/lib/Identity/VerificationReport.php @@ -26,7 +26,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 $options * @property null|\Stripe\StripeObject $selfie Result from a selfie check - * @property null|string $type Type of report. + * @property string $type Type of report. * @property null|string $verification_session ID of the VerificationSession that created this report. */ class VerificationReport extends \Stripe\ApiResource diff --git a/lib/Identity/VerificationSession.php b/lib/Identity/VerificationSession.php index 2539c27ad..0de0d7583 100644 --- a/lib/Identity/VerificationSession.php +++ b/lib/Identity/VerificationSession.php @@ -29,7 +29,7 @@ * @property null|\Stripe\StripeObject $options A set of options for the session’s verification checks. * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. - * @property null|string $type The type of verification check to be performed. + * @property string $type The type of verification check to be performed. * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. */ diff --git a/lib/Invoice.php b/lib/Invoice.php index a6895df9b..cf26c76ff 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -47,7 +47,7 @@ * @property int $amount_paid The amount, in cents (or local equivalent), that was paid. * @property int $amount_remaining The difference between amount_due and amount_paid, in cents (or local equivalent). * @property int $amount_shipping This is the sum of all the shipping amounts. - * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice. + * @property null|string|\Stripe\Application $application ID of the Connect Application that created the invoice. * @property null|int $application_fee_amount The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php index 417d710d5..82ac54f9c 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -23,7 +23,7 @@ * @property int $amount_capturable Amount that can be captured from this PaymentIntent. * @property null|\Stripe\StripeObject $amount_details * @property int $amount_received Amount that this PaymentIntent collects. - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. + * @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 $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. diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 89763d69d..2c162773a 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -16,11 +16,11 @@ * @property bool $active Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated. * @property \Stripe\StripeObject $after_completion * @property bool $allow_promotion_codes Whether user redeemable promotion codes are enabled. - * @property null|string|\Stripe\StripeObject $application The ID of the Connect application that created the Payment Link. + * @property null|string|\Stripe\Application $application The ID of the Connect application that created the Payment Link. * @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. * @property null|float $application_fee_percent This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. * @property \Stripe\StripeObject $automatic_tax - * @property string $billing_address_collection Configuration for collecting the customer's billing address. + * @property string $billing_address_collection Configuration for collecting the customer's billing address. Defaults to auto. * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration to gather active consent from customers. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported. @@ -33,7 +33,7 @@ * @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. * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. * @property null|\Stripe\StripeObject $payment_intent_data Indicates the parameters to be passed to PaymentIntent creation during checkout. - * @property string $payment_method_collection Configuration for collecting a payment method during checkout. + * @property string $payment_method_collection Configuration for collecting a payment method during checkout. Defaults to always. * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. * @property \Stripe\StripeObject $phone_number_collection * @property null|\Stripe\StripeObject $restrictions Settings that restrict the usage of a payment link. diff --git a/lib/Person.php b/lib/Person.php index 7df0f2f34..bb5380f7b 100644 --- a/lib/Person.php +++ b/lib/Person.php @@ -48,9 +48,6 @@ class Person extends ApiResource { const OBJECT_NAME = 'person'; - use ApiOperations\Delete; - use ApiOperations\Update; - const GENDER_FEMALE = 'female'; const GENDER_MALE = 'male'; @@ -61,6 +58,9 @@ class Person extends ApiResource const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; const VERIFICATION_STATUS_VERIFIED = 'verified'; + use ApiOperations\Delete; + use ApiOperations\Update; + /** * @return string the API URL for this Stripe account reversal */ diff --git a/lib/PlatformTaxFee.php b/lib/PlatformTaxFee.php new file mode 100644 index 000000000..cb9fea7db --- /dev/null +++ b/lib/PlatformTaxFee.php @@ -0,0 +1,17 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + */ +class ReserveTransaction extends ApiResource +{ + const OBJECT_NAME = 'reserve_transaction'; +} diff --git a/lib/SetupAttempt.php b/lib/SetupAttempt.php index 5c20047be..e755171dc 100644 --- a/lib/SetupAttempt.php +++ b/lib/SetupAttempt.php @@ -12,7 +12,7 @@ * * @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 null|string|\Stripe\StripeObject $application The value of application on the SetupIntent at the time of this confirmation. + * @property null|string|\Stripe\Application $application The value of application on the SetupIntent at the time of this confirmation. * @property null|bool $attach_to_self

If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php index 5bcfa9827..a9762bbe7 100644 --- a/lib/SetupIntent.php +++ b/lib/SetupIntent.php @@ -29,7 +29,7 @@ * * @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 null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. + * @property null|string|\Stripe\Application $application ID of the Connect application that created the SetupIntent. * @property null|bool $attach_to_self

If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

* @property null|\Stripe\StripeObject $automatic_payment_methods Settings for dynamic payment methods compatible with this Setup Intent * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. diff --git a/lib/SourceMandateNotification.php b/lib/SourceMandateNotification.php new file mode 100644 index 000000000..11960527a --- /dev/null +++ b/lib/SourceMandateNotification.php @@ -0,0 +1,28 @@ +debit_initiated. + * @property null|\Stripe\StripeObject $bacs_debit + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @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 $reason The reason of the mandate notification. Valid reasons are mandate_confirmed or debit_initiated. + * @property null|\Stripe\StripeObject $sepa_debit + * @property \Stripe\Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Stripe doesn't recommend using the deprecated Sources API. We recommend that you adopt the PaymentMethods API. This newer API provides access to our latest features and payment method types.

Related guides: Sources API and Sources & Customers.

+ * @property string $status The status of the mandate notification. Valid statuses are pending or submitted. + * @property string $type The type of source this mandate notification is attached to. Should be the source type identifier code for the payment method, such as three_d_secure. + */ +class SourceMandateNotification extends ApiResource +{ + const OBJECT_NAME = 'source_mandate_notification'; +} diff --git a/lib/Subscription.php b/lib/Subscription.php index fd7df0c7a..61d421e5b 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -11,7 +11,7 @@ * * @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 null|string|\Stripe\StripeObject $application ID of the Connect Application that created the subscription. + * @property null|string|\Stripe\Application $application ID of the Connect Application that created the subscription. * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. * @property \Stripe\StripeObject $automatic_tax * @property int $billing_cycle_anchor The reference point that aligns future billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals. The timestamp is in UTC format. diff --git a/lib/SubscriptionSchedule.php b/lib/SubscriptionSchedule.php index 7e7877b55..7434abf73 100644 --- a/lib/SubscriptionSchedule.php +++ b/lib/SubscriptionSchedule.php @@ -11,7 +11,7 @@ * * @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 null|string|\Stripe\StripeObject $application ID of the Connect Application that created the schedule. + * @property null|string|\Stripe\Application $application ID of the Connect Application that created the schedule. * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. diff --git a/lib/TaxDeductedAtSource.php b/lib/TaxDeductedAtSource.php new file mode 100644 index 000000000..93bb8a341 --- /dev/null +++ b/lib/TaxDeductedAtSource.php @@ -0,0 +1,17 @@ + \Stripe\AccountLink::class, \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::class, \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, + \Stripe\Application::OBJECT_NAME => \Stripe\Application::class, \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, \Stripe\Apps\Secret::OBJECT_NAME => \Stripe\Apps\Secret::class, @@ -34,6 +35,7 @@ class ObjectTypes \Stripe\Climate\Order::OBJECT_NAME => \Stripe\Climate\Order::class, \Stripe\Climate\Product::OBJECT_NAME => \Stripe\Climate\Product::class, \Stripe\Climate\Supplier::OBJECT_NAME => \Stripe\Climate\Supplier::class, + \Stripe\ConnectCollectionTransfer::OBJECT_NAME => \Stripe\ConnectCollectionTransfer::class, \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, @@ -77,6 +79,7 @@ class ObjectTypes \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\PlatformTaxFee::OBJECT_NAME => \Stripe\PlatformTaxFee::class, \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, @@ -87,12 +90,14 @@ class ObjectTypes \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, + \Stripe\ReserveTransaction::OBJECT_NAME => \Stripe\ReserveTransaction::class, \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class, \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, + \Stripe\SourceMandateNotification::OBJECT_NAME => \Stripe\SourceMandateNotification::class, \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, @@ -104,6 +109,7 @@ class ObjectTypes \Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class, \Stripe\Tax\TransactionLineItem::OBJECT_NAME => \Stripe\Tax\TransactionLineItem::class, \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, + \Stripe\TaxDeductedAtSource::OBJECT_NAME => \Stripe\TaxDeductedAtSource::class, \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, From 8dc58bab25f222a74d1157d4ca9e9e48451dd0c1 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 29 Feb 2024 15:22:15 -0500 Subject: [PATCH 02/10] Bump version to 13.13.0 --- CHANGELOG.md | 6 ++++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d7844bc3..f84cc0005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 13.13.0 - 2024-02-29 +* [#1654](https://github.com/stripe/stripe-php/pull/1654) Update generated code + * Change type of `Identity.VerificationSession.type` from `nullable(enum('document'|'id_number'))` to `enum('document'|'id_number')` + * Add resources `Application`, `ConnectCollectionTransfer`, `PlatformTaxFee`, `ReserveTransaction`, `SourceMandateNotification`, and `TaxDeductedAtSource`. These classes have no methods on them, and are used to provide more complete types for PHPDocs. +* [#1657](https://github.com/stripe/stripe-php/pull/1657) Update readme to use addBetaVersion + ## 13.12.0 - 2024-02-22 * [#1651](https://github.com/stripe/stripe-php/pull/1651) Update generated code * Add support for `client_reference_id` on `Identity.VerificationReport` and `Identity.VerificationSession` diff --git a/VERSION b/VERSION index 6665a53d3..0b704f2a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -13.12.0 +13.13.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index e6cf724e2..fce198587 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 = '13.12.0'; + const VERSION = '13.13.0'; /** * @return string the API key used for requests From 7b64dcbab3cf29bd839a812a1eda4a5dd75b9a2c Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:35:18 +0000 Subject: [PATCH 03/10] Update generated code for v857 --- tests/Stripe/GeneratedExamplesTest.php | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 510e2a86e..e2e76d617 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -3174,6 +3174,38 @@ function () {}, // TODO: assert proper instance, {"shape":"file"} } + public function testTaxIdsDelete() + { + $this->expectsRequest('delete', '/v1/tax_ids/taxid_123'); + $result = $this->client->taxIds->delete('taxid_123', []); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testTaxIdsGet() + { + $this->expectsRequest('get', '/v1/tax_ids'); + $result = $this->client->taxIds->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); + } + + public function testTaxIdsGet2() + { + $this->expectsRequest('get', '/v1/tax_ids/taxid_123'); + $result = $this->client->taxIds->retrieve('taxid_123', []); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testTaxIdsPost() + { + $this->expectsRequest('post', '/v1/tax_ids'); + $result = $this->client->taxIds->create([ + 'type' => 'eu_vat', + 'value' => '123', + ]); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + public function testTaxRatesGet() { $this->expectsRequest('get', '/v1/tax_rates'); From 758326c215fce5beedf886b5ce39348a3cca2ddd Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:57:31 +0000 Subject: [PATCH 04/10] Update generated code for v871 --- OPENAPI_VERSION | 2 +- tests/Stripe/GeneratedExamplesTest.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 148e3ec37..5ae28919b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v857 \ No newline at end of file +v871 \ No newline at end of file diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index e2e76d617..db2afbbb4 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -792,6 +792,20 @@ public function testCustomersCashBalancePost() static::assertInstanceOf(\Stripe\CashBalance::class, $result); } + public function testCustomersCashBalanceTransactionsGet() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_123/cash_balance_transactions' + ); + $result = $this->client->customers->allCashBalanceTransactions( + 'cus_123', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result->data[0]); + } + public function testCustomersDelete() { $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); From bcc82d5b3d21df7c6efd6d03303034cb31ebb3e9 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:24:53 +0000 Subject: [PATCH 05/10] Update generated code for v873 --- OPENAPI_VERSION | 2 +- init.php | 1 + .../TestHelpers/ConfirmationTokenService.php | 29 +++++++++++++++++++ .../TestHelpers/TestHelpersServiceFactory.php | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 lib/Service/TestHelpers/ConfirmationTokenService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 5ae28919b..aed05b4a2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v871 \ No newline at end of file +v873 \ No newline at end of file diff --git a/init.php b/init.php index af45b1d67..6dec4d65c 100644 --- a/init.php +++ b/init.php @@ -289,6 +289,7 @@ require __DIR__ . '/lib/Service/Terminal/LocationService.php'; require __DIR__ . '/lib/Service/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php'; +require __DIR__ . '/lib/Service/TestHelpers/ConfirmationTokenService.php'; require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/AuthorizationService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php'; diff --git a/lib/Service/TestHelpers/ConfirmationTokenService.php b/lib/Service/TestHelpers/ConfirmationTokenService.php new file mode 100644 index 000000000..0f6f13d1b --- /dev/null +++ b/lib/Service/TestHelpers/ConfirmationTokenService.php @@ -0,0 +1,29 @@ +request('post', '/v1/test_helpers/confirmation_tokens', $params, $opts); + } +} diff --git a/lib/Service/TestHelpers/TestHelpersServiceFactory.php b/lib/Service/TestHelpers/TestHelpersServiceFactory.php index cb0ee1a01..038a565a8 100644 --- a/lib/Service/TestHelpers/TestHelpersServiceFactory.php +++ b/lib/Service/TestHelpers/TestHelpersServiceFactory.php @@ -7,6 +7,7 @@ /** * Service factory class for API resources in the TestHelpers namespace. * + * @property ConfirmationTokenService $confirmationTokens * @property CustomerService $customers * @property Issuing\IssuingServiceFactory $issuing * @property RefundService $refunds @@ -20,6 +21,7 @@ class TestHelpersServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'confirmationTokens' => ConfirmationTokenService::class, 'customers' => CustomerService::class, 'issuing' => Issuing\IssuingServiceFactory::class, 'refunds' => RefundService::class, From efbed97f2c09974a9028cc5e5cee6ebfe2069a39 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 14:47:04 +0000 Subject: [PATCH 06/10] Update generated code for v875 --- OPENAPI_VERSION | 2 +- lib/Invoice.php | 51 ++++++++++++++++++++++++++++++++++ lib/Service/InvoiceService.php | 51 ++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index aed05b4a2..8d65184cd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v873 \ No newline at end of file +v875 \ No newline at end of file diff --git a/lib/Invoice.php b/lib/Invoice.php index d02ce29fc..b2647bbcd 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -164,6 +164,23 @@ class Invoice extends ApiResource 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 @@ -250,6 +267,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 @@ -303,6 +337,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/InvoiceService.php b/lib/Service/InvoiceService.php index 92e8942c3..4cd80ba82 100644 --- a/lib/Service/InvoiceService.php +++ b/lib/Service/InvoiceService.php @@ -12,6 +12,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 @@ -219,6 +236,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. * @@ -393,6 +427,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 From bff96f87517c1ee8dd86f8005376dcda245966f3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:44:49 +0000 Subject: [PATCH 07/10] Update generated code for v878 --- OPENAPI_VERSION | 2 +- lib/PaymentMethod.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8d65184cd..0963e32fc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v875 \ No newline at end of file +v878 \ No newline at end of file diff --git a/lib/PaymentMethod.php b/lib/PaymentMethod.php index 045407865..79303df55 100644 --- a/lib/PaymentMethod.php +++ b/lib/PaymentMethod.php @@ -40,6 +40,7 @@ * @property null|\Stripe\StripeObject $link * @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|\Stripe\StripeObject $multibanco * @property null|\Stripe\StripeObject $oxxo * @property null|\Stripe\StripeObject $p24 * @property null|\Stripe\StripeObject $paynow @@ -89,6 +90,7 @@ class PaymentMethod extends ApiResource const TYPE_KLARNA = 'klarna'; const TYPE_KONBINI = 'konbini'; const TYPE_LINK = 'link'; + const TYPE_MULTIBANCO = 'multibanco'; const TYPE_OXXO = 'oxxo'; const TYPE_P24 = 'p24'; const TYPE_PAYNOW = 'paynow'; From ab71ed587856410015e61347b6786b43caddf1b8 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:34:43 +0000 Subject: [PATCH 08/10] Update generated code for v878 --- tests/Stripe/GeneratedExamplesTest.php | 100 +++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index db2afbbb4..59c17b245 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -1710,6 +1710,67 @@ public function testIssuingDisputesSubmitPost() static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } + public function testIssuingPersonalizationDesignsGet() + { + $this->expectsRequest('get', '/v1/issuing/personalization_designs'); + $result = $this->client->issuing->personalizationDesigns->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result->data[0]); + } + + public function testIssuingPersonalizationDesignsGet2() + { + $this->expectsRequest( + 'get', + '/v1/issuing/personalization_designs/pd_xyz' + ); + $result = $this->client->issuing->personalizationDesigns->retrieve( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPersonalizationDesignsPost() + { + $this->expectsRequest('post', '/v1/issuing/personalization_designs'); + $result = $this->client->issuing->personalizationDesigns->create([ + 'physical_bundle' => 'pb_xyz', + ]); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPersonalizationDesignsPost2() + { + $this->expectsRequest( + 'post', + '/v1/issuing/personalization_designs/pd_xyz' + ); + $result = $this->client->issuing->personalizationDesigns->update( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPhysicalBundlesGet() + { + $this->expectsRequest('get', '/v1/issuing/physical_bundles'); + $result = $this->client->issuing->physicalBundles->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\PhysicalBundle::class, $result->data[0]); + } + + public function testIssuingPhysicalBundlesGet2() + { + $this->expectsRequest('get', '/v1/issuing/physical_bundles/pb_xyz'); + $result = $this->client->issuing->physicalBundles->retrieve( + 'pb_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PhysicalBundle::class, $result); + } + public function testIssuingTransactionsGet() { $this->expectsRequest('get', '/v1/issuing/transactions'); @@ -3766,6 +3827,45 @@ public function testTestHelpersIssuingCardsShippingShipPost() static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } + public function testTestHelpersIssuingPersonalizationDesignsActivatePost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->activate( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testTestHelpersIssuingPersonalizationDesignsDeactivatePost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->deactivate( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testTestHelpersIssuingPersonalizationDesignsRejectPost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->reject( + 'pd_xyz', + ['rejection_reasons' => ['card_logo' => ['geographic_location']]] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + public function testTestHelpersIssuingTransactionsCreateForceCapturePost() { $this->expectsRequest( From dcecc0efe1f7a1f4245ed00c3f1e6a5c4bafd4b7 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:09:50 -0700 Subject: [PATCH 09/10] Update generated code (#1660) * Update generated code for v878 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- init.php | 5 + lib/Issuing/Card.php | 1 + lib/Issuing/PersonalizationDesign.php | 37 +++++ lib/Issuing/PhysicalBundle.php | 31 ++++ lib/Service/Issuing/IssuingServiceFactory.php | 4 + .../Issuing/PersonalizationDesignService.php | 78 ++++++++++ lib/Service/Issuing/PhysicalBundleService.php | 46 ++++++ .../Issuing/IssuingServiceFactory.php | 2 + .../Issuing/PersonalizationDesignService.php | 65 ++++++++ lib/Util/ObjectTypes.php | 2 + tests/Stripe/GeneratedExamplesTest.php | 146 ++++++++++++++++++ 12 files changed, 418 insertions(+), 1 deletion(-) create mode 100644 lib/Issuing/PersonalizationDesign.php create mode 100644 lib/Issuing/PhysicalBundle.php create mode 100644 lib/Service/Issuing/PersonalizationDesignService.php create mode 100644 lib/Service/Issuing/PhysicalBundleService.php create mode 100644 lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index adddc73de..0963e32fc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v855 \ No newline at end of file +v878 \ No newline at end of file diff --git a/init.php b/init.php index bbe7551c8..8413ea0d2 100644 --- a/init.php +++ b/init.php @@ -133,6 +133,8 @@ require __DIR__ . '/lib/Issuing/Card.php'; require __DIR__ . '/lib/Issuing/Cardholder.php'; require __DIR__ . '/lib/Issuing/Dispute.php'; +require __DIR__ . '/lib/Issuing/PersonalizationDesign.php'; +require __DIR__ . '/lib/Issuing/PhysicalBundle.php'; require __DIR__ . '/lib/Issuing/Token.php'; require __DIR__ . '/lib/Issuing/Transaction.php'; require __DIR__ . '/lib/LineItem.php'; @@ -204,6 +206,8 @@ require __DIR__ . '/lib/Service/Issuing/CardholderService.php'; require __DIR__ . '/lib/Service/Issuing/DisputeService.php'; require __DIR__ . '/lib/Service/Issuing/IssuingServiceFactory.php'; +require __DIR__ . '/lib/Service/Issuing/PersonalizationDesignService.php'; +require __DIR__ . '/lib/Service/Issuing/PhysicalBundleService.php'; require __DIR__ . '/lib/Service/Issuing/TokenService.php'; require __DIR__ . '/lib/Service/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/MandateService.php'; @@ -253,6 +257,7 @@ require __DIR__ . '/lib/Service/TestHelpers/Issuing/AuthorizationService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/TestHelpers/RefundService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php'; diff --git a/lib/Issuing/Card.php b/lib/Issuing/Card.php index 62c8ef995..d18a07539 100644 --- a/lib/Issuing/Card.php +++ b/lib/Issuing/Card.php @@ -22,6 +22,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 \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 $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property null|string|\Stripe\Issuing\PersonalizationDesign $personalization_design The personalization design object belonging to this card. * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. * @property null|string $replacement_reason The reason why the previous card needed to be replaced. diff --git a/lib/Issuing/PersonalizationDesign.php b/lib/Issuing/PersonalizationDesign.php new file mode 100644 index 000000000..74af892aa --- /dev/null +++ b/lib/Issuing/PersonalizationDesign.php @@ -0,0 +1,37 @@ +purpose value of issuing_logo. + * @property null|\Stripe\StripeObject $carrier_text Hash containing carrier text, for use with physical bundles that support carrier text. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @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 $lookup_key A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + * @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. + * @property null|string $name Friendly display name. + * @property string|\Stripe\Issuing\PhysicalBundle $physical_bundle The physical bundle object belonging to this personalization design. + * @property \Stripe\StripeObject $preferences + * @property \Stripe\StripeObject $rejection_reasons + * @property string $status Whether this personalization design can be used to create cards. + */ +class PersonalizationDesign extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.personalization_design'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_REJECTED = 'rejected'; + const STATUS_REVIEW = 'review'; +} diff --git a/lib/Issuing/PhysicalBundle.php b/lib/Issuing/PhysicalBundle.php new file mode 100644 index 000000000..3a978cba1 --- /dev/null +++ b/lib/Issuing/PhysicalBundle.php @@ -0,0 +1,31 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $name Friendly display name. + * @property string $status Whether this physical bundle can be used to create cards. + * @property string $type Whether this physical bundle is a standard Stripe offering or custom-made for you. + */ +class PhysicalBundle extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.physical_bundle'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_REVIEW = 'review'; + + const TYPE_CUSTOM = 'custom'; + const TYPE_STANDARD = 'standard'; +} diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php index b87566c07..852351d2b 100644 --- a/lib/Service/Issuing/IssuingServiceFactory.php +++ b/lib/Service/Issuing/IssuingServiceFactory.php @@ -11,6 +11,8 @@ * @property CardholderService $cardholders * @property CardService $cards * @property DisputeService $disputes + * @property PersonalizationDesignService $personalizationDesigns + * @property PhysicalBundleService $physicalBundles * @property TokenService $tokens * @property TransactionService $transactions */ @@ -24,6 +26,8 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory 'cardholders' => CardholderService::class, 'cards' => CardService::class, 'disputes' => DisputeService::class, + 'personalizationDesigns' => PersonalizationDesignService::class, + 'physicalBundles' => PhysicalBundleService::class, 'tokens' => TokenService::class, 'transactions' => TransactionService::class, ]; diff --git a/lib/Service/Issuing/PersonalizationDesignService.php b/lib/Service/Issuing/PersonalizationDesignService.php new file mode 100644 index 000000000..7c35f6478 --- /dev/null +++ b/lib/Service/Issuing/PersonalizationDesignService.php @@ -0,0 +1,78 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/personalization_designs', $params, $opts); + } + + /** + * Creates a personalization design object. + * + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\PersonalizationDesign + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/personalization_designs', $params, $opts); + } + + /** + * Retrieves a personalization design 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\Issuing\PersonalizationDesign + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/personalization_designs/%s', $id), $params, $opts); + } + + /** + * Updates a card personalization 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\Issuing\PersonalizationDesign + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/personalization_designs/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/Issuing/PhysicalBundleService.php b/lib/Service/Issuing/PhysicalBundleService.php new file mode 100644 index 000000000..558abffdd --- /dev/null +++ b/lib/Service/Issuing/PhysicalBundleService.php @@ -0,0 +1,46 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/physical_bundles', $params, $opts); + } + + /** + * Retrieves a physical bundle 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\Issuing\PhysicalBundle + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/physical_bundles/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php index e15a7c87c..c6224144a 100644 --- a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php +++ b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php @@ -9,6 +9,7 @@ * * @property AuthorizationService $authorizations * @property CardService $cards + * @property PersonalizationDesignService $personalizationDesigns * @property TransactionService $transactions */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -19,6 +20,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory private static $classMap = [ 'authorizations' => AuthorizationService::class, 'cards' => CardService::class, + 'personalizationDesigns' => PersonalizationDesignService::class, 'transactions' => TransactionService::class, ]; diff --git a/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php b/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php new file mode 100644 index 000000000..e9051d729 --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/PersonalizationDesignService.php @@ -0,0 +1,65 @@ +status of the specified testmode personalization design + * object to active. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\PersonalizationDesign + */ + public function activate($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/personalization_designs/%s/activate', $id), $params, $opts); + } + + /** + * Updates the status of the specified testmode personalization design + * object to inactive. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\PersonalizationDesign + */ + public function deactivate($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/personalization_designs/%s/deactivate', $id), $params, $opts); + } + + /** + * Updates the status of the specified testmode personalization design + * object to rejected. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\PersonalizationDesign + */ + public function reject($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/personalization_designs/%s/reject', $id), $params, $opts); + } +} diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 82dfd2580..953430d0a 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -66,6 +66,8 @@ class ObjectTypes \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\PersonalizationDesign::OBJECT_NAME => \Stripe\Issuing\PersonalizationDesign::class, + \Stripe\Issuing\PhysicalBundle::OBJECT_NAME => \Stripe\Issuing\PhysicalBundle::class, \Stripe\Issuing\Token::OBJECT_NAME => \Stripe\Issuing\Token::class, \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 60bc02bb1..de9c2ef01 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -792,6 +792,20 @@ public function testCustomersCashBalancePost() static::assertInstanceOf(\Stripe\CashBalance::class, $result); } + public function testCustomersCashBalanceTransactionsGet() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_123/cash_balance_transactions' + ); + $result = $this->client->customers->allCashBalanceTransactions( + 'cus_123', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result->data[0]); + } + public function testCustomersDelete() { $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); @@ -1696,6 +1710,67 @@ public function testIssuingDisputesSubmitPost() static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); } + public function testIssuingPersonalizationDesignsGet() + { + $this->expectsRequest('get', '/v1/issuing/personalization_designs'); + $result = $this->client->issuing->personalizationDesigns->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result->data[0]); + } + + public function testIssuingPersonalizationDesignsGet2() + { + $this->expectsRequest( + 'get', + '/v1/issuing/personalization_designs/pd_xyz' + ); + $result = $this->client->issuing->personalizationDesigns->retrieve( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPersonalizationDesignsPost() + { + $this->expectsRequest('post', '/v1/issuing/personalization_designs'); + $result = $this->client->issuing->personalizationDesigns->create([ + 'physical_bundle' => 'pb_xyz', + ]); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPersonalizationDesignsPost2() + { + $this->expectsRequest( + 'post', + '/v1/issuing/personalization_designs/pd_xyz' + ); + $result = $this->client->issuing->personalizationDesigns->update( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testIssuingPhysicalBundlesGet() + { + $this->expectsRequest('get', '/v1/issuing/physical_bundles'); + $result = $this->client->issuing->physicalBundles->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\PhysicalBundle::class, $result->data[0]); + } + + public function testIssuingPhysicalBundlesGet2() + { + $this->expectsRequest('get', '/v1/issuing/physical_bundles/pb_xyz'); + $result = $this->client->issuing->physicalBundles->retrieve( + 'pb_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PhysicalBundle::class, $result); + } + public function testIssuingTransactionsGet() { $this->expectsRequest('get', '/v1/issuing/transactions'); @@ -3145,6 +3220,38 @@ public function testTaxCodesGet2() static::assertInstanceOf(\Stripe\TaxCode::class, $result); } + public function testTaxIdsDelete() + { + $this->expectsRequest('delete', '/v1/tax_ids/taxid_123'); + $result = $this->client->taxIds->delete('taxid_123', []); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testTaxIdsGet() + { + $this->expectsRequest('get', '/v1/tax_ids'); + $result = $this->client->taxIds->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); + } + + public function testTaxIdsGet2() + { + $this->expectsRequest('get', '/v1/tax_ids/taxid_123'); + $result = $this->client->taxIds->retrieve('taxid_123', []); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testTaxIdsPost() + { + $this->expectsRequest('post', '/v1/tax_ids'); + $result = $this->client->taxIds->create([ + 'type' => 'eu_vat', + 'value' => '123', + ]); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + public function testTaxRatesGet() { $this->expectsRequest('get', '/v1/tax_rates'); @@ -3691,6 +3798,45 @@ public function testTestHelpersIssuingCardsShippingShipPost() static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); } + public function testTestHelpersIssuingPersonalizationDesignsActivatePost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->activate( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testTestHelpersIssuingPersonalizationDesignsDeactivatePost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->deactivate( + 'pd_xyz', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + + public function testTestHelpersIssuingPersonalizationDesignsRejectPost() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject' + ); + $result = $this->client->testHelpers->issuing->personalizationDesigns->reject( + 'pd_xyz', + ['rejection_reasons' => ['card_logo' => ['geographic_location']]] + ); + static::assertInstanceOf(\Stripe\Issuing\PersonalizationDesign::class, $result); + } + public function testTestHelpersIssuingTransactionsCreateForceCapturePost() { $this->expectsRequest( From d569265e79dc82329dadea1b1088a0a29c7a8a76 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 14 Mar 2024 14:12:02 -0700 Subject: [PATCH 10/10] Bump version to 13.14.0 --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f84cc0005..6584af6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 13.14.0 - 2024-03-14 +* [#1660](https://github.com/stripe/stripe-php/pull/1660) Update generated code + * Add support for new resources `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle` + * Add support for `all`, `create`, `retrieve`, and `update` methods on resource `PersonalizationDesign` + * Add support for `all` and `retrieve` methods on resource `PhysicalBundle` + * Add support for `personalization_design` on `Issuing.Card` + ## 13.13.0 - 2024-02-29 * [#1654](https://github.com/stripe/stripe-php/pull/1654) Update generated code * Change type of `Identity.VerificationSession.type` from `nullable(enum('document'|'id_number'))` to `enum('document'|'id_number')` diff --git a/VERSION b/VERSION index 0b704f2a4..d9a01d253 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -13.13.0 +13.14.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index fce198587..b6df8b8af 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 = '13.13.0'; + const VERSION = '13.14.0'; /** * @return string the API key used for requests