Git Product home page Git Product logo

qutcapstone2020's People

Contributors

erunx avatar harunaka11037 avatar mitch1404 avatar peterburnett avatar qnguy29 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

qutcapstone2020's Issues

Paypal payment setting page

Add to page:

  • Payment gateway enabled checkbox
  • Client ID textbox
  • Global course price textbox (floating point value if possible)
  • Currency drop down box
  • Color drop down box: [gold, blue, silver, white, black]
  • Shape drop down box: [rectangle, pill]

Add warning when changing course cost or currency

Changing the course cost or currency while a student is making a purchase can result in the transaction taking place but the student not being enrolled. This is because the IPN listener checks for inconsistencies in the transaction cost/currency and the current set cost/currency. This is done to thwart malicious users from tricking the plugin with a self-crafted transaction that has different values for cost/currency.

There is a window between the user loading the purchase.php page and the IPN being processed, in which changing the cost/currency can cause a false negative.

Have text in course_settings.php and paymentgateway_paypal settings warning admin to turn off the plugin first.

Cleanup

Fix various minor issues:

  • Display error message instead of PayPal payment button if admin has not set a Client ID
  • Display error message on course enrolment page if course price has not been set or course price is 0
  • Display error message on payment page if admin has not enabled any payment gateways
  • Ensure admin cannot insert negative course price
  • Add $plugin->requires to version.php
  • Fix course_settings.php to include the id GET parameter
  • Fix course_settings.php line 34 uses raw string for moodle_exception

Paypal subplugin settings page

Add to the page:
Client ID textbox
Currency drop down box
Color drop down box: [gold, blue, silver, white, black]
Shape drop down box: [rectangle, pill]

Add temporary purchasable courses page.

  • Lists all courses that can be purchased (For now, just try to list any courses)
  • All courses are displayed with their name, a brief description, their cost, their final enrolment date and a 'Purchase' Button. (Just have the cost be a random number for now)

No Cost Set; Purchase.php

Enrollment type can be set to purchase, but cost can be left blank. Or, for some reason, course price has been saved as null. Need to put a check for such in this page and possible on the enrollment button.

IPN refactoring

IPN needs refactoring to be testable. Currently IPN is just a script, needs to be an IPN class that can process and IPN. Put an IPN listener that listens for POST request from PayPal and creates IPN class.

While at it, ensure that edge case of 2 identical IPNs being received can be handled smoothly (occurs if paypal never received IPN validation from us for some reason, or if we were taking too long and a "retry" was sent just as we sent the original back). Should be handled by treating the second identical IPN as a normal IPN, but don't enrol the user a second time.

Create unit tests to test IPN by creating an IPN_test class that extends IPN class.

  • Replace IPN script with IPN class and listener script
  • Ensure it can handle edge case
  • Record error and don't enrol if something doesn't make sense (userid/courseid non-existant, paid amount/currency not correct)
  • Record IPN information in database
  • Check payment status
  • [ ]
  • Write unit tests

Cannot set course price for more than one course

The following error occurs when trying to set the course price for a second course.
Error writing to database
Debug info: Duplicate entry '0' for key 'mdl_tool_paymentplugin_course.PRIMARY' INSERT INTO mdl_tool_paymentplugin_course (courseid,cost) VALUES(?,?) [array ( 0 => 4, 1 => 0, )] Error code: dmlwriteexception

The issue seems to be the "id" field in the table not being set any value within the code, and so every entry tries to be entered with "id" value of 0. However "id" is a primary key and so an error is thrown.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.