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

Merged
merged 17 commits into from
Feb 16, 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 13.11.0 - 2024-02-15
* [#1639](https://github.com/stripe/stripe-php/pull/1639) Update generated code
* Add support for `networks` on `Card`
* Add support for new value `financial_connections.account.refreshed_ownership` on enum `Event.type`
* [#1648](https://github.com/stripe/stripe-php/pull/1648) Remove broken methods on CustomerCashBalanceTransaction
* Bugfix: remove support for `CustomerCashBalanceTransaction::all` and `CustomerCashBalanceTransaction::retrieve`. These methods were included in the library unintentionally and never functioned.
* [#1647](https://github.com/stripe/stripe-php/pull/1647) Fix \Stripe\Tax\Settings::update
* [#1646](https://github.com/stripe/stripe-php/pull/1646) Add more specific PHPDoc and Psalm type for RequestOptions arrays on services

## 13.11.0-beta.1 - 2024-02-01
* [#1637](https://github.com/stripe/stripe-php/pull/1637) Update generated code for beta
* Add support for new resources `Entitlements.Event` and `Entitlements.Feature`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v808
v831
6 changes: 0 additions & 6 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@
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';
Expand All @@ -127,7 +125,6 @@
require __DIR__ . '/lib/File.php';
require __DIR__ . '/lib/FileLink.php';
require __DIR__ . '/lib/FinancialConnections/Account.php';
require __DIR__ . '/lib/FinancialConnections/AccountInferredBalance.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwner.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwnership.php';
require __DIR__ . '/lib/FinancialConnections/Session.php';
Expand All @@ -140,7 +137,6 @@
require __DIR__ . '/lib/Invoice.php';
require __DIR__ . '/lib/InvoiceItem.php';
require __DIR__ . '/lib/InvoiceLineItem.php';
require __DIR__ . '/lib/InvoicePayment.php';
require __DIR__ . '/lib/Issuing/Authorization.php';
require __DIR__ . '/lib/Issuing/Card.php';
require __DIR__ . '/lib/Issuing/Cardholder.php';
Expand Down Expand Up @@ -169,8 +165,6 @@
require __DIR__ . '/lib/Quote.php';
require __DIR__ . '/lib/QuoteLine.php';
require __DIR__ . '/lib/QuotePhase.php';
require __DIR__ . '/lib/QuotePreviewInvoice.php';
require __DIR__ . '/lib/QuotePreviewSubscriptionSchedule.php';
require __DIR__ . '/lib/Radar/EarlyFraudWarning.php';
require __DIR__ . '/lib/Radar/ValueList.php';
require __DIR__ . '/lib/Radar/ValueListItem.php';
Expand Down
1 change: 1 addition & 0 deletions lib/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* @property string $last4 The last four digits of the card.
* @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|string $name Cardholder name.
* @property null|\Stripe\StripeObject $networks
* @property null|string $status For external accounts that are cards, possible values are <code>new</code> and <code>errored</code>. If a payout fails, the status is set to <code>errored</code> and <a href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> are stopped until account details are updated.
* @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be <code>android_pay</code> (includes Google Pay), <code>apple_pay</code>, <code>masterpass</code>, <code>visa_checkout</code>, or null.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/ConfirmationToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @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>
Expand Down
124 changes: 62 additions & 62 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,37 +134,6 @@
return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts);
}

const PATH_CASH_BALANCE = '/cash_balance';

/**
* @param string $id the ID of the customer to which the cash balance belongs
* @param null|array $params
* @param null|array|string $opts
* @param mixed $cashBalanceId
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CashBalance
*/
public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
}

/**
* @param string $id the ID of the customer to which the cash balance belongs
* @param null|array $params
* @param null|array|string $opts
* @param mixed $cashBalanceId
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CashBalance
*/
public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
}
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';

/**
Expand Down Expand Up @@ -254,37 +223,6 @@
{
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $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);
}
const PATH_SOURCES = '/sources';

/**
Expand Down Expand Up @@ -359,6 +297,37 @@
{
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
const PATH_CASH_BALANCE = '/cash_balance';

/**
* @param string $id the ID of the customer to which the cash balance belongs
* @param null|array $params
* @param null|array|string $opts
* @param mixed $cashBalanceId
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CashBalance
*/
public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
}

/**
* @param string $id the ID of the customer to which the cash balance belongs
* @param null|array $params
* @param null|array|string $opts
* @param mixed $cashBalanceId
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CashBalance
*/
public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts);
}
const PATH_TAX_IDS = '/tax_ids';

/**
Expand Down Expand Up @@ -418,4 +387,35 @@
{
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)

Check failure on line 401 in lib/Customer.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Method Stripe\Customer::allEntitlements() has invalid return type Stripe\CustomerEntitlement.

Check failure on line 401 in lib/Customer.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Type Stripe\CustomerEntitlement in generic type Stripe\Collection<Stripe\CustomerEntitlement> in PHPDoc tag @return is not subtype of template type TStripeObject of Stripe\StripeObject of class Stripe\Collection.
{
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)

Check failure on line 417 in lib/Customer.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Method Stripe\Customer::retrieveEntitlementSummary() has invalid return type Stripe\CustomerEntitlementSummary.
{
return self::_retrieveNestedResource($id, static::PATH_ENTITLEMENT_SUMMARY, $params, $opts);
}
}
3 changes: 0 additions & 3 deletions lib/CustomerCashBalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class CustomerCashBalanceTransaction extends ApiResource
{
const OBJECT_NAME = 'customer_cash_balance_transaction';

use ApiOperations\All;
use ApiOperations\Retrieve;

const TYPE_ADJUSTED_FOR_OVERDRAFT = 'adjusted_for_overdraft';
const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment';
const TYPE_FUNDED = 'funded';
Expand Down
26 changes: 0 additions & 26 deletions lib/CustomerEntitlement.php

This file was deleted.

20 changes: 0 additions & 20 deletions lib/CustomerEntitlementSummary.php

This file was deleted.

20 changes: 0 additions & 20 deletions lib/FinancialConnections/AccountInferredBalance.php

This file was deleted.

32 changes: 16 additions & 16 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
* @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
* @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.
* @property \Stripe\StripeObject $payment_settings
* @property null|\Stripe\Collection<\Stripe\InvoicePayment> $payments Payments for this invoice
* @property null|\Stripe\Collection<\Stripe\StripeObject> $payments Payments for this invoice
* @property int $period_end End of the usage period during which invoice items were added to this invoice.
* @property int $period_start Start of the usage period during which invoice items were added to this invoice.
* @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice.
Expand Down Expand Up @@ -335,49 +335,49 @@
return static::_requestPage($url, \Stripe\SearchResult::class, $params, $opts);
}

const PATH_PAYMENTS = '/payments';
const PATH_LINES = '/lines';

/**
* @param string $id the ID of the invoice on which to retrieve the invoice payments
* @param string $id the ID of the invoice on which to retrieve the invoice line items
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\InvoicePayment> the list of invoice payments
* @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of invoice line items
*/
public static function allPayments($id, $params = null, $opts = null)
public static function allLines($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_PAYMENTS, $params, $opts);
return self::_allNestedResources($id, static::PATH_LINES, $params, $opts);
}
const PATH_PAYMENTS = '/payments';

/**
* @param string $id the ID of the invoice to which the invoice payment belongs
* @param string $paymentId the ID of the invoice payment to retrieve
* @param string $id the ID of the invoice on which to retrieve the invoice payments
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\InvoicePayment
* @return \Stripe\Collection<\Stripe\InvoicePayment> the list of invoice payments
*/
public static function retrievePayment($id, $paymentId, $params = null, $opts = null)
public static function allPayments($id, $params = null, $opts = null)

Check failure on line 364 in lib/Invoice.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Method Stripe\Invoice::allPayments() has invalid return type Stripe\InvoicePayment.

Check failure on line 364 in lib/Invoice.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Type Stripe\InvoicePayment in generic type Stripe\Collection<Stripe\InvoicePayment> in PHPDoc tag @return is not subtype of template type TStripeObject of Stripe\StripeObject of class Stripe\Collection.
{
return self::_retrieveNestedResource($id, static::PATH_PAYMENTS, $paymentId, $params, $opts);
return self::_allNestedResources($id, static::PATH_PAYMENTS, $params, $opts);
}
const PATH_LINES = '/lines';

/**
* @param string $id the ID of the invoice on which to retrieve the invoice line items
* @param string $id the ID of the invoice to which the invoice payment belongs
* @param string $paymentId the ID of the invoice payment to retrieve
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of invoice line items
* @return \Stripe\InvoicePayment
*/
public static function allLines($id, $params = null, $opts = null)
public static function retrievePayment($id, $paymentId, $params = null, $opts = null)

Check failure on line 379 in lib/Invoice.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Method Stripe\Invoice::retrievePayment() has invalid return type Stripe\InvoicePayment.
{
return self::_allNestedResources($id, static::PATH_LINES, $params, $opts);
return self::_retrieveNestedResource($id, static::PATH_PAYMENTS, $paymentId, $params, $opts);
}
}
1 change: 1 addition & 0 deletions lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item.
* @property bool $discountable If true, discounts will apply to this line item. Always false for prorations.
* @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
* @property null|string $invoice The ID of the invoice that contains this line item.
* @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated with this line item 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 null|\Stripe\StripeObject[] $margin_amounts The amount of margin calculated per margin for this line item.
Expand Down
Loading
Loading