Skip to content

Instantly share code, notes, and snippets.

View philals's full-sized avatar
🚚
Hi

Phil Alsford philals

🚚
Hi
View GitHub Profile
@philals
philals / Program.cs
Last active September 10, 2015 19:58
using System;
using Xero.Api.Core;
using Xero.Api.Example.TokenStores;
using Xero.Api.Infrastructure.OAuth;
namespace Xero.Api.Example.Counts
{
class Program
{
static void Main(string[] args)
[Test]
public void find_PL_report()
{
var reports = Api.Reports.ProfitAndLoss(DateTime.Now.AddDays(-50), null, null, Guid.Parse("351953c4-XXXX-4009-88c3-f9cd8c9cbe9f"), null, Guid.Parse("48d69e13-XXXX-47ec-a615-c1a9ff47962a"));
Assert.IsNotNull(reports);
}
[Test]
public void find_all_accounts()
{
var accounts = Api.Accounts.Find();
Assert.True(accounts.Count() > 0);
}
PUT https://api.xero.com/api.xro/2.0/Invoices?unitdp=4&page=1 HTTP/1.1
Accept: application/json
Authorization: OAuth oauth_consumer_key="?", oauth_token="??", oauth_signature_method="RSA-SHA1", oauth_signature="??", oauth_timestamp="?", oauth_nonce="?", oauth_version="1.0"
User-Agent: Xero Api - Integration tests
Content-Type: application/xml
Host: api.xero.com
Content-Length: 487
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
@philals
philals / node_oauth_xero
Created May 26, 2016 01:33 — forked from timborden/node_oauth_xero
Simple Node.js Xero OAuth implementation for Private, Public or Partner applications
"use strict";
var restify = require('restify');
var fs = require('fs');
var request = require('request');
var qs = require('qs');
var GET_request = function (req, res, next) {
var options = {
url: process.env.XERO_REQUEST_URL,
if ($this->config ['application_type'] == 'Partner') {
if (! file_get_contents ( $this->config ['curl_ssl_cert'] )) {
$testOutput ['ssl_cert_error'] = "Can't read the Xero Entrust cert. You need one for partner API applications. http://developer.xero.com/documentation/getting-started/partner-applications/ \n";
} else {
$data = openssl_x509_parse ( file_get_contents ( $this->config ['curl_ssl_cert'] ) );
$validFrom = date ( 'Y-m-d H:i:s', $data ['validFrom_time_t'] );
if (time () < $data ['validFrom_time_t']) {
$testOutput ['ssl_cert_error'] = "Xero Entrust cert not yet valid - cert valid from " . $validFrom . "\n";
}
$validTo = date ( 'Y-m-d H:i:s', $data ['validTo_time_t'] );
sudo rm -rf ~/dev
{
"language": "Frisian",
"text": "Goeie dei"
}
@charset "UTF-8";
.szh-menu-container {
position: relative;
width: 0px;
height: 0px;
}
.szh-menu {
margin: 0;
padding: 0;