Jump to content

adamvalcato

Member
  • Posts

    6
  • Joined

  • Last visited

About adamvalcato

adamvalcato's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. In the end I had to just have my code set all the address fields to "-" so that they wouldn't be empty. It's a little ugly, but it's the best way I could find (I tried just setting it to a space, but WHMCS seems to strip away whitespace so that didn't work).
  2. With the VPS.net module (if I understand correctly) it is necessary to choose in advance which zones we want to offer, so we have to set either the Template/Zone to a specific value in module settings or in the configurable options. What then happens when a zone then becomes unavailable later on? For example, when I started setting things up yesterday, Zone I (#24) was the only London zone which was available. Now this afternoon Zone I isn't available for new machines, but zones F (#20) and H (#23) are available. Does this get handled sensibly by the module when someone places a new order? Or are we expected to keep track of which zones are available each day and constantly be updating our product settings?
  3. The documentation for the VPS.net module says the following about the "Enable Backups" option: http://docs.whmcs.com/VPS.Net It's not clear how this works. VPS.net offer three or four different backup options; which one does this enable? And is there a way to offer the others?
  4. I've tried setting the address to the empty string and a single space (and also after testing it seems city, state, postcode and phonenumber are also required). Neither of those worked, so I'm now just setting them to '-', which does work but is kind of ugly. Also, the API docs imply that the welcome email will be sent automatically unless noemail=true, but that doesn't seem to be the case. (Setting noemail=false doesn't make a difference.) Here's an excerpt from my code if you're interested (this is in Python): class WHMCS: def execute(self, action, args): args.update({'username': self.user, 'password': self.password, 'action': action}) params = urllib.urlencode(args) result = urllib.urlopen(self.url, params).read() out = dict() for field in result.split(';'): if len(field) > 0: pair = field.split('=', 1) if len(pair) == 2: out.update({pair[0]:pair[1]}) if out['result'] == 'error': raise WHMCSAPIException(out['message']) return out def addclient(self, firstname, lastname, email, **kwargs): kwargs.update({'firstname': firstname, 'lastname': lastname, 'email': email}) defaults = {'password2': random_password()} blank_defaults = ['address1', 'city', 'state', 'postcode', 'phonenumber'] for (k,v) in zip(defaults.keys(), defaults.values()): if not k in kwargs: kwargs.update({k:v}) for k in blank_defaults: if not k in kwargs: kwargs.update({k:'-'}) return self.execute('addclient', kwargs)
  5. In WHMCS I can create clients with just their name and email address, but when using the API it seems the address is also required. I get: I guess I can just set the required fields to dummy values, but is this a bug in the API or is this the intended behaviour?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated