diff --git a/tests/testRunner.php b/tests/testRunner.php
index 89e96ce..712753f 100644
--- a/tests/testRunner.php
+++ b/tests/testRunner.php
@@ -6,12 +6,14 @@ function testLinks()
if (isset($_SESSION['access_token']) || XRO_APP_TYPE == 'Private')
echo '
- Home
+ - home
- Organisation
- Organisation (JSON response)
- Accounts GET
- Accounts GET - Where Type is BANK
- BankTransactions GET
- BankTransactions PUT
+ - Credit Notes Allocation
- Contacts GET
- Contacts POST
- Contacts PUT
@@ -25,7 +27,7 @@ function testLinks()
- Invoices GET (with order by Total example)
- Invoices GET - Where Contact Name contains "Martin"
- Invoices GET - If-Modified-Since
- - Invoices PUT
+ - Invoices PUT (With SummarizeErrors=false)
- Invoices PUT (4 decimal places)
- Invoices POST
- Invoice attachment PUT
@@ -37,7 +39,9 @@ function testLinks()
- Tracking Categories - GET (+ archived)
- Tracking Categories - PUT
- Tracking Categories - ARCHIVE
- - Tracking Categories - restore to active
';
+ - Tracking Categories - restore to active
+ - Get All LinkedTransactions
+ - LinkedTransaction POST
';
if (XRO_APP_TYPE == 'Partner') echo '- Refresh access token
';
if (XRO_APP_TYPE !== 'Private' && isset($_SESSION['access_token'])) {
diff --git a/tests/tests.php b/tests/tests.php
index 7705720..c7bd7f7 100644
--- a/tests/tests.php
+++ b/tests/tests.php
@@ -36,6 +36,24 @@
}
}
+ if(isset($_REQUEST['CreditNotesallocation']) && $_REQUEST['method']=="PUT"){
+ $xml="
+
+ 1.50
+
+ 2404f66d-76a2-4e85-b80e-7dd692fe3588
+
+
+ ";
+ $response = $XeroOAuth->request('PUT', $XeroOAuth->url('CreditNotes/1e2d74e7-2fa8-45ec-9fd5-b459778c0752/Allocations', 'core'), array('SummarizeErrors' => 'false'), $xml);
+ if ($XeroOAuth->response['code'] == 200) {
+ $TrackingCategories = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']);
+ echo "The CreditNotes is now Allocated to invoice specified: " . $CreditNotes->CreditNotes[0]->CreditNotes;
+ } else {
+ outputError($XeroOAuth);
+ }
+ }
+
if (isset($_REQUEST['payments'])) {
if (!isset($_REQUEST['method'])) {
$response = $XeroOAuth->request('GET', $XeroOAuth->url('Payments', 'core'), array('Where' => 'Status=="AUTHORISED"'));
@@ -81,7 +99,7 @@
}
}
if (isset($_REQUEST['payrollemployees'])) {
- $response = $XeroOAuth->request('GET', $XeroOAuth->url('Employees', 'payroll'), array());
+ $response = $XeroOAuth->request('GET', $XeroOAuth->url('Employees', 'payroll'), array('If-Modified-Since' => "2015-08-01T01:16:10.853"));
if ($XeroOAuth->response['code'] == 200) {
$employees = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']);
echo "There are " . count($employees->Employees[0]). " employees in this Xero organisation, the first one is: ";
@@ -147,22 +165,22 @@
ACCREC
- Martin Hudson
+ Martin1 Hudson
- 2013-05-13T00:00:00
- 2013-05-20T00:00:00
+ 2013-06-13T00:00:00
+ 2013-06-20T00:00:00
Exclusive
Monthly rental for property at 56a Wilkins Avenue
- 4.3400
- 395.00
+ 4.3500
+ 396.00
200
";
- $response = $XeroOAuth->request('PUT', $XeroOAuth->url('Invoices', 'core'), array(), $xml);
+ $response = $XeroOAuth->request('PUT', $XeroOAuth->url('Invoices', 'core'), array('SummarizeErrors' => 'false'), $xml);
if ($XeroOAuth->response['code'] == 200) {
$invoice = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']);
echo "" . count($invoice->Invoices[0]). " invoice created in this Xero organisation.";
@@ -365,7 +383,7 @@
}elseif(isset($_REQUEST['method']) && $_REQUEST['method'] == "put" ){
$xml = "
- Orlena Greenville
+ Orlena1 Greenville
";
$response = $XeroOAuth->request('PUT', $XeroOAuth->url('Contacts', 'core'), array(), $xml);
@@ -596,4 +614,31 @@
}
+if (isset($_REQUEST['GetAllLinkedTransactions'])) {
+ $response = $XeroOAuth->request('GET', $XeroOAuth->url('LinkedTransactions', 'core'), array('Where' => $_REQUEST['where']));
+ if ($XeroOAuth->response['code'] == 200) {
+ $LinkedTransactions = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']);
+ echo "There are " . count($LinkedTransactions->LinkedTransactions[0]). " LinkedTransactions in this Xero organisation, the first one is: ";
+ pr($LinkedTransactions->LinkedTransactions[0]->LinkedTransaction);
+ } else {
+ outputError($XeroOAuth);
+ }
+ }
+
+if (isset($_REQUEST['LinkedTransaction'])) {
+ $xml = "
+ 4a44f84d-cb7c-4f6f-81cb-5314fd3f2f0f
+ f93f11fb-d4a1-4d87-9830-a9bd2169cdca
+ b4bb131a-72b0-4543-bf36-6dc9703605ea
+";
+ $response = $XeroOAuth->request('POST', $XeroOAuth->url('LinkedTransaction', 'core'), array(), $xml);
+ if ($XeroOAuth->response['code'] == 200) {
+ $LinkedTransaction = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']);
+ echo "There are " . count($LinkedTransaction->LinkedTransaction[0]). " Item created: ";
+ pr($LinkedTransaction->LinkedTransaction[0]->LinkedTransaction);
+ } else {
+ outputError($XeroOAuth);
+ }
+ }
+
}