Skip to content

Commit 0bf08eb

Browse files
authored
Merge pull request #9 from everypay/feature/iris-session-creation-example-in-readme
Add IRIS session creation code example in readme
2 parents 55a59b3 + e363e3c commit 0bf08eb

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ $params = array(
8282

8383
Payment::create($params);
8484

85+
/** Example of how to create an IRIS session */
86+
$sessionParams = array(
87+
'amount' => 100,
88+
'currency' => 'EUR',
89+
'country' => 'GR',
90+
'callback_url' => 'https://your-callback_url',
91+
'uuid' => '975b48f9-06b0-41f6-98ad-87eb51d7103e',
92+
'md' => 'test-md-data',
93+
'webhook_url' => 'https://webhook-url'
94+
);
95+
96+
Iris::session($sessionParams);
97+
8598
```
8699

87100
## Documentation

examples/iris.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
require_once 'bootstrap.php';
4+
5+
use Everypay\Iris;
6+
use Everypay\Exception\ApiErrorException;
7+
8+
try {
9+
$sessionParams = array(
10+
'amount' => 100,
11+
'currency' => 'EUR',
12+
'country' => 'GR',
13+
'callback_url' => 'https://your-callback_url',
14+
'uuid' => '975b48f9-06b0-41f6-98ad-87eb51d7103e',
15+
'md' => 'test-md-data',
16+
'webhook_url' => 'https://webhook-url'
17+
);
18+
19+
// create a new iris session
20+
$irisSession = Iris::session($sessionParams);
21+
$irisSessionToken = $irisSession->token;
22+
23+
echo 'Iris session with token ' . $irisSessionToken . ' created' . PHP_EOL;
24+
} catch (ApiErrorException $e) {
25+
echo $e->getMessage() . PHP_EOL;
26+
}

0 commit comments

Comments
 (0)