-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathExamplesBootstrap.php
92 lines (78 loc) · 2.36 KB
/
ExamplesBootstrap.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
namespace LemonWay\Examples;
use LemonWay\LemonWayAPI;
require_once __DIR__ . '/../vendor/autoload.php';
require_once 'ExamplesDatas.php';
class ExamplesBootstrap{
/**
* HOST Used to set some examples urls
* @var string
*/
const HOST = 'http://localhost/php-client-directkit-xml';
/**
* DIRECTKIT_URL Used to set API DirectKit url
* @var string
*/
const DIRECTKIT_URL = 'https://sandbox-api.lemonway.fr/mb/demo/dev/directkitxml/Service.asmx';
/**
* WEBKIT_URL Used to set API WebKit url
* @var string
*/
const WEBKIT_URL = 'https://sandbox-webkit.lemonway.fr/demo/dev/';
/**
* SSLVERIFICATION Used to tell whether it needs to verifiy SSL
* Only activate it if your PHP server know how to verify the certifcates.
* (You will have to configure the the CURLOPT_CAINFO option or the CURLOPT_CAPATH option)
* https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html
* https://stackoverflow.com/a/18972719/347051
* @var string
*/
const SSLVERIFICATION = false;
/**
* CSS_URL Used to set API CSS url for LemonWayAPI::printCardForm
* @var string
*/
const CSS_URL = 'https://www.lemonway.fr/mercanet_lw.css';
/**
* LOGIN Used to set API user login
* @var string
*/
const LOGIN = 'society';
/**
* PASS Used to set API user password
* @var string
*/
const PASS = '123456';
/**
* LANG Used to set API language
* @var string
*/
const LANG = 'en';
/**
* DEBUG Used to switch API in debug mode
* @var boolean
*/
const DEBUG = false;
/**
* api Lemon Way API
* @var LemonWayAPI
*/
public static $api;
/**
* Build the API if needed
* @return LemonWayAPI
*/
public static function getApiInstance(){
if (self::$api == null) {
self::$api = new LemonWayAPI();
self::$api->config->dkUrl = self::DIRECTKIT_URL;
self::$api->config->wkUrl = self::WEBKIT_URL;
self::$api->config->sslVerification = self::SSLVERIFICATION;
self::$api->config->wlLogin = self::LOGIN;
self::$api->config->wlPass = self::PASS;
self::$api->config->lang = self::LANG;
self::$api->config->isDebugEnabled = self::DEBUG;
}
return self::$api;
}
}