forked from lemonwaysas/php-client-directkit-xml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
40 lines (35 loc) · 1.16 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace LemonWay\Examples\SigninDocument;
use LemonWay\Models\KycDoc;
require_once '../../LemonWay/Autoloader.php';
/**
* This page handles the signing document workflow :
*
* 1 - If not POST nor GET, launches the signing
* 2 - Handles returns, success and error
*/
if (isset($_POST) && sizeof($_POST) > 0){
//notification from Lemon Way's server. Will not work if you're testing using a local return URL
foreach ($_POST as $key => $value) {
// Write to server error log for example purpose
error_log('<br/>'.$key.' : '.$value.'');
}
print('<hr/><br />POST SUCCESS');
} else if (isset ($_GET) && sizeof($_GET) > 0){
//user browser is returning from signing
print 'GET : ';
foreach ($_GET as $key => $value) {
print ('<br/>'.$key.' : '.$value.'');
}
if (isset($_GET['url'])){
$response = $_GET['url'];
if($response == KycDoc::SIGNING_SUCCESS){
print('<hr/><br />GET SUCCESS FOR '.$_GET['signingtoken']);
}else{
print('<hr/><br />GET ERROR FOR '.$_GET['signingtoken']);
}
}
} else {
//initialize the Signing
include './SignDocumentInit.php';
}