This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\Tax;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class CalculationService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a tax calculation as a collection, if the
* calculation hasnt expired.
*
* @param string $id
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Collection<\Stripe\Tax\CalculationLineItem>
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
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 the input and returns a Tax <code>Calculation</code>
* object.
*
* @param null|array{currency: string, customer?: string, customer_details?: array{address?: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}, address_source?: string, ip_address?: string, tax_ids?: array{type: string, value: string}[], taxability_override?: string}, expand?: string[], line_items: array{amount: int, metadata?: array<string, string>, product?: string, quantity?: int, reference?: string, tax_behavior?: string, tax_code?: string}[], ship_from_details?: array{address: array{city?: null|string, country: string, line1?: null|string, line2?: null|string, postal_code?: null|string, state?: null|string}}, shipping_cost?: array{amount?: int, shipping_rate?: string, tax_behavior?: string, tax_code?: string}, tax_date?: int} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Calculation
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/calculations', $params, $opts);
}
/**
* Retrieves a Tax <code>Calculation</code> object, if the calculation hasnt
* expired.
*
* @param string $id
* @param null|array{expand?: string[]} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Calculation
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax/calculations/%s', $id), $params, $opts);
}
}

View File

@@ -0,0 +1,78 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\Tax;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class RegistrationService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of Tax <code>Registration</code> objects.
*
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Collection<\Stripe\Tax\Registration>
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/tax/registrations', $params, $opts);
}
/**
* Creates a new Tax <code>Registration</code> object.
*
* @param null|array{active_from: array|int|string, country: string, country_options: array{ae?: array{type: string}, al?: array{type: string}, am?: array{type: string}, ao?: array{type: string}, at?: array{standard?: array{place_of_supply_scheme: string}, type: string}, au?: array{type: string}, aw?: array{type: string}, az?: array{type: string}, ba?: array{type: string}, bb?: array{type: string}, bd?: array{type: string}, be?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bf?: array{type: string}, bg?: array{standard?: array{place_of_supply_scheme: string}, type: string}, bh?: array{type: string}, bj?: array{type: string}, bs?: array{type: string}, by?: array{type: string}, ca?: array{province_standard?: array{province: string}, type: string}, cd?: array{type: string}, ch?: array{type: string}, cl?: array{type: string}, cm?: array{type: string}, co?: array{type: string}, cr?: array{type: string}, cv?: array{type: string}, cy?: array{standard?: array{place_of_supply_scheme: string}, type: string}, cz?: array{standard?: array{place_of_supply_scheme: string}, type: string}, de?: array{standard?: array{place_of_supply_scheme: string}, type: string}, dk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ec?: array{type: string}, ee?: array{standard?: array{place_of_supply_scheme: string}, type: string}, eg?: array{type: string}, es?: array{standard?: array{place_of_supply_scheme: string}, type: string}, et?: array{type: string}, fi?: array{standard?: array{place_of_supply_scheme: string}, type: string}, fr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, gb?: array{type: string}, ge?: array{type: string}, gn?: array{type: string}, gr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hr?: array{standard?: array{place_of_supply_scheme: string}, type: string}, hu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, id?: array{type: string}, ie?: array{standard?: array{place_of_supply_scheme: string}, type: string}, in?: array{type: string}, is?: array{type: string}, it?: array{standard?: array{place_of_supply_scheme: string}, type: string}, jp?: array{type: string}, ke?: array{type: string}, kg?: array{type: string}, kh?: array{type: string}, kr?: array{type: string}, kz?: array{type: string}, la?: array{type: string}, lt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lu?: array{standard?: array{place_of_supply_scheme: string}, type: string}, lv?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ma?: array{type: string}, md?: array{type: string}, me?: array{type: string}, mk?: array{type: string}, mr?: array{type: string}, mt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, mx?: array{type: string}, my?: array{type: string}, ng?: array{type: string}, nl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, no?: array{type: string}, np?: array{type: string}, nz?: array{type: string}, om?: array{type: string}, pe?: array{type: string}, ph?: array{type: string}, pl?: array{standard?: array{place_of_supply_scheme: string}, type: string}, pt?: array{standard?: array{place_of_supply_scheme: string}, type: string}, ro?: array{standard?: array{place_of_supply_scheme: string}, type: string}, rs?: array{type: string}, ru?: array{type: string}, sa?: array{type: string}, se?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sg?: array{type: string}, si?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sk?: array{standard?: array{place_of_supply_scheme: string}, type: string}, sn?: array{type: string}, sr?: array{type: string}, th?: array{type: string}, tj?: array{type: string}, tr?: array{type: string}, tz?: array{type: string}, ug?: array{type: string}, us?: array{local_amusement_tax?: array{jurisdiction: string}, local_lease_tax?: array{jurisdiction: string}, state: string, state_sales_tax?: array{elections: array{jurisdiction?: string, type: string}[]}, type: string}, uy?: array{type: string}, uz?: array{type: string}, vn?: array{type: string}, za?: array{type: string}, zm?: array{type: string}, zw?: array{type: string}}, expand?: string[], expires_at?: int} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Registration
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/registrations', $params, $opts);
}
/**
* Returns a Tax <code>Registration</code> object.
*
* @param string $id
* @param null|array{expand?: string[]} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Registration
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax/registrations/%s', $id), $params, $opts);
}
/**
* Updates an existing Tax <code>Registration</code> object.
*
* A registration cannot be deleted after it has been created. If you wish to end a
* registration you may do so by setting <code>expires_at</code>.
*
* @param string $id
* @param null|array{active_from?: array|int|string, expand?: string[], expires_at?: null|array|int|string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Registration
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/tax/registrations/%s', $id), $params, $opts);
}
}

View File

@@ -0,0 +1,44 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\Tax;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class SettingsService extends \Stripe\Service\AbstractService
{
/**
* Retrieves Tax <code>Settings</code> for a merchant.
*
* @param null|array{expand?: string[]} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Settings
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
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{defaults?: array{tax_behavior?: string, tax_code?: string}, expand?: string[], head_office?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}}} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Settings
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function update($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/settings', $params, $opts);
}
}

View File

@@ -0,0 +1,31 @@
<?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 RegistrationService $registrations
* @property SettingsService $settings
* @property TransactionService $transactions
*/
class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'calculations' => CalculationService::class,
'registrations' => RegistrationService::class,
'settings' => SettingsService::class,
'transactions' => TransactionService::class,
];
protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}

View File

@@ -0,0 +1,76 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Service\Tax;
/**
* @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*
* @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
*/
class TransactionService extends \Stripe\Service\AbstractService
{
/**
* Retrieves the line items of a committed standalone transaction as a collection.
*
* @param string $id
* @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Collection<\Stripe\Tax\TransactionLineItem>
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
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 Transaction from a calculation, if that calculation hasnt
* expired. Calculations expire after 90 days.
*
* @param null|array{calculation: string, expand?: string[], metadata?: array<string, string>, posted_at?: int, reference: string} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Transaction
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
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{expand?: string[], flat_amount?: int, line_items?: array{amount: int, amount_tax: int, metadata?: array<string, string>, original_line_item: string, quantity?: int, reference: string}[], metadata?: array<string, string>, mode: string, original_transaction: string, reference: string, shipping_cost?: array{amount: int, amount_tax: int}} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Transaction
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
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{expand?: string[]} $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @return \Stripe\Tax\Transaction
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax/transactions/%s', $id), $params, $opts);
}
}