1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

How do I set up PayPal for automatic payments?

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by hardlink, Oct 24, 2011.

  1. hardlink

    hardlink New Pleskian

    13
    35%
    Joined:
    Oct 20, 2011
    Messages:
    21
    Likes Received:
    0
    I am running Plesk 10.3.1 with CBM 10.3.0 on Centos 5.5.

    I have read the manual for CBM 10.3.0 and it says...
    However, there is no place on the CBM payment gateway config for me to enter these two?

    I have got ID, Item Name, Test Mode, Display Logo, etc but no Return URL or Cancel URL?

    The payment for paypal seems to be accepted and I have the correct hash from the "orderform user" in my gateway.php as instructed.

    But there is no return page, and CBM hasn't recognized the payment (IPN url is there but how would I test that?)

    Is PayPal supposed to tell my panel that the payment was successful?
    How long should this take?
    Should there be a Return/Cancel URL?

    Does anyone have any advice on this please?
     
  2. EugeneL

    EugeneL Regular Pleskian

    20
    57%
    Joined:
    Feb 18, 2011
    Messages:
    461
    Likes Received:
    0
  3. hardlink

    hardlink New Pleskian

    13
    35%
    Joined:
    Oct 20, 2011
    Messages:
    21
    Likes Received:
    0
    Hi, thanks for your suggestion.

    I used paypal's sandbox test tool (Test IPN tool) but when I run it it returns...
    I am using https://cp.mydomain.com:8443/plesk-billing/gw/paypal.php

    I can connect to this if I type it in a browser it gives me a blank page (no errors). If I try http://cp.mydomain.com/plesk-billing/gw/paypal.php browser gives 404.

    I have an SSL cert on my site which is from GoDaddy (valid to cp.mydomain.com) and I can see no ssl errors when visiting the gw script in internet explorer.

    Any idea why PayPal cannot see the plesk-billing IPN script?

    I really need this to work!
    using Plesk 10.3.1 with CBM 10.3
     
  4. hardlink

    hardlink New Pleskian

    13
    35%
    Joined:
    Oct 20, 2011
    Messages:
    21
    Likes Received:
    0
    Think I found the answer, now what?

    A blogg...
    http://www.blograndom.com/blog/2008/09/paypal-ipn-from-the-sandbox-not-working/

    Says....
    Parallels are using port 8443!

    Please could you suggest a fix?
     
  5. EugeneL

    EugeneL Regular Pleskian

    20
    57%
    Joined:
    Feb 18, 2011
    Messages:
    461
    Likes Received:
    0
    Hello, hardlink

    Looks like there are two issues:
    1. PayPal rejects to work over HTTPS protocol with custom port
    2. You Web Server doesn't allow to connect to cp.mydomain.com over HTTP protocol with standard port.

    I'll try to investigate the issue and solve this in software directly.

    But for now you need to set up port forwarding manually - to forward https://cp.mydomain.com/ (actually https://cp.mydomain.com:443/) to https://cp.mydomain.com:8443/
    If you do not know how to do this, you can try to set up own site in Panel - go there and create own (admin's) subscription with domain cp.domain.com and then put there a PHP file from this article - http://www.arolabs.com/php/paypal-ipn-postback-on-a-custom-port/
     
  6. EugeneL

    EugeneL Regular Pleskian

    20
    57%
    Joined:
    Feb 18, 2011
    Messages:
    461
    Likes Received:
    0
    The proposed solution works for me.
    What I did:
    1. I created a subscription in Plesk with domain "domain.com", enabled debug mode in CBM using http://kb.parallels.com/en/9300

    2. I created script paypal.php and log file paypal_ipn_log.txt in site root (httpdocs directory)
    3. I checked that I can access "http://domain.com/paypal.php" via browser (new items in log). I checked that PayPal can access this URL using Sandbox IPN test tool (much more items in log. I checked that new item appeared in CBM debug log (/plesk-billing/gw/paypal.php - log of how CBM attempted to parse the PayPal message)

    4. I configured PayPal gateway in CBM, specified IPN URL as "http://domain.com/paypal.php" and bought hosting in online store. IPN message was successfully delivered to CBM, parsed and corresponding invoice was marked as paid.

    Hope this will help you.
     
  7. hardlink

    hardlink New Pleskian

    13
    35%
    Joined:
    Oct 20, 2011
    Messages:
    21
    Likes Received:
    0
    Thank you EugeneL! (Detailed feedback...)

    EugeneL,

    Your script for the CURL SSL port redirect for Paypal IPN worked perfectly whereas mine didn't!
    (Peeps: Don't forget to set permissions/owner on your paypal_ipn_log.txt log file so apache can write to it)

    The difference was clear, your script ignores SSL verification.
    My certificate however was not self signed, but a GoDaddy "Turbo SSL Certificate".

    But when I tried your script without the two options for self signed certs, I had an error...
    The problem ended up being that I hadn't added my CA bundle chain file (gd_bundle.crt) to Plesk for the site to verify the certificate locally.
    I re-installed my certificate.crt WITH the ca_bundle.crt using the Plesk SSL GUI panel.

    That's it! My certificate now works.

    Hope that this thread helps someone else in need!

    EugeneL you are a star x
     
    Last edited: Oct 27, 2011
  8. EugeneL

    EugeneL Regular Pleskian

    20
    57%
    Joined:
    Feb 18, 2011
    Messages:
    461
    Likes Received:
    0
    Thanks, hardlink

    I'm happy to hear that your issue is solved.

    Naturally you can remove all logging from the script (all lines with calls to fopen/fputs/fclose) because without configured log rotation but with active usage the log file can become quite large.
     
Loading...