Monday, Monday, September 03, 2001, 1:37:34 AM, Jim Carey wrote:

> Thanks Chuck. I have tested out William's approach and it will suit me
> really nicely - so the need is drifting away a little for me - my broken
> record can now be classed as a valuable antique :-)

I'll post it to the list again, because I've had like a dozen requests
off list for it, and this way it's in the archives so Chuck can
tell people where to find it when this comes up again and again and
again  :)

I can't provide support for this (and won't guarantee a prompt answer
if email me directly for help), but if you have a problem and ask on
list, you'll probably get the help you need since at least 3 RSPs on
the list have implemented this after I gave them these snippets, and
I'm sure one of us will see it and be able to help you that way.

(Some perl experience is required, if you don't have it, then I
suggest finding someone who you can hire cheaply to do it for you, and
I can provide referrals)

Remember, I've not implemented it myself, but here are the snippets
you should be able to use to get it working for yourself:

Add this to the top of the script:
use LWP;
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request;
use HTTP::Status;


Then when you need to process the order (after submitting it via the
API into the pending order section) do this:

$username = "USERNAME";
$password = "PASSWORD";
my $ua = LWP::UserAgent->new;
my $cookies = HTTP::Cookies->new;       # Create a cookie jar
$ua->cookie_jar($cookies);              # Enable cookies
$req = new HTTP::Request('GET', 'https://rr-n1-tor.opensrs.net/resellers/index');
$req2 = new 
HTTP::Request('GET','https://rr-n1-tor.opensrs.net/resellers/index?username=$username&password=$password&action=login');
my $response = $ua->request($req);
my $response2 = $ua->request($req2);

# Can add some error checking in here, I didn't

# You can see the [] data in this URL, where you insert the orderid and
# domain name.
$req3 = new
HTTP::Request('GET','https://rr-n1-tor.opensrs.net/resellers/index?process_[orderid]=1&name_[orderid]=[domain]&action=process_pending');

my $response3 = $ua->request($req3);
$resp = $response3->content();
if ($resp =~ /Domain registration successfully completed/) {
  ### Success code
} else {
  ### Failure code
}


You can do this in PHP also, using very similar code, except instead
of perl's LWP modules, you would need to make sure PHP was compiled
with libcurl support (most efficient), or have PHP call a curl binary
(less efficient).


-- 
Best regards,
William X Walsh <[EMAIL PROTECTED]>
Userfriendly.com Domains
--

Reply via email to