The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Send to paypal while account is being created

Discussion in 'General Discussion' started by SixDeep, Dec 25, 2005.

  1. SixDeep

    SixDeep Registered

    Joined:
    Dec 24, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    This being my first post, I would like to thank all of you for helping me demistify the account creation process. You will recognize the scripts I have used. What I would like to do is this;

    The new hosting client fills out a form, after submit they get sent to Paypal immediately. While they are at Paypal paying for their hosting, my account creation script kicks in and does its work. By the time they are finished with paypal, they are brought back to my site and they never had to sit through that wait. Make sense?

    I am trying this with a header redirect at the top, but it still makes me sit through the account creation process, then sends me over to paypal afterwards.

    This is my current code

    PHP:
    header ("location: http://www.paypal.com");
    require 
    '/usr/local/cpanel/Cpanel/Accounting.php.inc';
        
    $host "localhost";
        
    $user "WHM Username";
        
    $accesshash =  "WHM Access Key";    

    $usessl "0"
    //this section takes the info from the form, putting it into variables for the below section
    $acctdomain $_POST['domain'];
    $acctuser $_POST['username'];
    $acctpass $_POST['password'];
    $email $_POST['email'];
    $acctplan "HOSTING PLAN GOES HERE";
    $do createacct($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan,$email);
    //way to get their contact email associated with their acct
    $objFile fopen("dump/contactemail_"$acctuser .".txt""w+");
    fwrite($objFile$email);
    fclose($objFile);
    $conn_id ftp_connect("nn.nnn.nn.nn");
    $login_result ftp_login($conn_id$acctuser$acctpass);
    $upload ftp_put($conn_id".contactemail""dump/contactemail_"$acctuser .".txt"FTP_BINARY); 
    if (!
    eregi("wwwacct creation finished",$do)){
    echo 
    "There has been a problem with your account creation!<br>Please contact support for help!";
    }
    else
    {
    }
    ?> 
    Suggestions?
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
  3. SixDeep

    SixDeep Registered

    Joined:
    Dec 24, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I can see why it would appear that way lol

    The only reason why I asked is because perhaps some other folks here might have something similiar setup as far as account creation/payment gateway goes. I am trying to build up a hosting and billing system from scratch since I'm not really too pleased with Whoiscart and was hoping for more indepth control features. I will keep tinkering, thanks for the heads up.
     
  4. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    give modernbill a look at it will fully manage a cpanel server account

    www.modernbill.com
     
  5. SixDeep

    SixDeep Registered

    Joined:
    Dec 24, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    thanks. yea looked into that one a while ago. I guess I'm somewhat of a control freak when it comes to my site and its functions. If something goes down, I wanna be accountable and I wanna be able to fix it.

    Also, it's a nice bit of php education to get under the belt :)

    Thanks though!
     
  6. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    It will be a nice education in php and cpanel to do that, My problem is not the skill part as much as the hours required to implement and debug

    If you got the time go for it, Wish ya good luck :)
     
  7. Game Wizards

    Game Wizards Active Member

    Joined:
    Apr 6, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page