billputer / go-namecheap

A Go library for using the Namecheap API
MIT License
49 stars 28 forks source link

func DomainGetInfo("mydomain.com") don't work? #22

Closed remotejob closed 4 years ago

remotejob commented 6 years ago

2018/09/05 05:24:53 strconv.ParseBool: parsing "NotAlloted": invalid syntax panic: strconv.ParseBool: parsing "NotAlloted": invalid syntax

mrThe commented 5 years ago

Error raised in case of whois guard is not allowed (eg: for .us domains). Namecheap devs made a typo on "NotAllowed". Hotfix: in domain.go, find struct Whoisguard and change option Enabled from bool to string.

It will compile and work, but I'm don't sure if this change does not break anything.

Also, sample of xml reponse:

      <Whoisguard Enabled="NotAlloted">
        <ID>0</ID>
      </Whoisguard>
jameshartig commented 4 years ago

It's not a typo. It means that you didn't purchase Whoisguard for that domain. You might not be able to purchase it for some domains, but I've seen NotAlloted for domains where it is available but just not purchased yet.

Anyways, this is fixed in my PR.