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

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 @@
v406
v413
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
require __DIR__ . '/lib/Service/SubscriptionScheduleService.php';
require __DIR__ . '/lib/Service/SubscriptionService.php';
require __DIR__ . '/lib/Service/Tax/CalculationService.php';
require __DIR__ . '/lib/Service/Tax/SettingService.php';
require __DIR__ . '/lib/Service/Tax/TaxServiceFactory.php';
require __DIR__ . '/lib/Service/Tax/TransactionService.php';
require __DIR__ . '/lib/Service/TaxCodeService.php';
Expand Down Expand Up @@ -263,6 +264,7 @@
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/Tax/Calculation.php';
require __DIR__ . '/lib/Tax/CalculationLineItem.php';
require __DIR__ . '/lib/Tax/Settings.php';
require __DIR__ . '/lib/Tax/Transaction.php';
require __DIR__ . '/lib/Tax/TransactionLineItem.php';
require __DIR__ . '/lib/TaxCode.php';
Expand Down
1 change: 1 addition & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class ErrorObject extends StripeObject
const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const CODE_INVALID_NUMBER = 'invalid_number';
const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
const CODE_INVALID_TAX_LOCATION = 'invalid_tax_location';
const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items';
const CODE_INVOICE_NO_PAYMENT_METHOD_TYPES = 'invoice_no_payment_method_types';
const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items';
Expand Down
1 change: 1 addition & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class Event extends ApiResource
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TAX_SETTINGS_UPDATED = 'tax.settings.updated';
const TAX_RATE_CREATED = 'tax_rate.created';
const TAX_RATE_UPDATED = 'tax_rate.updated';
const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed';
Expand Down
39 changes: 39 additions & 0 deletions lib/Service/Tax/SettingService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Tax;

class SettingService extends \Stripe\Service\AbstractService
anniel-stripe marked this conversation as resolved.
Show resolved Hide resolved
{
/**
* Retrieves Tax <code>Settings</code> for a merchant.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Settings
*/
public function retrieve($params = null, $opts = null)
{
return $this->request('get', '/v1/tax/settings', $params, $opts);
}

/**
* Updates Tax <code>Settings</code> parameters used in tax calculations. All
* parameters are editable but none can be removed once set.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Settings
*/
public function update($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/settings', $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/Tax/TaxServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Service factory class for API resources in the Tax namespace.
*
* @property CalculationService $calculations
* @property SettingService $settings
* @property TransactionService $transactions
*/
class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
Expand All @@ -17,6 +18,7 @@ class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
*/
private static $classMap = [
'calculations' => CalculationService::class,
'settings' => SettingService::class,
'transactions' => TransactionService::class,
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Tax/CalculationLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @property int $amount The line item amount in integer cents. If <code>tax_behavior=inclusive</code>, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
* @property int $amount_tax The amount of tax calculated for this line item, in integer cents.
* @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|string $product A Product ID.
* @property null|string $product The ID of an existing <a href="https://stripe.com/docs/api/products/object">Product</a>.
* @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed.
* @property null|string $reference A custom identifier for this line item.
* @property string $tax_behavior Specifies whether the <code>amount</code> includes taxes. If <code>tax_behavior=inclusive</code>, then the amount includes taxes.
Expand Down
28 changes: 28 additions & 0 deletions lib/Tax/Settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Tax;

/**
* You can use Tax <code>Settings</code> to manage configurations used by Stripe Tax calculations.
*
* Related guide: <a href="https://stripe.com/docs/tax/settings-api">Using the Settings API</a>
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property \Stripe\StripeObject $defaults
* @property null|\Stripe\StripeObject $head_office The place where your business is located.
* @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 <code>active</code> status indicates you have all required settings to calculate tax. A status can transition out of <code>active</code> when new required settings are introduced.
* @property \Stripe\StripeObject $status_details
*/
class Settings extends \Stripe\SingletonApiResource
{
const OBJECT_NAME = 'tax.settings';

use \Stripe\ApiOperations\SingletonRetrieve;
use \Stripe\ApiOperations\Update;

const STATUS_ACTIVE = 'active';
const STATUS_PENDING = 'pending';
}
1 change: 1 addition & 0 deletions lib/Tax/TransactionLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @property int $amount_tax The amount of tax calculated for this line item, in integer cents.
* @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 null|string $product The ID of an existing <a href="https://stripe.com/docs/api/products/object">Product</a>.
* @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed.
* @property string $reference A custom identifier for this line item in the transaction.
* @property null|\Stripe\StripeObject $reversal If <code>type=reversal</code>, contains information about what was reversed.
Expand Down
1 change: 1 addition & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class ObjectTypes
\Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
\Stripe\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class,
\Stripe\Tax\CalculationLineItem::OBJECT_NAME => \Stripe\Tax\CalculationLineItem::class,
\Stripe\Tax\Settings::OBJECT_NAME => \Stripe\Tax\Settings::class,
\Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class,
\Stripe\Tax\TransactionLineItem::OBJECT_NAME => \Stripe\Tax\TransactionLineItem::class,
\Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
Expand Down