Services/Xero.php
authoredward <edward@roojs.com>
Thu, 28 Jun 2018 06:04:12 +0000 (14:04 +0800)
committeredward <edward@roojs.com>
Thu, 28 Jun 2018 06:04:12 +0000 (14:04 +0800)
Services/Xero/OAuth.php

Services/Xero.php
Services/Xero/OAuth.php

index ddfa1a1..7cd357b 100644 (file)
@@ -23,6 +23,7 @@ class Services_Xero
     {
         $response = $this->XeroOAuth->request('GET', $this->XeroOAuth->url('Contacts', 'core'), $params, '', $this->format);
         
+        print_R($response);exit;
         if (empty($this->XeroOAuth->response['code']) || $this->XeroOAuth->response['code'] != 200) {
             throw new Exception('Xero Error: ' . $this->XeroOAuth->response['response']);
         }
@@ -64,7 +65,7 @@ class Services_Xero
             return false;
         }
         
-        $response = $this->XeroOAuth->request('POST', $this->XeroOAuth->url('Invoices', 'core'), array(), $xml);
+        $response = $this->XeroOAuth->request('POST', $this->XeroOAuth->url('Invoices', 'core'), array(), $xml, $this->format);
       
         if (empty($this->XeroOAuth->response['code']) ||  $this->XeroOAuth->response['code'] != 200) {
             throw new Exception('Xero Error: ' . $this->XeroOAuth->response['response']);
index fa533da..9df2c98 100644 (file)
@@ -60,8 +60,7 @@ class Services_Xero_OAuth
         'rsa_private_key' => '',
         'rsa_public_key' => '',
         'consumer_key' => '',
-        'shared_secret' => '',
-        'format' => 'json'
+        'shared_secret' => ''
     );
        
    /**