The example.rb
file has examples for performing various tasks on the API, like creating customers, invoicing, and recording payments.
The invoiced
gem needs to be installed first with:
gem install invoiced
info: Starting app inspirevive | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: | |
error: There was an error while attempting to start the app | |
error: Error spawning drone | |
error: Script took too long to listen on a socket | |
error: | |
error: This type of error is usually a user error. | |
error: Error output from app: |
Error: Cannot find module './blueprints/error' | |
at Function.Module._resolveFilename (module.js:338:15) | |
at Function.Module._load (module.js:280:25) | |
at Module.require (module.js:364:17) | |
at require (module.js:380:17) | |
at Object.<anonymous> (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/lib/configuration/express.js:40:4) | |
at Object.handle (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/lib/http.js:192:10) | |
at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:199:17) | |
at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:201:11) | |
at next (/Volumes/HDD/Users/jared/Documents/Code/node/inspirevive/node_modules/sails/node_modules/express/node_modules/connect/lib/http.js:201:11) |
prompt: Is this ok?: (yes) | |
info: Creating snapshot 0.0.0-23 | |
debug: { method: 'POST', | |
debug: uri: 'https://api.nodejitsu.com/apps/jaredtking/inspirevive/snapshots/0.0.0-23', | |
debug: headers: | |
debug: { Authorization: '*********************************************************************', | |
debug: 'Content-Type': 'application/octet-stream', | |
debug: 'Content-Length': 1523463 }, | |
debug: timeout: 240000, | |
debug: rejectUnauthorized: false } |
#!/bin/bash | |
SITES=( dev.inspirevive.com invoicedapp.com invoice-generator.com infuse.jaredtking.com jaredtking.com printable-calendar.co ) | |
DATE_FORMAT="+%Y/%m/%d" | |
YESTERDAY=$(date --date="yesterday" $DATE_FORMAT) | |
TODAY=$(date $DATE_FORMAT) | |
function parseLog { | |
NUM_ERRORS=0 |
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
require 'invoiced' | |
invoiced = Invoiced::Client.new('your_api_key') | |
more = true | |
page = 1 | |
while more do | |
# Fetch a page of customers with a credit balance | |
customers, metadata = invoiced.Customer.list( | |
:balance => true, |
using Jose.JWT; | |
using System; | |
using System.Text; | |
public class SSO | |
{ | |
public static void Main() | |
{ | |
// Depends on this JWT library: https://github.com/dvsekhvalnov/jose-jwt |
<?php | |
// prerequisite: run "composer require invoiced/invoiced" | |
require 'vendor/autoload.php'; | |
$invoiced = new Invoiced\Client('TODO_INSERT_API_KEY'); | |
$objectType = 'invoice'; | |
$invoiceId = 'TODO_INSERT_INVOICE_ID'; |
import invoiced | |
client = invoiced.Client('_YOUR_API_KEY_') | |
subscriptions, metadata = client.Subscription.list(per_page=1000, expand="customer") | |
for subscription in subscriptions: | |
if (subscription.approval): | |
print(subscription.customer['name']+" approved "+subscription.plan+" from IP: "+subscription.approval['ip']) |