Scenario 7: VB.NET

From Intrannuity

Jump to: navigation, search

Download Source File

Imports System
Imports System.Collections.Generic
 
Imports iBilling.Client
 
Module Scenario7
 
Sub Main()
	'Set up clients' settings
	Dim config = new Dictionary(Of String, Object)()
	config(SessionConnection.PROCESSOR_HOST) = "http://server.ibillingclient.org/ibilling/xmlhttps"
	config("debug") = true
	'Login
	Dim _session = Session.Login(2000, "welcome", config)
	'Find payment plan
	Dim paymentPlan = _session.LoadPaymentPlan("vb.pp-4")
	'Execute delete all charges
	paymentPlan.Cancel()
	'Mark object for persistence
	_session.Save(paymentPlan)
	'Synchronize changes with the server
	Try
		_session.Synchronize()
 
	Catch ex As Exception
		'Be sure to properly handle exception, this is just a sample solution
		Console.WriteLine(ex.Message)
		Exit Sub 
 
	End Try
	'Logout
	_session.Logout()
End Sub
 
End Module
Personal tools