Billing module

Discussion in 'Installation/Configuration' started by Giuseppe, Jul 18, 2011.

  1. Giuseppe

    Giuseppe New Member

    Hi,
    i have installed the ispconfig billing module on follow environment:
    ispconfig 3.0.3.3 - debian 6 i386 - billing REV-1
    my ispconfig is installed on domain sample.tld and use https and port 8443.
    Now i follow the instruction for integration billing-paypal using the proxy script modified for https and port 8443 but it not work.
    I tried to use standard installation of ispconfig with http and port 80 and it work.
    I used paypal sandbox for my test.
    How can i use my ispconfig with https and port 8443 with billing-paypal integration?
    Thank you very much.

    Giuseppe
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please see the script in chapter 9.1 of the billing module manual:

    http://www.ispconfig.org/downloads/ispconfig3_billing_addon_en.pdf

    You must install that script in a webspace which is reachable by port 80 or 443. Then edit script and set the URL inside to match your ispconfig interface URL and port, be careful to use the correct URL there incl https at the beginning if your ispconfig is ssl encrypted.

    Make sure that you installed the php curl extension and that your php binary supports ssl.

    The script is tested with paypal sandbox on debian 5.0 and 6.0, it works with any port.
     
  3. Giuseppe

    Giuseppe New Member

    Hi,
    but the script work and i see the message that payment is succesfull or that payment is unsuccesfull.
    The problem is that the payd/on payd flag don't is update.
    The environment is correctly installed because if i change ispconfig from https on port 8443 to http on port 8080 and all reference o this the payd/unpayd is update correctly.
    Any ideas?
    Thanks.

    Giuseppe
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Make sure that you installed the php curl extension and that your php binary supports ssl.

    And which message do you get when you open the ipn.php script in the webbrowser?
     
  5. Giuseppe

    Giuseppe New Member

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    you can use e.g. the phpinfo() command.

    Thats the correct response of the script, but the wrong URL to test this. Please open the ipn wrapper script that you installed in your website, not the target URL.

    If the wrapper is installed and configured corrcetly, it must show you the same message "Direct access not allowed!", as it redirects all input to the ispconfig script and gives back all output generated by the ispconfig script.
     
  7. Giuseppe

    Giuseppe New Member

    billing

    i add the following information:
    in my environment the billing module add wrong link to the payment email and to come back from paypal gateway payment, it add http://www.mydomain.tld:8443/billing/payments/pay.php?id=
    and not https://www.mydomain:8443/billing/payments/pay.php?id=
    so i modified /usr/local/ispconfig/interfaces/web/billing/payments/pay.php
    from $ispconfig_url = $app->functions->get_ispconfig_url();
    to $ispconfig_url = 'https://www.mydomain:8443';
    and so the link are correct.
     
  8. Giuseppe

    Giuseppe New Member

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Please undo these modifications. Just set the URL to the IPN proxy script under Billing > Global Settings > Payment providers > Paypal notify URL field as described in the Billing module manual.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the problem is in the wrapper script and not the billing module part.

    There are a few options available to debug php curl connections in the php manual.

    http://us.php.net/curl

    especially the function :

    curl_setopt($ch, CURLINFO_HEADER_OUT, 1);

    added bfeoe the culr_exec line and

    echo curl_getinfo($ch, CURLINFO_HEADER_OUT);

    added after the curl_exec line.

    might help you to find the problem.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

  12. Giuseppe

    Giuseppe New Member

    billing

    Hi,
    i check the problem and is it in the script and exactly:
    if i comment the follow line the script respond with Direct access not allowed
    but where is the problem in the following lines?

    Modified for testing purpose only script:
    <?php
    $url = 'https://www.mydomain.tld:8443/billing/payments/paypal/ipn.php';
    $fields = $_POST;
    --> //if (count ( $fields )> 0) {
    --> //url-ify the data for the POST
    --> //foreach ( $fields as $key => $value ) {
    --> //$fields_string .= $key . '=' . $value . '&';
    --> //}

    rtrim ( $fields_string, '&' );
    //open connection
    $ch = curl_init ();
    //set the url, number of POST vars, POST data
    curl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt ( $ch, CURLOPT_URL, $url );
    curl_setopt ( $ch, CURLOPT_POST, count ( $fields ) );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $fields_string );
    //execute post
    $result = curl_exec ( $ch );
    //close connection
    curl_close ( $ch );
    --> //}
    ?>
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The lines are ok, they create the POST request. If you remove them, the script will not forward any information to ispconfig so that pypal will not work without these lines.

    Please add the lines again and try what I suggested to you in #10 and #11 in this thread.
     

Share This Page