forked from intacctaaron/intacct-dds
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dds_extractor_test.php
47 lines (41 loc) · 1.49 KB
/
dds_extractor_test.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
<?php
/**
* File dds_extractor_test.php contains the class dds_extractor_test.php
*
* @author Aaron Harris <[email protected]>
* @copyright 2000-2013 Intacct Corporation
*
* This document contains trade secret data that belongs to Intacct
* Corporation and is protected by the copyright laws. Information
* herein may not be used, copied or disclosed in whole or in part
* without prior written consent from Intacct Corporation.
*/
require_once 'intacctws-php/api_session.php';
require_once 'intacctws-php/api_post.php';
require_once 'DdsLoader/DdsController.php';
try {
// Intacct API session
$memcache = new Memcache();
$memcache->connect('localhost', 11211);
$key = 'dds_extractor_test_session';
$session = $memcache->get($key);
if ($session === false) {
$session = new api_session();
$session->connectCredentials(
$_SERVER['IntacctCompanyId'],
$_SERVER['IntacctUserId'],
$_SERVER['IntacctPwd'],
$_SERVER['SenderId'],
$_SERVER['SenderPwd'], null, null,
$_SERVER['endPoint']
);
$memcache->set($key, $session, null, 300);
}
// let's just extract the glaccount object
DdsController::runDdsJob('GLENTRY', api_post::DDS_JOBTYPE_CHANGE, "AHARRIS Dropbox", $session, "2015-03-02T05:55:22-08:00", true);
}
catch (Exception $ex) {
printf($ex->getMessage() . '\n');
printf(api_post::getLastRequest() . '\n');
printf(api_post::getLastResponse() . '\n');
}