Skip to content

Commit

Permalink
Update generated code (#1681)
Browse files Browse the repository at this point in the history
* Update generated code for v964

* Update generated code for v966

* Update generated code for v969

* Update generated code for v970

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and ramya-stripe authored Apr 18, 2024
1 parent 3c95b17 commit 8782897
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v961
v970
4 changes: 2 additions & 2 deletions lib/Billing/Meter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* @property \Stripe\StripeObject $customer_mapping
* @property \Stripe\StripeObject $default_aggregation
* @property string $display_name The meter's name.
* @property string $event_name The name of the usage event to record usage for. Corresponds with the <code>event_name</code> field on usage events.
* @property null|string $event_time_window The time window to pre-aggregate usage events for, if any.
* @property string $event_name The name of the meter event to record usage for. Corresponds with the <code>event_name</code> field on meter events.
* @property null|string $event_time_window The time window to pre-aggregate meter events for, if any.
* @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 $status The meter's status.
* @property \Stripe\StripeObject $status_transitions
Expand Down
2 changes: 1 addition & 1 deletion lib/Billing/MeterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @property string $event_name The name of the meter event. Corresponds with the <code>event_name</code> field on a meter.
* @property string $identifier A unique identifier for the event.
* @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 $payload The payload of the event.
* @property \Stripe\StripeObject $payload The payload of the event. This contains the fields corresponding to a meter's <code>customer_mapping.event_payload_key</code> (default is <code>stripe_customer_id</code>) and <code>value_settings.event_payload_key</code> (default is <code>value</code>). Read more about the <a href="https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides">payload</a>.
* @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
*/
class MeterEvent extends \Stripe\ApiResource
Expand Down
8 changes: 4 additions & 4 deletions lib/Billing/MeterEventSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property float $aggregated_value Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``.
* @property int $end_time End timestamp for this usage summary (inclusive).
* @property float $aggregated_value Aggregated value of all the events within <code>start_time</code> (inclusive) and <code>end_time</code> (inclusive). The aggregation strategy is defined on meter via <code>default_aggregation</code>.
* @property int $end_time End timestamp for this event summary (inclusive).
* @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 $meter The meter associated with this usage summary.
* @property int $start_time Start timestamp for this usage summary (inclusive).
* @property string $meter The meter associated with this event summary.
* @property int $start_time Start timestamp for this event summary (inclusive).
*/
class MeterEventSummary extends \Stripe\ApiResource
{
Expand Down
1 change: 1 addition & 0 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
* @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow.
* @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|\Stripe\StripeObject $saved_payment_method_options Controls saved payment method settings for the session. Only available in <code>payment</code> and <code>subscription</code> mode.
* @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.
* @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate.
Expand Down
18 changes: 18 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ 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 created invoice
*/
public static function createPreview($params = null, $opts = null)
{
$url = static::classUrl() . '/create_preview';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
34 changes: 34 additions & 0 deletions lib/Service/InvoiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,40 @@ public function create($params = null, $opts = null)
return $this->request('post', '/v1/invoices', $params, $opts);
}

/**
* At any time, you can preview the upcoming invoice for a customer. This will show
* you all the charges that are pending, including subscription renewal charges,
* invoice item charges, etc. It will also show you any discounts that are
* applicable to the invoice.
*
* Note that when you are viewing an upcoming invoice, you are simply viewing a
* preview – the invoice has not yet been created. As such, the upcoming invoice
* will not show up in invoice listing calls, and you cannot use the API to pay or
* edit the invoice. If you want to change the amount that your customer will be
* billed, you can add, remove, or update pending invoice items, or update the
* customer’s discount.
*
* You can preview the effects of updating a subscription, including a preview of
* what proration will take place. To ensure that the actual proration is
* calculated exactly the same as the previewed proration, you should pass the
* <code>subscription_details.proration_date</code> parameter when doing the actual
* subscription update. The recommended way to get only the prorations being
* previewed is to consider only proration line items where
* <code>period[start]</code> is equal to the
* <code>subscription_details.proration_date</code> value passed in the request.
*
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Invoice
*/
public function createPreview($params = null, $opts = null)
{
return $this->request('post', '/v1/invoices/create_preview', $params, $opts);
}

/**
* Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to
* delete invoices that are no longer in a draft state will fail; once an invoice
Expand Down
4 changes: 4 additions & 0 deletions lib/Service/Issuing/AuthorizationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function all($params = null, $opts = null)
* href="/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
* directly to the webhook request to approve an authorization</a>.
*
* @deprecated this method is deprecated, please refer to the description for details
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
Expand All @@ -58,6 +60,8 @@ public function approve($id, $params = null, $opts = null)
* href="/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
* directly to the webhook request to decline an authorization</a>.
*
* @deprecated this method is deprecated, please refer to the description for details
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
Expand Down

0 comments on commit 8782897

Please sign in to comment.