Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ composer coverage-clover
We follow the [PSR-12 Style Guide](https://www.php-fig.org/psr/psr-12/), which
is configured in [.phpcs.xml.dist](.phpcs.xml.dist).

Additional checks are configured in [.php_cs.dist](.php_cs.dist) - See
Additional checks are configured in [.php-cs-fixer.dist.php](.php-cs-fixer.dist.php) - See
<https://cs.symfony.com/> for further information.

Coding style can be verified by running:
Expand Down
5 changes: 3 additions & 2 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License
# MIT License
Copyright &copy; 2017 Yoti Ltd

Copyright (c) 2020 Yoti Ltd
* * *

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
101 changes: 57 additions & 44 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,66 +1,79 @@
# Yoti PHP Sandbox SDK
# Yoti PHP SDK

[![Build Status](https://travis-ci.com/getyoti/yoti-php-sdk-sandbox.svg?branch=master)](https://travis-ci.com/getyoti/yoti-php-sdk-sandbox)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp-sandbox&metric=coverage)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp-sandbox)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp-sandbox&metric=bugs)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp-sandbox)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp-sandbox&metric=code_smells)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp-sandbox)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp-sandbox&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp-sandbox)
[![Build Status](https://github.com/getyoti/yoti-php-sdk/workflows/Unit%20Tests/badge.svg?branch=master)](https://github.com/getyoti/yoti-php-sdk/actions)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp&metric=coverage)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp&metric=bugs)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp&metric=code_smells)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=getyoti%3Aphp&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=getyoti%3Aphp)

This repository contains the tools you need to test your Yoti integration.
Welcome to the Yoti PHP SDK. This repo contains the tools you need to quickly integrate your PHP back-end with Yoti, so that your users can share their identity details with your application in a secure and trusted way.

## Installing the Sandbox
## Table of Contents

Add the Yoti SDK dependency:
1) [Requirements](#requirements) -
Check you have what you need

```console
$ composer require yoti/yoti-php-sdk-sandbox
```
1) [Enabling the SDK](#enabling-the-sdk) -
How to install our SDK

## Configuration
1) [Setup](#setup) -
Setup required before using the Yoti services

* `SANDBOX_CLIENT_SDK_ID` is the Sandbox SDK identifier generated from the Sandbox section on Yoti Hub.
1) [Products](#products) -
Links to more information about the products offered by the Yoti SDK

* `/path/to/your-pem-file.pem` is the path to the Sandbox PEM file. It can be downloaded from the Sandbox section on Yoti Hub.
1) [Support](#support) -
Please feel free to reach out

Please do not open the PEM file, as this might corrupt the key, and you will need to redownload it.
## Requirements

### Profile
* PHP ^7.4 || ^8.0 || ^8.1
* CURL PHP extension (must support TLSv1.2)

#### Profile Sandbox Client
```php
use Yoti\Sandbox\Profile\SandboxClient;
### Recommended (optional)
- [Protobuf C extension](https://github.com/protocolbuffers/protobuf/tree/master/php) (PHP package will be used by default)

$sandboxClient = new SandboxClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem');
```
## Enabling the SDK

To import the Yoti SDK inside your project, you can use your favourite dependency management system.
If you are using Composer, you need to do one of the following:

Add the Yoti SDK dependency:

#### Yoti Client
```php
use Yoti\YotiClient;
```json
"require": {
"yoti/yoti-php-sdk" : "^4.1"
}
```

$yotiClient = new YotiClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem', [
'api.url' => 'https://api.yoti.com/sandbox/v1'
]);
Or run this Composer command
```console
$ composer require yoti/yoti-php-sdk "^4.1"
```

### Doc Scan
## Setup

#### Doc Scan Sandbox Client
```php
use Yoti\Sandbox\DocScan\SandboxClient;
For each service you will need:

$sandboxClient = new SandboxClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem');
```
* Your Client SDK ID, generated by [Yoti Hub](https://hub.yoti.com) when you create (and then publish) your app.
* Your .pem file. This is your own unique private key which your browser generates from the [Yoti Hub](https://hub.yoti.com) when you create an application.

#### Doc Scan Client
```php
use Yoti\DocScan\DocScanClient;
## Products

$docScanClient = new DocScanClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem', [
'api.url' => 'https://api.yoti.com/sandbox/idverify/v1'
]);
```
The Yoti SDK can be used for the following products, follow the links for more information about each:
1) [Yoti app integration](/docs/PROFILE.md) - Connect with already-verified customers.
1) [Yoti Doc Scan](/docs/DOCSCAN.md) - Identity verification embedded in your website or app.

## Support

For any questions or support please contact us here: https://support.yoti.com
Please provide the following to get you up and working as quickly as possible:

* Computer type
* OS version
* Version of PHP being used
* Screenshot

## Examples
Once we have answered your question we may contact you again to discuss Yoti products and services. If you’d prefer us not to do this, please let us know when you e-mail.

- [Profile Sandbox](examples/profile)
- [Doc Scan Sandbox](examples/doc-scan)
For further documentation, see <https://developers.yoti.com/yoti/welcome>
51 changes: 34 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,69 @@
{
"name": "yoti/yoti-php-sdk-sandbox",
"description": "Yoti PHP SDK Sandbox",
"version": "1.6.0",
"name": "yoti/yoti-php-sdk",
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
"version": "4.2.2",
"keywords": [
"yoti",
"sdk"
],
"homepage": "https://yoti.com",
"license": "MIT",
"require": {
"php": "^7.1 || ^8.0",
"yoti/yoti-php-sdk": "^3.1"
"php": "^7.4 || ^8.0 || ^8.1",
"ext-json": "*",
"google/protobuf": "^3.10",
"phpseclib/phpseclib": "^3.0",
"guzzlehttp/guzzle": "^7.0",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0",
"guzzlehttp/psr7": "^2.4",
"ext-openssl": "*"
},
"autoload": {
"psr-4": {
"Yoti\\": "src"
}
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
"phpunit/phpunit": "^9.5.13",
"squizlabs/php_codesniffer": "^3.4",
"friendsofphp/php-cs-fixer": "^2.15",
"friendsofphp/php-cs-fixer": "^3.4",
"brainmaestro/composer-git-hooks": "^2.8",
"phpstan/phpstan-strict-rules": "^0.12.1",
"phpstan/extension-installer": "^1.0",
"symfony/phpunit-bridge": "^5.1"
},
"autoload": {
"psr-4": {
"Yoti\\Sandbox\\": "src"
}
"psr/log": "^1.1",
"symfony/phpunit-bridge": "^6.2"
},
"autoload-dev": {
"psr-4": {
"Yoti\\Sandbox\\Test\\": "tests"
"Yoti\\Test\\": "tests/"
}
},
"scripts": {
"cghooks": "cghooks",
"test": "phpunit",
"coverage-clover": "phpunit --coverage-clover ./coverage/coverage.xml",
"coverage-html": "phpunit --coverage-html ./coverage/report",
"fix": [
"php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no",
"phpcbf"
],
"lint": [
"phpcs",
"php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no --diff-format=udiff --ansi",
"php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --using-cache=no",
"phpstan analyse"
],
"post-install-cmd": "cghooks add --ignore-lock",
"post-update-cmd": "cghooks update"
},
"extra": {
"hooks": {
"pre-commit": "composer test && composer lint"
"pre-commit": "composer test && composer lint"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
}
11 changes: 11 additions & 0 deletions docs/DOCSCAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Yoti Doc Scan

## About

Yoti Doc Scan can be seamlessly integrated with your website, app or custom product so you can perform secure identity checks. You'll be able to request specific ID documents from users directly from your website or app.

See the the [Developer Docs](https://developers.yoti.com/yoti/getting-started-docscan) for more information.

## Running the example

- See the [Doc Scan Example](../examples/doc-scan/README.md) folder for instructions on how to run the Doc Scan Example project
Loading