Scenario 8: CFScript

From Intrannuity

Jump to: navigation, search

Download Source File

<cfscript>
	// Create Session component
	session = CreateObject( 'component', 'Session' );
	// Login
	session.login(2000, "password", "http://server.ibillingclient.org/ibilling/xmlhttps");
	// Find payment plan
	paymentPlan  = session.loadPaymentPlan("cfs.pp-2");
	// Add 2 freeze after first week
	paymentPlan.add(1, 2, true);
	// 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
		WriteOutput(ex.message);
		return ;
	}
	// Logout
	session.logout();
 
 
</cfscript>

Download Source File

Personal tools