Skip to content

Commit

Permalink
Merge pull request #73 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-php after onfido-openapi-spec update (be823e7)
  • Loading branch information
dvacca-onfido authored Jan 24, 2025
2 parents d2fd834 + a75b4fc commit f81d12b
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "54ce45f",
"long_sha": "54ce45f2138f044cc5cb40f6904dc7bc1a675be6",
"version": "v4.5.0"
"short_sha": "be823e7",
"long_sha": "be823e7815c93bfbfc3fb764c0548f57cb851fe9",
"version": "v4.6.0"
},
"release": "v8.5.0"
"release": "v8.6.0"
}
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d

### Requirements

PHP 7.4 and later.
Should also work with PHP 8.0.
PHP 7.4 and later. Should also work with PHP 8.0.

[![Latest release](https://badge.fury.io/ph/onfido%2Fonfido-php.svg)](https://badge.fury.io/ph/onfido%2Fonfido-php)
![Build Status](https://github.com/onfido/onfido-php/actions/workflows/php.yml/badge.svg)
Expand Down Expand Up @@ -49,15 +48,15 @@ require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:
Please follow the [installation instructions](#installation--usage) and then run the following:

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$configuration = Onfido\Configuration::getDefaultConfiguration();
$configuration->setApiToken($_ENV['ONFIDO_API_TOKEN']);
$configuration->setRegion(Onfido\Region::EU); // Supports `EU`, `US` and `CA`
$configuration->setRegion(Onfido\Region::EU); // Supports `Region::EU`, `Region::US`, and `Region::CA`

$onfidoApi = new Onfido\Api\DefaultApi(
new \GuzzleHttp\Client([
Expand Down Expand Up @@ -93,7 +92,7 @@ try {

### Webhook event verification

Webhook events payload needs to be verified before it can be accessed. Library allows to easily decode the payload and verify its signature before returning it as an object for user convenience:
Webhook events payload needs to be verified before it can be accessed. The library allows easy decoding of the payload and verification of its signature before returning it as an object for user convenience:

```php
try {
Expand All @@ -111,41 +110,43 @@ try {

#### Do not use square bracket syntax

Except for accessing Task object's outputs, retain from using the square bracket syntax (i.e. `[]`) to access not defined properties to avoid breaking changes when these fields will appear.
Except for accessing Task object's outputs, avoid using the square bracket syntax (i.e. `[]`) to access undefined properties to prevent breaking changes when these fields appear.

## Contributing

This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore all the contributions, except tests files, should target [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository.
This library is automatically generated using [OpenAPI Generator](https://openapi-generator.tech) (version: 7.9.0); therefore, all contributions (except test files) should target the [Onfido OpenAPI specification repository](https://github.com/onfido/onfido-openapi-spec/tree/master) instead of this repository. Please follow the contribution guidelines provided in the OpenAPI specification repository.

For contributions to the tests instead, please follow the steps below:

1. [Fork](https://github.com/onfido/onfido-php/fork) repository
1. Fork the [repository](https://github.com/onfido/onfido-php/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Make your changes
4. Commit your changes (`git commit -am 'Add some feature'`)
4. Commit your changes (`git commit -am 'Add detailed description of the feature'`)
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request

## Versioning policy

[Semantic Versioning](https://semver.org) policy is used for library versioning, following guidelines and limitations below:
Versioning helps manage changes and ensures compatibility across different versions of the library.

- MAJOR versions (x.0.0) might:
[Semantic Versioning](https://semver.org) policy is used for library versioning, following the guidelines and limitations outlined below:

- MAJOR versions (x.0.0) may:
- target a new API version
- include non-backward compatible change
- MINOR versions (0.x.0) might:
- MINOR versions (0.x.0) may:
- add a new functionality, non-mandatory parameter or property
- deprecate an old functionality
- include non-backward compatible change to a functionality which is:
- labelled as alpha or beta
- completely broken and not usable
- PATCH version (0.0.x) might:
- PATCH version (0.0.x) will:
- fix a bug
- include backward compatible changes only

## More documentation

More documentation and code examples can be found at <https://documentation.onfido.com>.
Additional documentation and code examples can be found at <https://documentation.onfido.com>.

## Support

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onfido/onfido-php",
"version": "8.5.0",
"version": "8.6.0",
"description": "The Onfido API (v3.6)",
"keywords": [
"openapitools",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'onfido-php/8.5.0';
protected $userAgent = 'onfido-php/8.6.0';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -404,7 +404,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: v3.6' . PHP_EOL;
$report .= ' SDK Package Version: 8.5.0' . PHP_EOL;
$report .= ' SDK Package Version: 8.6.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
2 changes: 2 additions & 0 deletions lib/Model/IdNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public function getModelName()
public const TYPE_SOCIAL_INSURANCE = 'social_insurance';
public const TYPE_TAX_ID = 'tax_id';
public const TYPE_IDENTITY_CARD = 'identity_card';
public const TYPE_DRIVING_LICENSE = 'driving_license';
public const TYPE_DRIVING_LICENCE = 'driving_licence';
public const TYPE_SHARE_CODE = 'share_code';
public const TYPE_VOTER_ID = 'voter_id';
Expand All @@ -263,6 +264,7 @@ public function getTypeAllowableValues()
self::TYPE_SOCIAL_INSURANCE,
self::TYPE_TAX_ID,
self::TYPE_IDENTITY_CARD,
self::TYPE_DRIVING_LICENSE,
self::TYPE_DRIVING_LICENCE,
self::TYPE_SHARE_CODE,
self::TYPE_VOTER_ID,
Expand Down
54 changes: 48 additions & 6 deletions lib/Model/WebhookEventPayloadResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class WebhookEventPayloadResource implements ModelInterface, ArrayAccess, \JsonS
'output' => 'object',
'reasons' => 'string[]',
'link' => '\Onfido\Model\WorkflowRunLink',
'error' => '\Onfido\Model\WorkflowRunError'
'error' => '\Onfido\Model\WorkflowRunError',
'customer_user_id' => 'string'
];

/**
Expand All @@ -97,7 +98,8 @@ class WebhookEventPayloadResource implements ModelInterface, ArrayAccess, \JsonS
'output' => null,
'reasons' => null,
'link' => null,
'error' => null
'error' => null,
'customer_user_id' => null
];

/**
Expand All @@ -120,7 +122,8 @@ class WebhookEventPayloadResource implements ModelInterface, ArrayAccess, \JsonS
'output' => true,
'reasons' => false,
'link' => false,
'error' => false
'error' => false,
'customer_user_id' => false
];

/**
Expand Down Expand Up @@ -223,7 +226,8 @@ public function isNullableSetToNull(string $property): bool
'output' => 'output',
'reasons' => 'reasons',
'link' => 'link',
'error' => 'error'
'error' => 'error',
'customer_user_id' => 'customer_user_id'
];

/**
Expand All @@ -246,7 +250,8 @@ public function isNullableSetToNull(string $property): bool
'output' => 'setOutput',
'reasons' => 'setReasons',
'link' => 'setLink',
'error' => 'setError'
'error' => 'setError',
'customer_user_id' => 'setCustomerUserId'
];

/**
Expand All @@ -269,7 +274,8 @@ public function isNullableSetToNull(string $property): bool
'output' => 'getOutput',
'reasons' => 'getReasons',
'link' => 'getLink',
'error' => 'getError'
'error' => 'getError',
'customer_user_id' => 'getCustomerUserId'
];

/**
Expand Down Expand Up @@ -344,6 +350,7 @@ public function __construct(array $data = null)
$this->setIfExists('reasons', $data ?? [], null);
$this->setIfExists('link', $data ?? [], null);
$this->setIfExists('error', $data ?? [], null);
$this->setIfExists('customer_user_id', $data ?? [], null);
}

/**
Expand Down Expand Up @@ -377,6 +384,10 @@ public function listInvalidProperties()
$invalidProperties[] = "invalid value for 'task_def_id', must be conform to the pattern /^[0-9a-z_-]+$/.";
}

if (!is_null($this->container['customer_user_id']) && (mb_strlen($this->container['customer_user_id']) > 256)) {
$invalidProperties[] = "invalid value for 'customer_user_id', the character length must be smaller than or equal to 256.";
}

return $invalidProperties;
}

Expand Down Expand Up @@ -815,6 +826,37 @@ public function setError($error)

return $this;
}

/**
* Gets customer_user_id
*
* @return string|null
*/
public function getCustomerUserId()
{
return $this->container['customer_user_id'];
}

/**
* Sets customer_user_id
*
* @param string|null $customer_user_id Customer-provided user identifier.
*
* @return self
*/
public function setCustomerUserId($customer_user_id)
{
if (is_null($customer_user_id)) {
throw new \InvalidArgumentException('non-nullable customer_user_id cannot be null');
}
if ((mb_strlen($customer_user_id) > 256)) {
throw new \InvalidArgumentException('invalid length for $customer_user_id when calling WebhookEventPayloadResource., must be smaller than or equal to 256.');
}

$this->container['customer_user_id'] = $customer_user_id;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down

0 comments on commit f81d12b

Please sign in to comment.