Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61741

Minor PayPal enrolment issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.5, 3.4.2
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide

      The point of the test is to make sure that PayPal enrolments still work (anti-regression test).

      Preparing the testing environment:

      • Test site with a public URL (ngrok may help)
      • PayPal account
      • Put $CFG->usepaypalsandbox = 1; into the site's config.php
      • Prepare three separate browser sessions so that you can be logged in as a different user in each of them.

      Test

      Browser 1
      1. In the first browser session, log in to https://developer.paypal.com/developer/accounts/ to get the seller (facilitator) and the buyer sandbox account credentials. You may have to set the passwords for these accounts by expanding the email column, clicking on "Profile" and clicking on "Change password
      2. Log in to Moodle, enable and configure the PayPal enrolments. Use the sandbox seller's emails as the "PayPal business email"
      3. Create a course.
      4. Go to Participants
      5. Click on the cog menu and select "Enrolment methods".
      6. Add the Paypal enrolment method.
      Browser 2
      1. In the second browser session, log in to https://www.sandbox.paypal.com as the seller
      2. Go to "Profile > Profile and settings > My selling tools > More selling tools > PayPal button language encoding"
      3. Make sure you have your website's language set to "Western European Languages"
      4. Click the "More Options" button
      5. Set encoding to "UTF-8" and let the same encoding be used for IPN, too.
      6. Go to "Profile > Profile and settings > My selling tools > Getting paid and managing my risk > Instant payment notifications > Update"
      7. Turn IPN on and set the notification URL to your site's "enrol/paypal/ipn.php" (e.g. "http://[URL_TO_YOUR_MOODLE]/enrol/paypal/ipn.php")
      8. Go to "Profile > Profile and settings > My selling tools > Getting paid and managing my risk > Block payments > Update"
      9. Set "Allow payments sent to me in a currency I do not hold" to Yes.
      Browser 3
      1. Before starting this, you may want to watch your Moodle's access log for incoming POST requests for enrol/paypal/ipn.php (so that you know when PayPal sends the payment verification). For example:

        tail -f /var/log/apache2/error.log
        

      2. In the third browser session, log in to your site as a student.
      3. Attempt to enrol in the course via PayPal
      4. When asked to log in to PayPal, log in as the sandbox buyer.
      5. Pay for the course via PayPal
      6. TEST: Confirm that the user is enrolled into the course (Note it may take some seconds or a minute for PayPal to send us the IPN, upon which we enrol the user).
      7. CHECK: You Moodle's error log does not contain any PHP notices or Moodle warnings related to the ipn.php file

      Notes and tips

      • When logged in as the seller into the paypal sandbox, there is an IPN history report available at the Classic view Activity
      Show
      The point of the test is to make sure that PayPal enrolments still work (anti-regression test). Preparing the testing environment: Test site with a public URL (ngrok may help) PayPal account Put $CFG->usepaypalsandbox = 1; into the site's config.php Prepare three separate browser sessions so that you can be logged in as a different user in each of them. Test Browser 1 In the first browser session, log in to https://developer.paypal.com/developer/accounts/ to get the seller (facilitator) and the buyer sandbox account credentials. You may have to set the passwords for these accounts by expanding the email column, clicking on " Profile " and clicking on " Change password "  Log in to Moodle, enable and configure the PayPal enrolments. Use the sandbox seller's emails as the "PayPal business email" Create a course. Go to Participants Click on the cog menu and select " Enrolment methods ". Add the Paypal enrolment method. Browser 2 In the second browser session, log in to https://www.sandbox.paypal.com as the seller Go to " Profile > Profile and settings > My selling tools > More selling tools > PayPal button language encoding " Make sure you have your website's language set to " Western European Languages " Click the " More Options " button Set encoding to " UTF-8 " and let the same encoding be used for IPN, too. Go to " Profile > Profile and settings > My selling tools > Getting paid and managing my risk > Instant payment notifications > Update " Turn IPN on and set the notification URL to your site's " enrol/paypal/ipn.php " (e.g. " http://[URL_TO_YOUR_MOODLE]/enrol/paypal/ipn.php ") Go to " Profile > Profile and settings > My selling tools > Getting paid and managing my risk > Block payments > Update " Set " Allow payments sent to me in a currency I do not hold " to Yes. Browser 3 Before starting this, you may want to watch your Moodle's access log for incoming POST requests for enrol/paypal/ipn.php (so that you know when PayPal sends the payment verification). For example: tail -f /var/log/apache2/error.log In the third browser session, log in to your site as a student. Attempt to enrol in the course via PayPal When asked to log in to PayPal, log in as the sandbox buyer. Pay for the course via PayPal TEST : Confirm that the user is enrolled into the course ( Note it may take some seconds or a minute for PayPal to send us the IPN, upon which we enrol the user). CHECK : You Moodle's error log does not contain any PHP notices or Moodle warnings related to the ipn.php file Notes and tips When logged in as the seller into the paypal sandbox, there is an IPN history report available at the Classic view Activity
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull 3.4 Branch:
      MDL-61741-34-paypal
    • Pull Master Branch:
      MDL-61741-master-paypal

      Description

      While working on MDL-61392, some minor issues were detected in the PayPal enrolment plugin. It was suggested by the integration team there to submit them in a standalone issue.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h