forked from XeroAPI/XeroOAuth-PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.php
68 lines (56 loc) · 2.19 KB
/
_config.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
<?php
/**
* @file
* A single location to store configuration.
*/
/**
* Define for file includes. The certs directory is best stored out of web root so moving the directory
* and updating the reference to BASE_PATH is the best way to ensure things keep working
*/
define('BASE_PATH',dirname(__FILE__));
/**
* Define which app type you are using:
* Private - private app method
* Public - standard public app method
* Partner - partner app method
*/
define("XRO_APP_TYPE", "Partner");
/**
* Set a user agent string that matches your application name as set in the Xero developer centre
*/
$useragent = "";
/**
* Set your callback url or set 'oob' if none required
*/
define("OAUTH_CALLBACK", 'http://localhost/XeroOAuth-PHP/example.php');
/**
* Application specific settings
* Not all are required for given application types
* consumer_key: required for all applications
* consumer_secret: for partner applications, set to: s (cannot be blank)
* rsa_private_key: application certificate private key - not needed for public applications
* rsa_public_key: application certificate public cert - not needed for public applications
*/
$signatures = array(
'consumer_key' => 'MWSAN8S5AAFPMMNBV3DQIEWH4TM9FE',
'shared_secret' => 's',
// API versions
'core_version'=> '2.0',
'payroll_version'=> '1.0',
);
if (XRO_APP_TYPE=="Private"||XRO_APP_TYPE=="Partner") {
$signatures['rsa_private_key']= BASE_PATH . '/certs/privatekey.pem';
$signatures['rsa_public_key']= BASE_PATH . '/certs/publickey.cer';
}
/**
* Special options for Partner applications
* Partner applications require a Client SSL certificate which is issued by Xero
* the certificate is issued as a .p12 cert which you will then need to split into a cert and private key:
* openssl pkcs12 -in entrust-client.p12 -clcerts -nokeys -out entrust-cert.pem
* openssl pkcs12 -in entrust-client.p12 -nocerts -out entrust-private.pem <- you will be prompted to enter a password
*/
if (XRO_APP_TYPE=="Partner") {
$signatures['curl_ssl_cert'] = BASE_PATH . '/certs/entrust-cert-RQ3.pem';
$signatures['curl_ssl_password'] = '1234';
$signatures['curl_ssl_key'] = BASE_PATH . '/certs/entrust-private-RQ3.pem';
}