-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude.php
More file actions
38 lines (31 loc) · 1.11 KB
/
include.php
File metadata and controls
38 lines (31 loc) · 1.11 KB
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
<?php
session_start();
if (!is_writable(session_save_path())) {
die('Session path "'.session_save_path().'" is not writable for PHP!');
}
include('vendor/autoload.php');
define('REDIRECT_URL', 'http://local7.dev/rangka/quickbooks-dev/redirect.php');
define('CONNECT_URL', 'http://local7.dev/rangka/quickbooks-dev/connect.php');
function get($key, $default = null, $source = 'GET') {
global $_SESSION;
switch ($source) {
case 'SESSION':
return isset($_SESSION[$key]) ? $_SESSION[$key] : null;
break;
case 'GET':
return isset($_GET[$key]) ? $_GET[$key] : null;
break;
case 'POST':
return isset($_POST[$key]) ? $_POST[$key] : null;
break;
}
return $default;
}
\Rangka\Quickbooks\Client::configure([
'consumer_key' => '',
'consumer_secret' => '',
'sandbox' => 'sandbox',
'oauth_token' => get('oauth_token', null, 'SESSION'),
'oauth_token_secret' => get('oauth_token_secret', null, 'SESSION'),
'company_id' => get('company_id', null, 'SESSION'),
]);