Skip to content

Commit

Permalink
creating MakeRequest class method
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanq committed Oct 17, 2011
1 parent c6a8504 commit d5b3349
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion XeroOAuth.php
@@ -1,4 +1,5 @@
<?php
require 'OAuthSimple.php';

// different app method defaults
$xro_defaults = array( 'xero_url' => 'https://api.xero.com/api.xro/2.0',
Expand Down Expand Up @@ -44,7 +45,7 @@ class XeroOAuth {
*
* @param app_type {string} The Xero API application type: http://blog.xero.com/developer/api-overview/
*/
function XeroOAuth ($AppType = "Public"){
function XeroOAuth($AppType = "Public") {
if (!empty($AppType)){
switch ($AppType) {
case "Public":
Expand Down Expand Up @@ -78,4 +79,19 @@ function XeroOAuth ($AppType = "Public"){
return $this;
}


function MakeRequest($endpoint, $parameters, $action, $data, $app_type, $format="xml"){
$oauthObject = new OAuthSimple();

# Set some standard curl options....
$options[CURLOPT_VERBOSE] = 1;
$options[CURLOPT_RETURNTRANSFER] = 1;
$options[CURLOPT_SSL_VERIFYHOST] = 0;
$options[CURLOPT_SSL_VERIFYPEER] = 0;
$useragent = USER_AGENT;
$useragent = isset($useragent) ? USER_AGENT : 'XeroOAuth-PHP';
$options[CURLOPT_USERAGENT] = $useragent;

}

}

0 comments on commit d5b3349

Please sign in to comment.