Skip to content

Commit

Permalink
Merge pull request #1451 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
API Updates for beta branch
  • Loading branch information
anniel-stripe authored Mar 9, 2023
2 parents 926186f + 0d86481 commit 0d3bbbd
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 48 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 10.9.0 - 2023-03-09
* [#1450](https://github.com/stripe/stripe-php/pull/1450) API Updates
* Add support for `cancellation_details` on `Subscription`
* Fix return types on custom methods (extends https://github.com/stripe/stripe-php/pull/1446)

* [#1446](https://github.com/stripe/stripe-php/pull/1446) stripe->customers->retrievePaymentMethod returns the wrong class (type hint)

## 10.9.0-beta.1 - 2023-03-02
* [#1448](https://github.com/stripe/stripe-php/pull/1448) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v237
v249
12 changes: 6 additions & 6 deletions lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function allPaymentMethods($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card|\Stripe\Source>
* @return \Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source>
*/
public function allSources($parentId, $params = null, $opts = null)
{
Expand Down Expand Up @@ -149,7 +149,7 @@ public function createBalanceTransaction($parentId, $params = null, $opts = null
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
* @return \Stripe\FundingInstructions
*/
public function createFundingInstructions($id, $params = null, $opts = null)
{
Expand All @@ -171,7 +171,7 @@ public function createFundingInstructions($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
* @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source
*/
public function createSource($parentId, $params = null, $opts = null)
{
Expand Down Expand Up @@ -220,7 +220,7 @@ public function delete($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
* @return \Stripe\Discount
*/
public function deleteDiscount($id, $params = null, $opts = null)
{
Expand Down Expand Up @@ -337,7 +337,7 @@ public function retrieveCashBalanceTransaction($parentId, $id, $params = null, $
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
* @return \Stripe\PaymentMethod
*/
public function retrievePaymentMethod($parentId, $id, $params = null, $opts = null)
{
Expand All @@ -354,7 +354,7 @@ public function retrievePaymentMethod($parentId, $id, $params = null, $opts = nu
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source
* @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source
*/
public function retrieveSource($parentId, $id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/QuoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function allLineItems($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\QuoteLine>
* @return \Stripe\Collection<\Stripe\Quote>
*/
public function allLines($id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/SourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function create($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Source
* @return \Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source
*/
public function detach($parentId, $id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/SubscriptionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function create($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Subscription
* @return \Stripe\Discount
*/
public function deleteDiscount($id, $params = null, $opts = null)
{
Expand Down
15 changes: 0 additions & 15 deletions lib/Service/Tax/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ public function allLineItems($id, $params = null, $opts = null)
return $this->requestCollection('get', $this->buildPath('/v1/tax/transactions/%s/line_items', $id), $params, $opts);
}

/**
* Lists Tax Transaction objects.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Tax\Transaction>
*/
public function allTransactions($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/tax/transactions', $params, $opts);
}

/**
* Creates a Tax <code>Transaction</code> from a calculation.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TestHelpers/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CustomerService extends \Stripe\Service\AbstractService
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer
* @return \Stripe\CustomerCashBalanceTransaction
*/
public function fundCashBalance($id, $params = null, $opts = null)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/Treasury/FinancialAccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function retrieve($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Treasury\FinancialAccount
* @return \Stripe\Treasury\FinancialAccountFeatures
*/
public function retrieveFeatures($id, $params = null, $opts = null)
{
Expand Down Expand Up @@ -94,7 +94,7 @@ public function update($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Treasury\FinancialAccount
* @return \Stripe\Treasury\FinancialAccountFeatures
*/
public function updateFeatures($id, $params = null, $opts = null)
{
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled
* @property bool $cancel_at_period_end If the subscription has been canceled with the <code>at_period_end</code> flag set to <code>true</code>, <code>cancel_at_period_end</code> on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
* @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with <code>cancel_at_period_end</code>, <code>canceled_at</code> will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
* @property null|\Stripe\StripeObject $cancellation_details Details about why this subscription was cancelled
* @property string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as <code>active</code>.
* @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>.
Expand Down
2 changes: 1 addition & 1 deletion lib/SubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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 null|string|\Stripe\StripeObject $application ID of the Connect Application that created the schedule.
* @property null|\Stripe\StripeObject $applies_to Details to identify the subscription schedule the quote line applies to.
* @property null|\Stripe\StripeObject $applies_to
* @property null|string $billing_behavior Configures when the subscription schedule generates prorations for phase transitions. Possible values are <code>prorate_on_next_phase</code> or <code>prorate_up_front</code> with the default being <code>prorate_on_next_phase</code>. <code>prorate_on_next_phase</code> will apply phase changes and generate prorations at transition time.<code>prorate_up_front</code> will bill for all phases within the current billing cycle up front.
* @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
* @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
Expand Down
2 changes: 1 addition & 1 deletion lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* @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 int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices.
* @property int $tax_amount_inclusive The amount of tax already included in the line item prices.
* @property \Stripe\StripeObject[] $tax_breakdown Breakdown of individual tax amounts that add up to the total.
* @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
* @property \Stripe\StripeObject[] $tax_summary Summary of individual tax amounts that add up to the total.
*/
class Calculation extends \Stripe\ApiResource
{
Expand Down
18 changes: 0 additions & 18 deletions lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,4 @@ public static function allLineItems($id, $params = null, $opts = null)

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Tax\Transaction> list of TaxProductResourceTaxTransactions
*/
public static function allTransactions($params = null, $opts = null)
{
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}
}

0 comments on commit 0d3bbbd

Please sign in to comment.