From Intrannuity
Download Source File
using System;
using System.Collections.Generic;
using iBilling.Client;
namespace iBilling.Samples
{
public class Scenario7
{
public static void Main(string[] args){
//Set up clients' settings;
Dictionary<string, object> config = new Dictionary<string, object>();
config[SessionConnection.PROCESSOR_HOST] = "http://server.ibillingclient.org/ibilling/xmlhttps";
config["debug"] = true;
//Login;
Session session = Session.Login(2000, "welcome", config);
//Find payment plan;
PaymentPlan paymentPlan = session.LoadPaymentPlan("csharp.pp-4");
//Execute delete all charges;
paymentPlan.Cancel();
//Mark object for persistence;
session.Save(paymentPlan);
//Synchronize changes with the server;
try{
session.Synchronize();
}
catch(Exception ex){
//Be sure to properly handle exception, this is just a sample solution;
Console.WriteLine(ex.Message);
return ;
}
//Logout;
session.Logout();
}
}
}