Skip to content

Commit

Permalink
Merge pull request #1427 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
API Updates for beta branch
  • Loading branch information
pakrym-stripe authored Jan 19, 2023
2 parents f49b95d + 9e62cbd commit 10a6daa
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "7.1"
- "7.4"
- "8.1"

steps:
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Changelog

## 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
* [#1424](https://github.com/stripe/stripe-php/pull/1424) API Updates

* Added `REFUND_CREATED`, `REFUND_UPDATED` event definitions.
* [#1426](https://github.com/stripe/stripe-php/pull/1426) Ignore PHP version for formatting
* [#1425](https://github.com/stripe/stripe-php/pull/1425) Fix Stripe::setAccountId parameter type
* [#1418](https://github.com/stripe/stripe-php/pull/1418) Switch to mb_convert_encoding to fix utf8_encode deprecation warning

## 10.4.0-beta.3 - 2023-01-12
* [#1423](https://github.com/stripe/stripe-php/pull/1423) API Updates for beta branch
* Updated stable APIs to the latest version
* Add support for `Tax.Registration` resource.
* Change `draft_quote` method implementation from hitting `/v1/quotes/{quotes}/draft` to `/v1/quotes/{quotes}/mark_draft`
* Change `draft_quote` method implementation from hitting `/v1/quotes/{quotes}/draft` to `/v1/quotes/{quotes}/mark_draft`

## 10.4.0-beta.2 - 2023-01-05
* [#1420](https://github.com/stripe/stripe-php/pull/1420) API Updates for beta branch
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test: vendor
.PHONY: test

fmt: vendor
vendor/bin/php-cs-fixer fix -v --using-cache=no
PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix -v --using-cache=no
.PHONY: fmt

fmtcheck: vendor
vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no
PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no
.PHONY: fmtcheck

phpdoc: vendor/bin/phpdoc
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v218
v219
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/Tax/Calculation.php';
require __DIR__ . '/lib/Tax/Registration.php';
require __DIR__ . '/lib/Tax/Settings.php';
require __DIR__ . '/lib/Tax/Transaction.php';
require __DIR__ . '/lib/TaxCode.php';
require __DIR__ . '/lib/TaxId.php';
Expand Down Expand Up @@ -262,6 +263,7 @@
require __DIR__ . '/lib/Service/SubscriptionScheduleService.php';
require __DIR__ . '/lib/Service/Tax/CalculationService.php';
require __DIR__ . '/lib/Service/Tax/RegistrationService.php';
require __DIR__ . '/lib/Service/Tax/SettingsService.php';
require __DIR__ . '/lib/Service/Tax/TransactionService.php';
require __DIR__ . '/lib/Service/TaxCodeService.php';
require __DIR__ . '/lib/Service/TaxRateService.php';
Expand Down
2 changes: 2 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ class Event extends ApiResource
const RECIPIENT_CREATED = 'recipient.created';
const RECIPIENT_DELETED = 'recipient.deleted';
const RECIPIENT_UPDATED = 'recipient.updated';
const REFUND_CREATED = 'refund.created';
const REFUND_UPDATED = 'refund.updated';
const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
Expand Down
10 changes: 10 additions & 0 deletions lib/Service/AbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ abstract protected function getServiceClass($name);
* @return null|AbstractService|AbstractServiceFactory
*/
public function __get($name)
{
return $this->getService($name);
}

/**
* @param string $name
*
* @return null|AbstractService|AbstractServiceFactory
*/
public function getService($name)
{
$serviceClass = $this->getServiceClass($name);
if (null !== $serviceClass) {
Expand Down
39 changes: 39 additions & 0 deletions lib/Service/Tax/SettingsService.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 SettingsService extends \Stripe\Service\AbstractService
{
/**
* Retrieves Tax <code>Settings</code> for a merchant.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Settings
*/
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 $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Settings
*/
public function update($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/settings', $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Service/Tax/TaxServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @property CalculationService $calculations
* @property RegistrationService $registrations
* @property SettingsService $settings
* @property TransactionService $transactions
*/
class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
Expand All @@ -19,6 +20,7 @@ class TaxServiceFactory extends \Stripe\Service\AbstractServiceFactory
private static $classMap = [
'calculations' => CalculationService::class,
'registrations' => RegistrationService::class,
'settings' => SettingsService::class,
'transactions' => TransactionService::class,
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public static function getAccountId()
}

/**
* @param string $accountId the Stripe account ID to set for connected
* @param null|string $accountId the Stripe account ID to set for connected
* account requests
*/
public static function setAccountId($accountId)
Expand Down
25 changes: 25 additions & 0 deletions lib/Tax/Settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Tax;

/**
* You can use Tax <code>Settings</code> to manage configurations used by Stripe
* Tax calculations.
*
* Related guide: <a href="https://stripe.com/docs/tax/connect/settings">Account
* settings</a>.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property \Stripe\StripeObject $defaults
* @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 \Stripe\StripeObject[] $locations The places where your business is located.
*/
class Settings extends \Stripe\SingletonApiResource
{
const OBJECT_NAME = 'tax.settings';

use \Stripe\ApiOperations\SingletonRetrieve;
use \Stripe\ApiOperations\Update;
}
1 change: 1 addition & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class ObjectTypes
\Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
\Stripe\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class,
\Stripe\Tax\Registration::OBJECT_NAME => \Stripe\Tax\Registration::class,
\Stripe\Tax\Settings::OBJECT_NAME => \Stripe\Tax\Settings::class,
\Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class,
\Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
\Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
Expand Down

0 comments on commit 10a6daa

Please sign in to comment.