Skip to content

Commit

Permalink
Merge pull request #15 from getyoti/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
davidgrayston authored May 29, 2020
2 parents e816e9e + ad16cc6 commit fed64a4
Show file tree
Hide file tree
Showing 78 changed files with 3,656 additions and 195 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,43 @@ $ composer require yoti/yoti-php-sdk-sandbox

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

### Profile

#### Profile Sandbox Client
```php
use Yoti\Sandbox\Profile\SandboxClient;
use Yoti\YotiClient;

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

#### Yoti Client
```php
use Yoti\YotiClient;

$yotiClient = new YotiClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem', [
'api.url' => 'https://api.yoti.com/sandbox/v1'
]);
```

### Doc Scan

#### Doc Scan Sandbox Client
```php
use Yoti\Sandbox\DocScan\SandboxClient;

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

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

$docScanClient = new DocScanClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem', [
'api.url' => 'https://api.yoti.com/sandbox/idverify/v1'
]);
```

## Examples

- See [examples/profile](examples/profile) for a general example of how to use the Profile Sandbox in your tests.
- [Profile Sandbox](examples/profile)
- [Doc Scan Sandbox](examples/doc-scan)
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yoti/yoti-php-sdk-sandbox",
"description": "Yoti PHP SDK Sandbox",
"version": "1.0.0",
"version": "1.1.0",
"keywords": [
"yoti",
"sdk"
Expand All @@ -17,7 +17,8 @@
"friendsofphp/php-cs-fixer": "^2.15",
"brainmaestro/composer-git-hooks": "^2.8",
"phpstan/phpstan-strict-rules": "^0.12.1",
"phpstan/extension-installer": "^1.0"
"phpstan/extension-installer": "^1.0",
"symfony/phpunit-bridge": "^5.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions examples/doc-scan/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
YOTI_SANDBOX_CLIENT_SDK_ID=
YOTI_KEY_FILE_PATH=./keys/privateKey.pem
YOTI_DOC_SCAN_API_URL=https://api.yoti.com/sandbox/idverify/v1
4 changes: 4 additions & 0 deletions examples/doc-scan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
composer.lock
sandbox
vendor
19 changes: 19 additions & 0 deletions examples/doc-scan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Doc Scan Sandbox Example

An example of configuring a session response can be found in the [FeatureContext](./features/bootstrap/FeatureContext.php)

## Configuring the application

1. Rename the [.env.example](.env.example) file to `.env` and fill in the required configuration values

## Installing dependencies

1. `docker-compose up composer`

## Running the test

1. `docker-compose up test`

## Stopping services

1. `docker-compose down`
27 changes: 27 additions & 0 deletions examples/doc-scan/behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
default:
extensions:
Behat\MinkExtension:
base_url: https://app:3000
javascript_session: selenium2
browser_name: 'chrome'
selenium2:
wd_host: http://selenium:4444/wd/hub
capabilities:
browserName: 'chrome'
browser: 'chrome'
chrome:
switches:
- '--headless'
- '--no-sandbox'
- '--disable-dev-shm-usage'
- '--disable-gpu'
- '--window-size=1280,2000'
- '--ignore-certificate-errors'
suites:
default:
contexts:
- Yoti\Demo\Context\FeatureContext:
- image_path: '/usr/src/resources/image.jpg'
timeouts:
implicit: 5000
- Behat\MinkExtension\Context\MinkContext
33 changes: 33 additions & 0 deletions examples/doc-scan/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "yoti/yoti-php-sdk-doc-scan-sandbox-example",
"description": "Yoti PHP SDK Doc Scan Sandbox Example",
"license": "MIT",
"require": {
"yoti/yoti-php-sdk": "^3.1"
},
"require-dev": {
"yoti/yoti-php-sdk-sandbox": "^1.0",
"behat/behat": "^3.6",
"behat/mink-extension": "^2.3",
"behat/mink-selenium2-driver": "^1.4"
},
"scripts": {
"pre-install-cmd": "@copy-sdk",
"pre-update-cmd": "@copy-sdk",
"copy-sdk": "grep -q 'yoti-php-sdk-sandbox' ../../composer.json && rm -fr ./sandbox && cd ../../ && git archive --prefix=sandbox/ --format=tar HEAD | (cd - && tar xf -) || echo 'Could not install Sandbox from parent directory'"
},
"autoload": {
"psr-4": {
"Yoti\\Demo\\Context\\": "features/bootstrap/"
}
},
"repositories": [
{
"type": "path",
"url": "./sandbox",
"options": {
"symlink": true
}
}
]
}
46 changes: 46 additions & 0 deletions examples/doc-scan/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '3'

services:
app:
build: https://github.com/getyoti/doc-scan-sandbox-test-app.git#0.2.0
env_file:
- ./.env
environment:
- YOTI_KEY_FILE_PATH=/usr/src/keys/privateKey.pem
- YOTI_CLIENT_SDK_ID=${YOTI_SANDBOX_CLIENT_SDK_ID}
- YOTI_DOC_SCAN_API_URL=${YOTI_DOC_SCAN_API_URL}
volumes:
- ${YOTI_KEY_FILE_PATH}:/usr/src/keys/privateKey.pem
ports:
- "3000:3000"
depends_on:
- selenium

selenium:
image: selenium/standalone-chrome
container_name: selenium
volumes:
- ./resources:/usr/src/resources
ports:
- "4444:4444"

test:
image: php:7-fpm-alpine
command: ./vendor/bin/behat --colors
env_file:
- ./.env
environment:
- YOTI_KEY_FILE_PATH=/usr/src/keys/privateKey.pem
- YOTI_SANDBOX_CLIENT_SDK_ID=${YOTI_SANDBOX_CLIENT_SDK_ID}
volumes:
- ./:/var/www/html
- ${YOTI_KEY_FILE_PATH}:/usr/src/keys/privateKey.pem
depends_on:
- app

composer:
image: composer
volumes:
- ../../:/app
working_dir: /app/examples/doc-scan
command: update
Loading

0 comments on commit fed64a4

Please sign in to comment.