From 25d02bc9806fbf8703fe1353af3bd405c915ddda Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:32:32 +0000 Subject: [PATCH 1/5] Update generated code for v832 --- OPENAPI_VERSION | 2 +- lib/TaxRate.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 30af1cbc1..e86d803f6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v828 \ No newline at end of file +v832 \ No newline at end of file diff --git a/lib/TaxRate.php b/lib/TaxRate.php index 1afc73749..f0a888943 100644 --- a/lib/TaxRate.php +++ b/lib/TaxRate.php @@ -53,6 +53,5 @@ class TaxRate extends ApiResource const TAX_TYPE_QST = 'qst'; const TAX_TYPE_RST = 'rst'; const TAX_TYPE_SALES_TAX = 'sales_tax'; - const TAX_TYPE_SERVICE_TAX = 'service_tax'; const TAX_TYPE_VAT = 'vat'; } From 6a06fa1d49a35509b9c6ac706f44b5cf138015b8 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 19:12:22 +0000 Subject: [PATCH 2/5] Update generated code for v833 --- OPENAPI_VERSION | 2 +- lib/InvoiceLineItem.php | 2 ++ lib/Service/InvoiceService.php | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e86d803f6..c2f1f3583 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v832 \ No newline at end of file +v833 \ No newline at end of file diff --git a/lib/InvoiceLineItem.php b/lib/InvoiceLineItem.php index ba4ce3dd5..15eb3212c 100644 --- a/lib/InvoiceLineItem.php +++ b/lib/InvoiceLineItem.php @@ -34,4 +34,6 @@ class InvoiceLineItem extends ApiResource { const OBJECT_NAME = 'line_item'; + + use ApiOperations\Update; } diff --git a/lib/Service/InvoiceService.php b/lib/Service/InvoiceService.php index 6bd77a287..11bb869e0 100644 --- a/lib/Service/InvoiceService.php +++ b/lib/Service/InvoiceService.php @@ -275,6 +275,28 @@ public function update($id, $params = null, $opts = null) return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); } + /** + * Updates an invoice’s line item. Some fields, such as tax_amounts, + * only live on the invoice line item, so they can only be updated through this + * endpoint. Other fields, such as amount, live on both the invoice + * item and the invoice line item, so updates on this endpoint will propagate to + * the invoice item as well. Updating an invoice’s line item is only possible + * before the invoice is finalized. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceLineItem + */ + public function updateLine($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/lines/%s', $parentId, $id), $params, $opts); + } + /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is * similar to deletion, however it only applies to From 7ae8dfa94da6aecdbc88693d9ddd99c55bdb4746 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:30:50 +0000 Subject: [PATCH 3/5] Update generated code for v840 --- OPENAPI_VERSION | 2 +- lib/Identity/VerificationReport.php | 1 + lib/Identity/VerificationSession.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c2f1f3583..e3b365910 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v833 \ No newline at end of file +v840 \ No newline at end of file diff --git a/lib/Identity/VerificationReport.php b/lib/Identity/VerificationReport.php index 424e2d2db..2b23299b7 100644 --- a/lib/Identity/VerificationReport.php +++ b/lib/Identity/VerificationReport.php @@ -19,6 +19,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 $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|\Stripe\StripeObject $document Result from a document check * @property null|\Stripe\StripeObject $id_number Result from an id_number check diff --git a/lib/Identity/VerificationSession.php b/lib/Identity/VerificationSession.php index f1102ad5a..2539c27ad 100644 --- a/lib/Identity/VerificationSession.php +++ b/lib/Identity/VerificationSession.php @@ -19,6 +19,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 $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. * @property null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. From 75feef5f67238ba4fa3e794768b525cd2111a32b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:44:12 +0000 Subject: [PATCH 4/5] Update generated code for v840 --- init.php | 1 + lib/Service/CoreServiceFactory.php | 2 + lib/Service/TaxIdService.php | 76 ++++++++++++++++++++++++++++++ lib/StripeClient.php | 1 + lib/TaxId.php | 40 ++-------------- 5 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 lib/Service/TaxIdService.php diff --git a/init.php b/init.php index 28aab4049..2500ca394 100644 --- a/init.php +++ b/init.php @@ -238,6 +238,7 @@ require __DIR__ . '/lib/Service/Tax/TaxServiceFactory.php'; require __DIR__ . '/lib/Service/Tax/TransactionService.php'; require __DIR__ . '/lib/Service/TaxCodeService.php'; +require __DIR__ . '/lib/Service/TaxIdService.php'; require __DIR__ . '/lib/Service/TaxRateService.php'; require __DIR__ . '/lib/Service/Terminal/ConfigurationService.php'; require __DIR__ . '/lib/Service/Terminal/ConnectionTokenService.php'; diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index fd372479a..39891109a 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -61,6 +61,7 @@ * @property SubscriptionScheduleService $subscriptionSchedules * @property Tax\TaxServiceFactory $tax * @property TaxCodeService $taxCodes + * @property TaxIdService $taxIds * @property TaxRateService $taxRates * @property Terminal\TerminalServiceFactory $terminal * @property TestHelpers\TestHelpersServiceFactory $testHelpers @@ -133,6 +134,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'subscriptionSchedules' => SubscriptionScheduleService::class, 'tax' => Tax\TaxServiceFactory::class, 'taxCodes' => TaxCodeService::class, + 'taxIds' => TaxIdService::class, 'taxRates' => TaxRateService::class, 'terminal' => Terminal\TerminalServiceFactory::class, 'testHelpers' => TestHelpers\TestHelpersServiceFactory::class, diff --git a/lib/Service/TaxIdService.php b/lib/Service/TaxIdService.php new file mode 100644 index 000000000..a12644fe1 --- /dev/null +++ b/lib/Service/TaxIdService.php @@ -0,0 +1,76 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax_ids', $params, $opts); + } + + /** + * Creates a new account or customer tax_id object. + * + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tax_ids', $params, $opts); + } + + /** + * Deletes an existing account or customer tax_id object. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/tax_ids/%s', $id), $params, $opts); + } + + /** + * Retrieves an account or customer tax_id object. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_ids/%s', $id), $params, $opts); + } +} diff --git a/lib/StripeClient.php b/lib/StripeClient.php index 5d309e222..013693431 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -61,6 +61,7 @@ * @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules * @property \Stripe\Service\Tax\TaxServiceFactory $tax * @property \Stripe\Service\TaxCodeService $taxCodes + * @property \Stripe\Service\TaxIdService $taxIds * @property \Stripe\Service\TaxRateService $taxRates * @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal * @property \Stripe\Service\TestHelpers\TestHelpersServiceFactory $testHelpers diff --git a/lib/TaxId.php b/lib/TaxId.php index 71ce1d710..2827d9c2a 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -25,7 +25,10 @@ class TaxId extends ApiResource { const OBJECT_NAME = 'tax_id'; + use ApiOperations\All; + use ApiOperations\Create; use ApiOperations\Delete; + use ApiOperations\Retrieve; const TYPE_AD_NRT = 'ad_nrt'; const TYPE_AE_TRN = 'ae_trn'; @@ -100,41 +103,4 @@ class TaxId extends ApiResource const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; const VERIFICATION_STATUS_VERIFIED = 'verified'; - - /** - * @return string the API URL for this tax id - */ - public function instanceUrl() - { - $id = $this['id']; - $customer = $this['customer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - "Could not determine which URL to request: class instance has invalid ID: {$id}" - ); - } - $id = Util\Util::utf8($id); - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - $extn = \urlencode($id); - - return "{$base}/{$customerExtn}/tax_ids/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . - "a tax ID using `Customer::retrieveTaxId('customer_id', " . - "'tax_id_id')`."; - - throw new Exception\BadMethodCallException($msg); - } } From b27c8c732fc759eda553e1403701de3212691c0b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 22:04:09 +0000 Subject: [PATCH 5/5] Update generated code for v840 --- lib/TaxRate.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/TaxRate.php b/lib/TaxRate.php index f0a888943..1afc73749 100644 --- a/lib/TaxRate.php +++ b/lib/TaxRate.php @@ -53,5 +53,6 @@ class TaxRate extends ApiResource const TAX_TYPE_QST = 'qst'; const TAX_TYPE_RST = 'rst'; const TAX_TYPE_SALES_TAX = 'sales_tax'; + const TAX_TYPE_SERVICE_TAX = 'service_tax'; const TAX_TYPE_VAT = 'vat'; }