Skip to content

Commit

Permalink
API Updates for beta branch (#1414)
Browse files Browse the repository at this point in the history
* Codegen for openapi v216 (#1413)

* Bump version to 10.3.0

* Set version to 10.3.0 to simplify merge

* Reset version to 10.3.0-beta.1

* Codegen for openapi v216
  • Loading branch information
richardm-stripe authored Dec 22, 2022
1 parent d603b5b commit d525a98
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 10.3.0 - 2022-12-22
* [#1413](https://github.com/stripe/stripe-php/pull/1413) API Updates
Change `CheckoutSession.cancel_url` to be nullable.

## 10.3.0-beta.1 - 2022-12-15
* [#1412](https://github.com/stripe/stripe-php/pull/1412) 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 @@
v215
v216
9 changes: 5 additions & 4 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@
require __DIR__ . '/lib/Subscription.php';
require __DIR__ . '/lib/SubscriptionItem.php';
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/TaxCalculation.php';
require __DIR__ . '/lib/Tax/Calculation.php';
require __DIR__ . '/lib/Tax/Transaction.php';
require __DIR__ . '/lib/TaxCode.php';
require __DIR__ . '/lib/TaxId.php';
require __DIR__ . '/lib/TaxRate.php';
require __DIR__ . '/lib/TaxTransaction.php';
require __DIR__ . '/lib/Terminal/Configuration.php';
require __DIR__ . '/lib/Terminal/ConnectionToken.php';
require __DIR__ . '/lib/Terminal/Location.php';
Expand Down Expand Up @@ -259,10 +259,10 @@
require __DIR__ . '/lib/Service/SubscriptionService.php';
require __DIR__ . '/lib/Service/SubscriptionItemService.php';
require __DIR__ . '/lib/Service/SubscriptionScheduleService.php';
require __DIR__ . '/lib/Service/TaxCalculationService.php';
require __DIR__ . '/lib/Service/Tax/CalculationService.php';
require __DIR__ . '/lib/Service/Tax/TransactionService.php';
require __DIR__ . '/lib/Service/TaxCodeService.php';
require __DIR__ . '/lib/Service/TaxRateService.php';
require __DIR__ . '/lib/Service/TaxTransactionService.php';
require __DIR__ . '/lib/Service/Terminal/ConfigurationService.php';
require __DIR__ . '/lib/Service/Terminal/ConnectionTokenService.php';
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
Expand Down Expand Up @@ -305,6 +305,7 @@
require __DIR__ . '/lib/Service/Radar/RadarServiceFactory.php';
require __DIR__ . '/lib/Service/Reporting/ReportingServiceFactory.php';
require __DIR__ . '/lib/Service/Sigma/SigmaServiceFactory.php';
require __DIR__ . '/lib/Service/Tax/TaxServiceFactory.php';
require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @property null|int $amount_total Total of all items after discounts and taxes are applied.
* @property \Stripe\StripeObject $automatic_tax
* @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address.
* @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website.
* @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.
* @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems.
* @property null|\Stripe\StripeObject $consent Results of <code>consent_collection</code> for this session.
* @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers.
Expand Down
6 changes: 2 additions & 4 deletions lib/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
* @property SubscriptionItemService $subscriptionItems
* @property SubscriptionService $subscriptions
* @property SubscriptionScheduleService $subscriptionSchedules
* @property TaxCalculationService $taxCalculations
* @property Tax\TaxServiceFactory $tax
* @property TaxCodeService $taxCodes
* @property TaxRateService $taxRates
* @property TaxTransactionService $taxTransactions
* @property Terminal\TerminalServiceFactory $terminal
* @property TestHelpers\TestHelpersServiceFactory $testHelpers
* @property TokenService $tokens
Expand Down Expand Up @@ -131,10 +130,9 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'subscriptionItems' => SubscriptionItemService::class,
'subscriptions' => SubscriptionService::class,
'subscriptionSchedules' => SubscriptionScheduleService::class,
'taxCalculations' => TaxCalculationService::class,
'tax' => Tax\TaxServiceFactory::class,
'taxCodes' => TaxCodeService::class,
'taxRates' => TaxRateService::class,
'taxTransactions' => TaxTransactionService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
'testHelpers' => TestHelpers\TestHelpersServiceFactory::class,
'tokens' => TokenService::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// File generated from our OpenAPI spec

namespace Stripe\Service;
namespace Stripe\Service\Tax;

class TaxCalculationService extends \Stripe\Service\AbstractService
class CalculationService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a persisted tax calculation as a collection.
Expand All @@ -30,7 +30,7 @@ public function allLineItems($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxCalculation
* @return \Stripe\Tax\Calculation
*/
public function create($params = null, $opts = null)
{
Expand Down
27 changes: 27 additions & 0 deletions lib/Service/Tax/TaxServiceFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Tax;

/**
* Service factory class for API resources in the Tax namespace.
*
* @property CalculationService $calculations
* @property TransactionService $transactions
*/
class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'calculations' => CalculationService::class,
'transactions' => TransactionService::class,
];

protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// File generated from our OpenAPI spec

namespace Stripe\Service;
namespace Stripe\Service\Tax;

class TaxTransactionService extends \Stripe\Service\AbstractService
class TransactionService extends \Stripe\Service\AbstractService
{
/**
* Creates a Tax <code>Transaction</code> from a calculation.
Expand All @@ -14,23 +14,22 @@ class TaxTransactionService extends \Stripe\Service\AbstractService
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxTransaction
* @return \Stripe\Tax\Transaction
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/transactions', $params, $opts);
}

/**
* Creates a partial or full reversal of a previously created
* <code>Transaction</code>.
* Partially or fully reverses a previously created <code>Transaction</code>.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxTransaction
* @return \Stripe\Tax\Transaction
*/
public function createReversal($params = null, $opts = null)
{
Expand All @@ -46,7 +45,7 @@ public function createReversal($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxTransaction
* @return \Stripe\Tax\Transaction
*/
public function retrieve($id, $params = null, $opts = null)
{
Expand Down
3 changes: 1 addition & 2 deletions lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
* @property \Stripe\Service\SubscriptionItemService $subscriptionItems
* @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
* @property \Stripe\Service\SubscriptionService $subscriptions
* @property \Stripe\Service\TaxCalculationService $taxCalculations
* @property \Stripe\Service\Tax\TaxServiceFactory $tax
* @property \Stripe\Service\TaxCodeService $taxCodes
* @property \Stripe\Service\TaxRateService $taxRates
* @property \Stripe\Service\TaxTransactionService $taxTransactions
* @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
* @property \Stripe\Service\TestHelpers\TestHelpersServiceFactory $testHelpers
* @property \Stripe\Service\TokenService $tokens
Expand Down
2 changes: 1 addition & 1 deletion lib/SubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is <code>active</code>.
* @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> and <code>cancel</code>.
* @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 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
6 changes: 3 additions & 3 deletions lib/TaxCalculation.php → lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// File generated from our OpenAPI spec

namespace Stripe;
namespace Stripe\Tax;

/**
* A Tax <code>Calculation</code> allows you to calculate the tax to collect from
Expand All @@ -23,11 +23,11 @@
* @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.
*/
class TaxCalculation extends ApiResource
class Calculation extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.calculation';

use ApiOperations\Create;
use \Stripe\ApiOperations\Create;

/**
* @param string $id
Expand Down
10 changes: 5 additions & 5 deletions lib/TaxTransaction.php → lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// File generated from our OpenAPI spec

namespace Stripe;
namespace Stripe\Tax;

/**
* A Tax <code>Transaction</code> records the tax collected from or refunded to
Expand All @@ -22,12 +22,12 @@
* @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
* @property string $type If <code>reversal</code>, this transaction reverses an earlier transaction.
*/
class TaxTransaction extends ApiResource
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.transaction';

use ApiOperations\Create;
use ApiOperations\Retrieve;
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;

const TYPE_REVERSAL = 'reversal';
const TYPE_TRANSACTION = 'transaction';
Expand All @@ -38,7 +38,7 @@ class TaxTransaction extends ApiResource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxTransaction the created tax transaction
* @return \Stripe\Tax\Transaction the created transaction
*/
public static function createReversal($params = null, $opts = null)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ class ObjectTypes
\Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
\Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
\Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
\Stripe\TaxCalculation::OBJECT_NAME => \Stripe\TaxCalculation::class,
\Stripe\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class,
\Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class,
\Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
\Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
\Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
\Stripe\TaxTransaction::OBJECT_NAME => \Stripe\TaxTransaction::class,
\Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class,
\Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
\Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class,
Expand Down

0 comments on commit d525a98

Please sign in to comment.