Skip to content

Commit

Permalink
Merge pull request #1661 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] committed Mar 21, 2024
2 parents 2446c3f + 4de9271 commit 5a45adc
Show file tree
Hide file tree
Showing 26 changed files with 316 additions and 85 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v879
v896
9 changes: 7 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@
require __DIR__ . '/lib/Customer.php';
require __DIR__ . '/lib/CustomerBalanceTransaction.php';
require __DIR__ . '/lib/CustomerCashBalanceTransaction.php';
require __DIR__ . '/lib/CustomerEntitlement.php';
require __DIR__ . '/lib/CustomerEntitlementSummary.php';
require __DIR__ . '/lib/CustomerSession.php';
require __DIR__ . '/lib/Discount.php';
require __DIR__ . '/lib/Dispute.php';
require __DIR__ . '/lib/Entitlements/ActiveEntitlement.php';
require __DIR__ . '/lib/Entitlements/ActiveEntitlementSummary.php';
require __DIR__ . '/lib/Entitlements/Feature.php';
require __DIR__ . '/lib/EphemeralKey.php';
require __DIR__ . '/lib/Event.php';
Expand All @@ -137,6 +137,7 @@
require __DIR__ . '/lib/FinancialConnections/AccountOwnership.php';
require __DIR__ . '/lib/FinancialConnections/Session.php';
require __DIR__ . '/lib/FinancialConnections/Transaction.php';
require __DIR__ . '/lib/Forwarding/Request.php';
require __DIR__ . '/lib/FundingInstructions.php';
require __DIR__ . '/lib/GiftCards/Card.php';
require __DIR__ . '/lib/GiftCards/Transaction.php';
Expand Down Expand Up @@ -171,6 +172,7 @@
require __DIR__ . '/lib/PlatformTaxFee.php';
require __DIR__ . '/lib/Price.php';
require __DIR__ . '/lib/Product.php';
require __DIR__ . '/lib/ProductFeature.php';
require __DIR__ . '/lib/PromotionCode.php';
require __DIR__ . '/lib/Quote.php';
require __DIR__ . '/lib/QuoteLine.php';
Expand Down Expand Up @@ -221,6 +223,7 @@
require __DIR__ . '/lib/Service/CustomerService.php';
require __DIR__ . '/lib/Service/CustomerSessionService.php';
require __DIR__ . '/lib/Service/DisputeService.php';
require __DIR__ . '/lib/Service/Entitlements/ActiveEntitlementService.php';
require __DIR__ . '/lib/Service/Entitlements/EntitlementsServiceFactory.php';
require __DIR__ . '/lib/Service/Entitlements/FeatureService.php';
require __DIR__ . '/lib/Service/EphemeralKeyService.php';
Expand All @@ -232,6 +235,8 @@
require __DIR__ . '/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php';
require __DIR__ . '/lib/Service/FinancialConnections/SessionService.php';
require __DIR__ . '/lib/Service/FinancialConnections/TransactionService.php';
require __DIR__ . '/lib/Service/Forwarding/ForwardingServiceFactory.php';
require __DIR__ . '/lib/Service/Forwarding/RequestService.php';
require __DIR__ . '/lib/Service/GiftCards/CardService.php';
require __DIR__ . '/lib/Service/GiftCards/GiftCardsServiceFactory.php';
require __DIR__ . '/lib/Service/GiftCards/TransactionService.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/ConfirmationToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
* @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 $mandate_data Data used for generating a Mandate.
* @property null|string $payment_intent ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
* @property null|string|\Stripe\PaymentMethod $payment_method ID of an existing PaymentMethod.
* @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this ConfirmationToken.
* @property null|\Stripe\StripeObject $payment_method_preview Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
* @property null|string $return_url Return URL used to confirm the Intent.
* @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this ConfirmationToken's payment method.</p><p>The presence of this property will <a href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a> to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.</p>
* @property null|string $setup_intent ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
* @property null|\Stripe\StripeObject $shipping Shipping information collected on this ConfirmationToken.
* @property bool $use_stripe_sdk Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to <code>true</code> on ConfirmationToken.
*/
class ConfirmationToken extends ApiResource
{
Expand Down
31 changes: 0 additions & 31 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,35 +387,4 @@ public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null
{
return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
}
const PATH_ENTITLEMENTS = '/entitlements';

/**
* @param string $id the ID of the customer on which to retrieve the customer entitlements
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\CustomerEntitlement> the list of customer entitlements
*/
public static function allEntitlements($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_ENTITLEMENTS, $params, $opts);
}
const PATH_ENTITLEMENT_SUMMARY = '/entitlement_summary';

/**
* @param string $id the ID of the customer to which the customer entitlement summary belongs
* @param null|array $params
* @param null|array|string $opts
* @param mixed $entitlementSummaryId
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CustomerEntitlementSummary
*/
public static function retrieveEntitlementSummary($id, $entitlementSummaryId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_ENTITLEMENT_SUMMARY, $params, $opts);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

// File generated from our OpenAPI spec

namespace Stripe;
namespace Stripe\Entitlements;

/**
* A entitlement for a customer describes access to a feature.
* An active entitlement describes access to a feature for a customer.
*
* @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 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.
*/
class CustomerEntitlement extends ApiResource
class ActiveEntitlement extends \Stripe\ApiResource
{
const OBJECT_NAME = 'customer_entitlement';
const OBJECT_NAME = 'entitlements.active_entitlement';

use \Stripe\ApiOperations\All;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

// File generated from our OpenAPI spec

namespace Stripe;
namespace Stripe\Entitlements;

/**
* A summary of a customer's entitlements.
* A summary of a customer's active entitlements.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string $customer The customer that is entitled to this feature.
* @property \Stripe\Collection<\Stripe\CustomerEntitlement> $entitlements The list of entitlements this customer has.
* @property \Stripe\Collection<\Stripe\Entitlements\ActiveEntitlement> $entitlements The list of entitlements this customer has.
* @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.
*/
class CustomerEntitlementSummary extends ApiResource
class ActiveEntitlementSummary extends \Stripe\ApiResource
{
const OBJECT_NAME = 'customer_entitlement_summary';
const OBJECT_NAME = 'entitlements.active_entitlement_summary';
}
2 changes: 2 additions & 0 deletions lib/Entitlements/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property bool $active Inactive features cannot be attached to new products and will not be returned from the features list endpoint.
* @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 $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 string $name The feature's name, for your own purpose, not meant to be displayable to the customer.
*/
class Feature extends \Stripe\ApiResource
Expand Down
4 changes: 4 additions & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class ErrorObject extends StripeObject
const CODE_EXPIRED_CARD = 'expired_card';
const CODE_FINANCIAL_CONNECTIONS_ACCOUNT_INACTIVE = 'financial_connections_account_inactive';
const CODE_FINANCIAL_CONNECTIONS_NO_SUCCESSFUL_TRANSACTION_REFRESH = 'financial_connections_no_successful_transaction_refresh';
const CODE_FORWARDING_API_INACTIVE = 'forwarding_api_inactive';
const CODE_FORWARDING_API_INVALID_PARAMETER = 'forwarding_api_invalid_parameter';
const CODE_FORWARDING_API_UPSTREAM_CONNECTION_ERROR = 'forwarding_api_upstream_connection_error';
const CODE_FORWARDING_API_UPSTREAM_CONNECTION_TIMEOUT = 'forwarding_api_upstream_connection_timeout';
const CODE_GIFT_CARD_BALANCE_INSUFFICIENT = 'gift_card_balance_insufficient';
const CODE_GIFT_CARD_CODE_EXISTS = 'gift_card_code_exists';
const CODE_GIFT_CARD_INACTIVE = 'gift_card_inactive';
Expand Down
4 changes: 2 additions & 2 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class Event extends ApiResource
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
const CUSTOMER_ENTITLEMENT_SUMMARY_UPDATED = 'customer.entitlement_summary.updated';
const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
Expand All @@ -140,6 +139,7 @@ class Event extends ApiResource
const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const CUSTOMER_UPDATED = 'customer.updated';
const ENTITLEMENTS_ACTIVE_ENTITLEMENT_SUMMARY_UPDATED = 'entitlements.active_entitlement_summary.updated';
const FILE_CREATED = 'file.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
Expand Down Expand Up @@ -385,7 +385,6 @@ class Event extends ApiResource
const TYPE_CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
const TYPE_CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
const TYPE_CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
const TYPE_CUSTOMER_ENTITLEMENT_SUMMARY_UPDATED = 'customer.entitlement_summary.updated';
const TYPE_CUSTOMER_SOURCE_CREATED = 'customer.source.created';
const TYPE_CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
const TYPE_CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
Expand All @@ -405,6 +404,7 @@ class Event extends ApiResource
const TYPE_CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
const TYPE_CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const TYPE_CUSTOMER_UPDATED = 'customer.updated';
const TYPE_ENTITLEMENTS_ACTIVE_ENTITLEMENT_SUMMARY_UPDATED = 'entitlements.active_entitlement_summary.updated';
const TYPE_FILE_CREATED = 'file.created';
const TYPE_FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
const TYPE_FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
Expand Down
42 changes: 42 additions & 0 deletions lib/Forwarding/Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Forwarding;

/**
* Instructs Stripe to make a request on your behalf using the destination URL and HTTP method in the config.
* A config is set up for each destination URL by Stripe at the time of onboarding. Stripe verifies requests with
* your credentials in the config, and injects card details from the payment_method into the request.
*
* Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
* before storing the request and response data in the forwarding Request object, which are subject to a
* 30-day retention period.
*
* You can provide a Stripe idempotency key to make sure that requests with the same key result in only one
* outbound request. The Stripe idempotency key provided should be unique and different from any idempotency
* keys provided on the underlying third-party request.
*
* Forwarding Requests are synchronous requests that return a response or time out according to
* Stripe’s limits.
*
* @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 string $config The Forwarding Config used when making the forwarded request. The config specifes the HTTP method, merchant credentials, connection settings, and supported destination URLs.
* @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 string $payment_method The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
* @property string[] $replacements The field kinds to be replaced in the forwarded request.
* @property null|\Stripe\StripeObject $request_context Context about the request from Stripe's servers to the destination endpoint.
* @property null|\Stripe\StripeObject $request_details The request that was sent to the destination endpoint. We redact any sensitive fields.
* @property null|\Stripe\StripeObject $response_details The response that the destination endpoint returned to us. We redact any sensitive fields.
* @property null|string $url The destination URL for the forwarded request. Must be supported by the config.
*/
class Request extends \Stripe\ApiResource
{
const OBJECT_NAME = 'forwarding.request';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
}
2 changes: 2 additions & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @property null|\Stripe\StripeObject $link
* @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 $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 $mobilepay
* @property null|\Stripe\StripeObject $multibanco
* @property null|\Stripe\StripeObject $oxxo
* @property null|\Stripe\StripeObject $p24
Expand Down Expand Up @@ -90,6 +91,7 @@ class PaymentMethod extends ApiResource
const TYPE_KLARNA = 'klarna';
const TYPE_KONBINI = 'konbini';
const TYPE_LINK = 'link';
const TYPE_MOBILEPAY = 'mobilepay';
const TYPE_MULTIBANCO = 'multibanco';
const TYPE_OXXO = 'oxxo';
const TYPE_P24 = 'p24';
Expand Down
48 changes: 47 additions & 1 deletion lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string|\Stripe\Price $default_price The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> object that is the default price for this product.
* @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
* @property \Stripe\StripeObject[] $features A list of up to 15 features for this product. Entries using <code>name</code> are displayed in <a href="https://stripe.com/docs/payments/checkout/pricing-table">pricing tables</a>.
* @property \Stripe\StripeObject[] $features A list of up to 15 marketing features for this product. These are displayed in <a href="https://stripe.com/docs/payments/checkout/pricing-table">pricing tables</a>.
* @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
* @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 \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.
Expand All @@ -42,6 +42,7 @@ class Product extends ApiResource
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
use ApiOperations\Search;
use ApiOperations\Update;
Expand All @@ -63,4 +64,49 @@ public static function search($params = null, $opts = null)

return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts);
}

const PATH_FEATURES = '/features';

/**
* @param string $id the ID of the product on which to retrieve the product features
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\ProductFeature> the list of product features
*/
public static function allFeatures($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_FEATURES, $params, $opts);
}

/**
* @param string $id the ID of the product on which to create the product feature
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\ProductFeature
*/
public static function createFeature($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_FEATURES, $params, $opts);
}

/**
* @param string $id the ID of the product to which the product feature belongs
* @param string $featureId the ID of the product feature to delete
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\ProductFeature
*/
public static function deleteFeature($id, $featureId, $params = null, $opts = null)
{
return self::_deleteNestedResource($id, static::PATH_FEATURES, $featureId, $params, $opts);
}
}

0 comments on commit 5a45adc

Please sign in to comment.