diff --git a/CHANGELOG.md b/CHANGELOG.md index ead737044..9f6fdd577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 10.5.0-beta.1 - 2023-01-19 * [#1427](https://github.com/stripe/stripe-php/pull/1427) API Updates for beta branch * Updated stable APIs to the latest version - * Add support for `Tax.Settings` resource. + * Add support for `Tax.Settings` resource. ## 10.4.0 - 2023-01-19 * [#1381](https://github.com/stripe/stripe-php/pull/1381) Add getService methods to StripeClient and AbstractServiceFactory to allow mocking diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f3da18c95..73d5d6e51 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v219 \ No newline at end of file +v221 \ No newline at end of file diff --git a/lib/Event.php b/lib/Event.php index 94ec60f6a..c24dedc3e 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -200,6 +200,7 @@ class Event extends ApiResource const QUOTE_ACCEPTING = 'quote.accepting'; const QUOTE_CANCELED = 'quote.canceled'; const QUOTE_CREATED = 'quote.created'; + const QUOTE_DRAFT = 'quote.draft'; const QUOTE_FINALIZED = 'quote.finalized'; const QUOTE_REESTIMATED = 'quote.reestimated'; const QUOTE_STALE = 'quote.stale'; diff --git a/lib/Service/Tax/TransactionService.php b/lib/Service/Tax/TransactionService.php index 15bd26ae1..6aa7a7da8 100644 --- a/lib/Service/Tax/TransactionService.php +++ b/lib/Service/Tax/TransactionService.php @@ -6,6 +6,37 @@ 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\LineItem> + */ + public function allLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/tax/transactions/%s/line_items', $id), $params, $opts); + } + + /** + * Lists Tax Transaction objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Tax\Transaction> + */ + public function allTransactions($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax/transactions', $params, $opts); + } + /** * Creates a Tax Transaction from a calculation. * diff --git a/lib/Tax/Transaction.php b/lib/Tax/Transaction.php index 1bbfc7af1..da7e77e4f 100644 --- a/lib/Tax/Transaction.php +++ b/lib/Tax/Transaction.php @@ -49,4 +49,41 @@ public static function createReversal($params = null, $opts = null) 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\LineItem> 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; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Tax\Transaction> list of TaxProductResourceTaxTransactions + */ + public static function allTransactions($params = null, $opts = null) + { + $url = static::classUrl(); + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } }