Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1655

Merged
merged 10 commits into from
Feb 29, 2024
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v840
v855
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ Stripe has features in the beta phase that can be accessed via the beta version
We would love for you to try these and share feedback with us before these features reach the stable phase.
Use the `composer require` command with an exact version specified to install the beta version of the stripe-php pacakge.


```bash
composer require stripe/stripe-php:v9.2.0-beta.1
```
Expand All @@ -218,10 +217,10 @@ composer require stripe/stripe-php:v9.2.0-beta.1

We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.

If your beta feature requires a `Stripe-Version` header to be sent, use the `apiVersion` property of `config` object to set it:
If your beta feature requires a `Stripe-Version` header to be sent, set the `apiVersion` property of `config` object by using the function `addBetaVersion`:

```php
Stripe::setApiVersion(Stripe::getApiVersion() . '; feature_beta=v3');
Stripe::addBetaVersion("feature_beta", "v3");
```

### Custom requests
Expand Down
2 changes: 0 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
require __DIR__ . '/lib/CustomerSession.php';
require __DIR__ . '/lib/Discount.php';
require __DIR__ . '/lib/Dispute.php';
require __DIR__ . '/lib/Entitlements/Event.php';
require __DIR__ . '/lib/Entitlements/Feature.php';
require __DIR__ . '/lib/EphemeralKey.php';
require __DIR__ . '/lib/Event.php';
Expand Down Expand Up @@ -215,7 +214,6 @@
require __DIR__ . '/lib/Service/CustomerSessionService.php';
require __DIR__ . '/lib/Service/DisputeService.php';
require __DIR__ . '/lib/Service/Entitlements/EntitlementsServiceFactory.php';
require __DIR__ . '/lib/Service/Entitlements/EventService.php';
require __DIR__ . '/lib/Service/Entitlements/FeatureService.php';
require __DIR__ . '/lib/Service/EphemeralKeyService.php';
require __DIR__ . '/lib/Service/EventService.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> 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 <p>For bank accounts, possible values are <code>new</code>, <code>validated</code>, <code>verified</code>, <code>verification_failed</code>, or <code>errored</code>. A bank account that hasn't had any activity or validation performed is <code>new</code>. If Stripe can determine that the bank account exists, its status will be <code>validated</code>. 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 <code>verified</code>. If the verification failed for any reason, such as microdeposit failure, the status will be <code>verification_failed</code>. If a payout sent to this bank account fails, we'll set the status to <code>errored</code> and will not continue to send <a href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> until the bank details are updated.</p><p>For external accounts, possible values are <code>new</code>, <code>errored</code> and <code>verification_failed</code>. If a payouts fails, the status is set to <code>errored</code> and scheduled payouts are stopped until account details are updated. In India, if we can't <a href="https://support.stripe.com/questions/bank-account-ownership-verification">verify the owner of the bank account</a>, we'll set the status to <code>verification_failed</code>. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.</p>
* @property string $status <p>For bank accounts, possible values are <code>new</code>, <code>validated</code>, <code>verified</code>, <code>verification_failed</code>, or <code>errored</code>. A bank account that hasn't had any activity or validation performed is <code>new</code>. If Stripe can determine that the bank account exists, its status will be <code>validated</code>. 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 <code>verified</code>. If the verification failed for any reason, such as microdeposit failure, the status will be <code>verification_failed</code>. If a payout sent to this bank account fails, we'll set the status to <code>errored</code> and will not continue to send <a href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> until the bank details are updated.</p><p>For external accounts, possible values are <code>new</code>, <code>errored</code> and <code>verification_failed</code>. If a payout fails, the status is set to <code>errored</code> and scheduled payouts are stopped until account details are updated. In the US and India, if we can't <a href="https://support.stripe.com/questions/bank-account-ownership-verification">verify the owner of the bank account</a>, we'll set the status to <code>verification_failed</code>. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.</p>
*/
class BankAccount extends ApiResource
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
32 changes: 32 additions & 0 deletions lib/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
10 changes: 5 additions & 5 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>auto</code>.
* @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.
Expand All @@ -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 <code>subscription</code> mode or Checkout Sessions with <code>customer_creation</code> set as <code>always</code> in <code>payment</code> 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 <code>setup</code> 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 <code>setup</code> 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 <code>customer</code> 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.
Expand All @@ -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 <code>payment</code> 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 <code>always</code>.
* @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 <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. 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 <code>ui_mode: embedded</code>. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set <code>redirect_on_completion: 'if_required'</code>, then we will only redirect if your user chooses a redirect-based payment method.
* @property null|string $redirect_on_completion This parameter applies to <code>ui_mode: embedded</code>. Learn more about the <a href="https://stripe.com/docs/payments/checkout/custom-redirect-behavior">redirect behavior</a> of embedded sessions. Defaults to <code>always</code>.
* @property null|string $return_url Applies to Checkout Sessions with <code>ui_mode: embedded</code>. 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 <code>setup</code> mode.
* @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
Expand All @@ -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 <code>hosted</code> (default) or <code>embedded</code>.
* @property null|string $ui_mode The UI mode of the Session. Defaults to <code>hosted</code>.
* @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using <a href="https://stripe.com/docs/payments/checkout/custom-domains">Custom Domains</a>, the URL will use your subdomain. Otherwise, it’ll use <code>checkout.stripe.com.</code> This value is only present when the session is active.
*/
class Session extends \Stripe\ApiResource
Expand Down
5 changes: 0 additions & 5 deletions lib/CustomerEntitlement.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
* @property string $feature The feature that the customer is entitled to.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters.
* @property null|\Stripe\StripeObject $quantity Contains information about entitlements relating to features with type=quantity. Required when the feature has type=quantity.
* @property string $type The type of feature.
*/
class CustomerEntitlement extends ApiResource
{
const OBJECT_NAME = 'customer_entitlement';

const TYPE_QUANTITY = 'quantity';
const TYPE_SWITCH = 'switch';
}
28 changes: 0 additions & 28 deletions lib/Entitlements/Event.php

This file was deleted.

5 changes: 0 additions & 5 deletions lib/Entitlements/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters.
* @property string $name The feature's name, for your own purpose, not meant to be displayable to the customer.
* @property null|\Stripe\StripeObject $quantity Contains information about type=quantity features. This is required when type=quantity.
* @property string $type The type of feature.
*/
class Feature extends \Stripe\ApiResource
{
const OBJECT_NAME = 'entitlements.feature';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;

const TYPE_QUANTITY = 'quantity';
const TYPE_SWITCH = 'switch';
}
2 changes: 1 addition & 1 deletion lib/Identity/VerificationReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> 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
Expand Down
2 changes: 1 addition & 1 deletion lib/Identity/VerificationSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. <a href="https://stripe.com/docs/identity/how-sessions-work">Learn more about the lifecycle of sessions</a>.
* @property null|string $type The type of <a href="https://stripe.com/docs/identity/verification-checks">verification check</a> to be performed.
* @property string $type The type of <a href="https://stripe.com/docs/identity/verification-checks">verification check</a> 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 <a href="https://stripe.com/docs/identity/verify-identity-documents?platform=web&amp;type=redirect">verifying identity documents</a> to learn how to redirect users to Stripe.
* @property null|\Stripe\StripeObject $verified_outputs The user’s verified data.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Issuing/PersonalizationDesign.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @property null|string|\Stripe\File $card_logo The file for the card logo to use with physical bundles that support card logos. Must have a <code>purpose</code> value of <code>issuing_logo</code>.
* @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 <code>true</code> if the object exists in live mode or the value <code>false</code> 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 <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> 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.
Expand Down
Loading
Loading