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

Payment service consumers should be able to specify url after payment

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test requirements

      Test setup (Needed for both test 1 and test 2):

      1. Log in as an administrator and enable PayPal gateway in "Site administration > Plugins > Payment gateway > Manage payment gateways" (it is enabled by default).
      2. Create a Payment account via "Site administration > Payments > Payment accounts".
        1. Configure the PayPal gateway clicking "PayPal" under "Payment gateways column". Use the Client ID and Secret you have for your Sandbox App in PayPal. Make sure to set the environment to "Sandbox" and check "Enable".
      3. Visit "Site administration > Plugins > Enrolments > Manage enrol plugins" and enable the "Enrolment on payment" plugin
      4. Go to a course 'Enrolment methods' via the gear menu or the Administration block
      5. Add Enrolment on payment as an enrolment method and set "Enrolment fee" to $10

      Test 1

      1. Log in as a user who is not enrolled in the course and attempt to enrol in the course
      2. Click on Select payment type button, select PayPal as the payment method, and then proceed with the payment on PayPal using a sandbox personal account
      3. Verify that you are redirected to the course home page after you proceed with the payment.

      Test 2

      1. Edit the file enrol/fee/classes/payment/service_provider.php and change the last line of the get_success_url function to:
        • return new \moodle_url('/my');
      2. Log in as a user who is not enrolled in the course and attempt to enrol in the course
      3. Click on Select payment type button, select PayPal as the payment method, and then proceed with the payment on PayPal using a sandbox personal account
      4. Verify that you are redirected to your dashboard after you proceed with the payment.

       

      Show
      Test requirements A PayPal developer account and sandbox accounts (at least 1 business and 1 personal account). For more information, see  https://developer.paypal.com/developer/accounts/ A sandbox Merchant App (you can create Apps at  https://developer.paypal.com/developer/applications ). Click on your App name to get a Client ID and Secret. You will need them for the test. Test setup (Needed for both test 1 and test 2): Log in as an administrator and enable PayPal gateway in "Site administration > Plugins > Payment gateway > Manage payment gateways" (it is enabled by default). Create a Payment account via "Site administration > Payments > Payment accounts". Configure the PayPal gateway clicking "PayPal" under "Payment gateways column". Use the Client ID and Secret you have for your Sandbox App in PayPal. Make sure to set the environment to "Sandbox" and check "Enable". Visit "Site administration > Plugins > Enrolments > Manage enrol plugins" and enable the "Enrolment on payment" plugin Go to a course 'Enrolment methods' via the gear menu or the Administration block Add Enrolment on payment as an enrolment method and set "Enrolment fee" to $10 Test 1 Log in as a user who is not enrolled in the course and attempt to enrol in the course Click on Select payment type button, select PayPal as the payment method, and then proceed with the payment on PayPal using a sandbox personal account Verify that you are redirected to the course home page  after you proceed with the payment. Test 2 Edit the file enrol/fee/classes/payment/service_provider.php and change the last line of the get_success_url function to: return new \moodle_url('/my'); Log in as a user who is not enrolled in the course and attempt to enrol in the course Click on Select payment type button, select PayPal as the payment method, and then proceed with the payment on PayPal using a sandbox personal account Verify that you are redirected to your dashboard after you proceed with the payment.  
    • Affected Branches:
      MOODLE_311_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull from Repository:
    • Pull 3.11 Branch:
      MDL-70287-311-3
    • Pull Master Branch:
      MDL-70287-master-3
    • Story Points:
      0
    • Sprint:
      Internationals - 3.11 Sprint 2, Internationals - 3.11 Sprint 3, Internationals - 3.11 Sprint 4, Internationals - 3.11 Sprint 5

      Description

      At the moment, the page is refreshed when a payment is successful.
      Payment consumer plugins should be able to specify a URL they wish the user to be redirected to after successful payment.

        Attachments

          Activity

            People

            Assignee:
            rezaie9 Shamim Rezaie
            Reporter:
            rezaie9 Shamim Rezaie
            Peer reviewer:
            Michael Hawkins
            Integrator:
            Sara Arjona (@sarjona)
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/May/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 7 hours, 12 minutes
                3d 7h 12m