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

API Updates for beta branch #1429

Merged
merged 4 commits into from
Jan 27, 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v219
v221
1 change: 1 addition & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
31 changes: 31 additions & 0 deletions lib/Service/Tax/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>Transaction</code> from a calculation.
*
Expand Down
37 changes: 37 additions & 0 deletions lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}