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 #1728

Merged
merged 6 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1157
v1167
2 changes: 1 addition & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property null|\Stripe\StripeObject $currency_conversion Currency conversion details for automatic currency conversion sessions
* @property null|\Stripe\StripeObject $currency_conversion Currency conversion details for <a href="https://docs.stripe.com/payments/checkout/adaptive-pricing">Adaptive Pricing</a> sessions
* @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 3 fields are supported.
* @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.
Expand Down
1 change: 1 addition & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ErrorObject extends StripeObject
const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded';
const CODE_CHARGE_DISPUTED = 'charge_disputed';
const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit';
const CODE_CHARGE_EXCEEDS_TRANSACTION_LIMIT = 'charge_exceeds_transaction_limit';
const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture';
const CODE_CHARGE_INVALID_PARAMETER = 'charge_invalid_parameter';
const CODE_CHARGE_NOT_REFUNDABLE = 'charge_not_refundable';
Expand Down
4 changes: 4 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class Event extends ApiResource
const CUSTOMER_SUBSCRIPTION_PAUSED = 'customer.subscription.paused';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
const CUSTOMER_SUBSCRIPTION_PRICE_MIGRATION_FAILED = 'customer.subscription.price_migration_failed';
const CUSTOMER_SUBSCRIPTION_RESUMED = 'customer.subscription.resumed';
const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
Expand Down Expand Up @@ -265,6 +266,7 @@ class Event extends ApiResource
const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const SUBSCRIPTION_SCHEDULE_PRICE_MIGRATION_FAILED = 'subscription_schedule.price_migration_failed';
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TAX_FORM_UPDATED = 'tax.form.updated';
Expand Down Expand Up @@ -393,6 +395,7 @@ class Event extends ApiResource
const TYPE_CUSTOMER_SUBSCRIPTION_PAUSED = 'customer.subscription.paused';
const TYPE_CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
const TYPE_CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
const TYPE_CUSTOMER_SUBSCRIPTION_PRICE_MIGRATION_FAILED = 'customer.subscription.price_migration_failed';
const TYPE_CUSTOMER_SUBSCRIPTION_RESUMED = 'customer.subscription.resumed';
const TYPE_CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
const TYPE_CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
Expand Down Expand Up @@ -528,6 +531,7 @@ class Event extends ApiResource
const TYPE_SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
const TYPE_SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
const TYPE_SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const TYPE_SUBSCRIPTION_SCHEDULE_PRICE_MIGRATION_FAILED = 'subscription_schedule.price_migration_failed';
const TYPE_SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const TYPE_SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TYPE_TAX_FORM_UPDATED = 'tax.form.updated';
Expand Down
2 changes: 1 addition & 1 deletion lib/FinancialConnections/AccountInferredBalance.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 int $as_of The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC.
* @property \Stripe\StripeObject $current <p>The balances owed to (or by) the account holder.</p><p>Each key is a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.</p><p>Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.</p>
* @property \Stripe\StripeObject $current <p>The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions.</p><p>Each key is a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.</p><p>Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.</p>
*/
class AccountInferredBalance extends \Stripe\ApiResource
{
Expand Down
17 changes: 17 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,23 @@ public function addLines($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 attached invoice
*/
public function attachPayment($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/attach_payment';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down
4 changes: 2 additions & 2 deletions lib/PaymentIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @property string $confirmation_method Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property null|string|\Stripe\Customer $customer <p>ID of the Customer this PaymentIntent belongs to, if one exists.</p><p>Payment methods attached to other Customers cannot be used with this PaymentIntent.</p><p>If present in combination with <a href="https://stripe.com/docs/api#payment_intent_object-setup_future_usage">setup_future_usage</a>, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.</p>
* @property null|string|\Stripe\Customer $customer <p>ID of the Customer this PaymentIntent belongs to, if one exists.</p><p>Payment methods attached to other Customers cannot be used with this PaymentIntent.</p><p>If <a href="https://stripe.com/docs/api#payment_intent_object-setup_future_usage">setup_future_usage</a> is set and this PaymentIntent's payment method is not <code>card_present</code>, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is <code>card_present</code> and isn't a digital wallet, then a <a href="https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a> payment method representing the card is created and attached to the Customer instead.</p>
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists.
* @property null|\Stripe\StripeObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
Expand All @@ -52,7 +52,7 @@
* @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If <code>receipt_email</code> is specified for a payment in live mode, a receipt will be sent regardless of your <a href="https://dashboard.stripe.com/account/emails">email settings</a>.
* @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any.
* @property null|string $secret_key_confirmation Indicates whether confirmation for this PaymentIntent using a secret key is <code>required</code> or <code>optional</code>.
* @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this PaymentIntent's payment method.</p><p>Providing this parameter 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. If no Customer was provided, the payment method can still be <a href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after the transaction completes.</p><p>When processing card payments, Stripe also uses <code>setup_future_usage</code> to dynamically optimize your payment flow and comply with regional legislation and network rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.</p>
* @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this PaymentIntent's payment method.</p><p>Providing this parameter 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. If no Customer was provided, the payment method can still be <a href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after the transaction completes.</p><p>If the payment method is <code>card_present</code> and isn't a digital wallet, then a <a href="https://docs.corp.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a> payment method representing the card is created and attached to the Customer instead.</p><p>When processing card payments, Stripe also uses <code>setup_future_usage</code> to dynamically optimize your payment flow and comply with regional legislation and network rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.</p>
* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent.
* @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
* @property null|string $statement_descriptor For card charges, use <a href="https://stripe.com/docs/payments/account/statement-descriptors#dynamic">statement_descriptor_suffix</a>. Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long.
Expand Down
1 change: 1 addition & 0 deletions lib/QuotePreviewSubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule.
* @property \Stripe\StripeObject $default_settings
* @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are <code>release</code> or <code>cancel</code> with the default being <code>release</code>. <code>release</code> will end the subscription schedule and keep the underlying subscription running. <code>cancel</code> will end the subscription schedule and cancel the underlying subscription.
* @property null|\Stripe\StripeObject $last_price_migration_error Details of the most recent price migration that failed for the subscription schedule.
* @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 \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases.
Expand Down
32 changes: 32 additions & 0 deletions lib/Service/InvoiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,38 @@ public function allPayments($parentId, $params = null, $opts = null)
return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/payments', $parentId), $params, $opts);
}

/**
* Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to
* the list of <code>payments</code>.
*
* For Out of Band Payment, the payment is credited to the invoice immediately,
* increasing the <code>amount_paid</code> of the invoice and subsequently
* transitioning the status of the invoice to <code>paid</code> if necessary.
*
* For the PaymentIntent, when the PaymentIntent’s status changes to
* <code>succeeded</code>, the payment is credited to the invoice, increasing its
* <code>amount_paid</code>. When the invoice is fully paid, the invoice’s status
* becomes <code>paid</code>.
*
* If the PaymentIntent’s status is already <code>succeeded</code> when it’s
* attached, it’s credited to the invoice immediately.
*
* See: <a href="/docs/invoicing/payments/create">Create an invoice payment</a> to
* learn more.
*
* @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 attachPayment($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/invoices/%s/attach_payment', $id), $params, $opts);
}

/**
* Attaches a PaymentIntent to the invoice, adding it to the list of
* <code>payments</code>. When the PaymentIntent’s status changes to
Expand Down
2 changes: 1 addition & 1 deletion lib/SetupIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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 $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
* @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended.
* @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent.
* @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. If the payment method is <code>card_present</code> and isn't a digital wallet, then the <a href="https://docs.corp.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card">generated_card</a> associated with the <code>latest_attempt</code> is attached to the Customer instead.
* @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Setup Intent.
* @property null|\Stripe\StripeObject $payment_method_options Payment method-specific configuration for this SetupIntent.
* @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* @property null|int $ended_at If the subscription has ended, the date the subscription ended.
* @property \Stripe\StripeObject $invoice_settings
* @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price.
* @property null|\Stripe\StripeObject $last_price_migration_error Details of the most recent price migration that failed for the subscription.
* @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated.
* @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 Down
1 change: 1 addition & 0 deletions lib/SubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule.
* @property \Stripe\StripeObject $default_settings
* @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are <code>release</code> or <code>cancel</code> with the default being <code>release</code>. <code>release</code> will end the subscription schedule and keep the underlying subscription running. <code>cancel</code> will end the subscription schedule and cancel the underlying subscription.
* @property null|\Stripe\StripeObject $last_price_migration_error Details of the most recent price migration that failed for the subscription schedule.
* @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 \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases.
Expand Down
Loading