Hero Doug

Registered
Jul 6, 2004
2
0
151
I was looking at modern bill and noticed that they have a feature where if a payment is late, they'll suspend the account, when they payment is made they'll unsuspend the account.

http://www.modernbill.com/features/index.htm?type=newfeatures

I was wondering how they interfaced with Cpanel to accomplish this?

I'd like to have a feature like this in my billing software (It's custom) as well.
 

FriedEgg

Active Member
Sep 27, 2003
40
0
156
Washington, DC
It looks like CPanel recommends the use of the Remote Access Key and Cpanel::Accounting module for Perl.

http://web.cpanel.net/manual/remoteaccess.html

There's even a "Suspend" method listed.

Another way to do it using PHP might be to use curl (in php) to open an https session to the server with authentication as root (or another user with access to suspensions). You could then call the WHM script that handles suspension, ie /scripts2/suspendacct?... etc. It wouldn't even require a POST form submit. The problem of course would be you'd have the user's password stored somewhere, so you'd need to handle that carefully.
 

Hero Doug

Registered
Jul 6, 2004
2
0
151
That's a good link, but appears to be for Perl, it shouldn't be hard to do it with Curl. The hardest part would be accessing the correct server that's all.

I just thought they may have had an interface already designed like a payment gateway has.