public
Description: 3scale integration plugin for .NET applications
Homepage: www.3scale.net
Clone URL: git://github.com/3scale/3scale_ws_api_for_dotnet.git
name age message
file CS_threescale.dll Thu May 07 00:52:46 -0700 2009 Fixes the bug where the usage param wasn't pass... [adam]
file LICENCE.txt Fri Dec 12 09:16:41 -0800 2008 adds MIT licence [adam]
file README.txt Fri Dec 12 09:16:41 -0800 2008 adds MIT licence [adam]
directory src/ Thu May 07 00:52:46 -0700 2009 Fixes the bug where the usage param wasn't pass... [adam]
README.txt
3scale .NET API HOWTO
---------------------


1) Obtain the library

Get the CS_threescale.dll (Windows version) 
Alternatively, you can rebuild the dll using Mono or other versions of Visual Studio
(the library source is in threescale.net.src.tar.gz)

2) Import the 3scale lib to your C sharp code

using CS_threescale;

3scale library depends on:

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Net;


3) Examples of usage:

3.1) Initialize

_3ScaleAPI = new Api(3SCALE_SERVER,PROVIDER_KEY);

3.2) Add usage costs

Hashtable costs = new Hashtable();
costs.Add("hits", "1");
costs.Add("storage", "20480");

3.3) Start transaction

TransactionData tdata = _3ScaleAPI.Start(USER_KEY, costs);
or
TransactionData tdata = _3ScaleAPI.Start(USER_KEY);

TransactionData is an object with three getters:

ID: String tdata.ID
Contract name: String tdata.ContractName;
Provider verification key: String tdata.ProviderVerification

3.4) Confirm transaction

_3ScaleAPI.Confirm(tdata.ID);
or 
_3ScaleAPI.Confirm(tdata.ID,costs);

3.5) Cancel transaction

_3ScaleAPI.Cancel(tdata.ID);

3.6) Upon errors the API will return exceptions as ApiException

Console.WriteLine("Error occured : " + err.GetType().Name + "\n");
Console.WriteLine("Error type : " + err.ErrorReturn.ID + "\n");
Console.WriteLine("Description : " + err.ErrorReturn.ServerMessage + "\n");


4) Legal

Copyright (c) 2008 3scale networks S.L., released under the MIT license.