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 (new) #1458

Merged
merged 6 commits into from
Mar 23, 2023
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 @@
v261
v276
7 changes: 7 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@
require __DIR__ . '/lib/Subscription.php';
require __DIR__ . '/lib/SubscriptionItem.php';
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/Tax/Calculation.php';
require __DIR__ . '/lib/Tax/CalculationLineItem.php';
require __DIR__ . '/lib/Tax/Transaction.php';
require __DIR__ . '/lib/Tax/TransactionLineItem.php';
require __DIR__ . '/lib/TaxCode.php';
require __DIR__ . '/lib/TaxId.php';
require __DIR__ . '/lib/TaxRate.php';
Expand Down Expand Up @@ -241,6 +245,8 @@
require __DIR__ . '/lib/Service/SubscriptionService.php';
require __DIR__ . '/lib/Service/SubscriptionItemService.php';
require __DIR__ . '/lib/Service/SubscriptionScheduleService.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/Terminal/ConfigurationService.php';
Expand Down Expand Up @@ -283,6 +289,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
1 change: 1 addition & 0 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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 \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 2 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>payment</code> or <code>subscription</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
2 changes: 2 additions & 0 deletions lib/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @property SubscriptionItemService $subscriptionItems
* @property SubscriptionService $subscriptions
* @property SubscriptionScheduleService $subscriptionSchedules
* @property Tax\TaxServiceFactory $tax
* @property TaxCodeService $taxCodes
* @property TaxRateService $taxRates
* @property Terminal\TerminalServiceFactory $terminal
Expand Down Expand Up @@ -119,6 +120,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'subscriptionItems' => SubscriptionItemService::class,
'subscriptions' => SubscriptionService::class,
'subscriptionSchedules' => SubscriptionScheduleService::class,
'tax' => Tax\TaxServiceFactory::class,
'taxCodes' => TaxCodeService::class,
'taxRates' => TaxRateService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
Expand Down
39 changes: 39 additions & 0 deletions lib/Service/Tax/CalculationService.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 CalculationService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a persisted tax calculation as a collection.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem>
*/
public function allLineItems($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/tax/calculations/%s/line_items', $id), $params, $opts);
}

/**
* Calculates tax based on input and returns a Tax <code>Calculation</code> object.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Calculation
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/calculations', $params, $opts);
}
}
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;
}
}
85 changes: 85 additions & 0 deletions lib/Service/Tax/TransactionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\Tax;

class TransactionService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a committed standalone transaction as a collection.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Tax\TransactionLineItem>
*/
public function allLineItems($id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/tax/transactions/%s/line_items', $id), $params, $opts);
}

/**
* Creates a Tax <code>Transaction</code> from a calculation.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/transactions', $params, $opts);
}

/**
* Creates a Tax <code>Transaction</code> from a calculation.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction
*/
public function createFromCalculation($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/transactions/create_from_calculation', $params, $opts);
}

/**
* 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\Tax\Transaction
*/
public function createReversal($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/transactions/create_reversal', $params, $opts);
}

/**
* Retrieves a Tax <code>Transaction</code> object.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax/transactions/%s', $id), $params, $opts);
}
}
1 change: 1 addition & 0 deletions lib/SetupIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* @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 SetupIntent.
* @property null|bool $attach_to_self <p>If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.</p><p>It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.</p>
* @property null|\Stripe\StripeObject $automatic_payment_methods Settings for automatic payment methods compatible with this Setup Intent
* @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of <code>abandoned</code>, <code>requested_by_customer</code>, or <code>duplicate</code>.
* @property null|string $client_secret <p>The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.</p><p>The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.</p>
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
1 change: 1 addition & 0 deletions lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @property \Stripe\Service\SubscriptionItemService $subscriptionItems
* @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
* @property \Stripe\Service\SubscriptionService $subscriptions
* @property \Stripe\Service\Tax\TaxServiceFactory $tax
* @property \Stripe\Service\TaxCodeService $taxCodes
* @property \Stripe\Service\TaxRateService $taxRates
* @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
Expand Down
50 changes: 50 additions & 0 deletions lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Tax;

/**
* A Tax <code>Calculation</code> allows you to calculate the tax to collect from
* your customer.
*
* @property null|string $id Unique identifier for the calculation.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount_total Total after taxes.
* @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 $customer The ID of an existing <a href="https://stripe.com/docs/api/customers/object">Customer</a> used for the resource.
* @property \Stripe\StripeObject $customer_details
* @property null|int $expires_at Timestamp of date at which the tax calculation will expire.
* @property null|\Stripe\Collection<\Stripe\Tax\CalculationLineItem> $line_items The list of items the customer is purchasing.
* @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 $shipping_cost The shipping cost details for the calculation.
* @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.
*/
class Calculation extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.calculation';

use \Stripe\ApiOperations\Create;

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

return $obj;
}
}
26 changes: 26 additions & 0 deletions lib/Tax/CalculationLineItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Tax;

/**
* @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 $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 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.
* @property null|\Stripe\StripeObject[] $tax_breakdown Detailed account of taxes relevant to this line item.
* @property string $tax_code The <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID used for this resource.
*/
class CalculationLineItem extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.calculation_line_item';

const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive';
const TAX_BEHAVIOR_INCLUSIVE = 'inclusive';
}
89 changes: 89 additions & 0 deletions lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Tax;

/**
* A Tax transaction records the tax collected from or refunded to your customer.
*
* @property string $id Unique identifier for the transaction.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @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 $customer The ID of an existing <a href="https://stripe.com/docs/api/customers/object">Customer</a> used for the resource.
* @property \Stripe\StripeObject $customer_details
* @property null|\Stripe\Collection<\Stripe\Tax\TransactionLineItem> $line_items The tax collected or refunded, by line item.
* @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 string $reference A custom unique identifier, such as 'myOrder_123'.
* @property null|\Stripe\StripeObject $reversal If <code>type=reversal</code>, contains information about what was reversed.
* @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the transaction.
* @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 Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.transaction';

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

const TYPE_REVERSAL = 'reversal';
const TYPE_TRANSACTION = 'transaction';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction the created transaction
*/
public static function createFromCalculation($params = null, $opts = null)
{
$url = static::classUrl() . '/create_from_calculation';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction the created transaction
*/
public static function createReversal($params = null, $opts = null)
{
$url = static::classUrl() . '/create_reversal';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

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

return $obj;
}
}
Loading