120 Commits

Author SHA1 Message Date
ethem
f5fbea120f Fixed: MDL-7561
New forms api
2006-11-15 20:44:49 +00:00
ethem
19384dfb70 MDL-6937
MDL-7561
MDL-7562

Need to be used new forms api.

Please see also:

* enrol.php: check_entry(), config_form(), process_config()
* localfuncs.php: validate_cc_form(), validate_echeck_form()
2006-11-15 07:39:04 +00:00
ethem
3baecd1d7e Get payment managers at COURSE level. Merged from 17stable. 2006-11-03 12:09:00 +00:00
ethem
726bf1ead2 get_teacher() to get_users_by_capability(). 2006-11-03 11:20:13 +00:00
ethem
e40106c7db Fix for enrolurl(admin/users.php). Merged from 17stable. 2006-11-02 13:34:52 +00:00
ethem
af3e0ed2ea Make authorize.net config page secure.
See: http://moodle.org/mod/forum/discuss.php?d=56728
2006-11-01 12:36:19 +00:00
ethem
c9befcd1be If an user's credit card cannot be captured on the internet directly, obtain authorization code over phone from customer's bank.
Some users may not wish to use their credit cards on the internet directly for security reasons.
   In this case, you need to obtain an authorization code from user's bank.
   Initially, ask for credit card information from the customer
   like bank name, name on card, card number, expiry date and card validation code
   by means of phone, face-to-face or a billing application.
   Then, call the customer services of user's bank giving this information and demand an authorization code.
   Finally, after obtaining it, login as user to get the user enrolled.
   Alternatively, you can give it to the user saying enrol using this code.
2006-10-30 12:53:15 +00:00
ethem
9c746ce766 + New consts for authorize_action() function:
* AN_RETURNZERO: No connection was made on authorize.net.
  * AN_APPROVED: The transaction was accepted.
  * AN_DECLINED: The transaction was declined.
  * AN_REVIEW: The transaction was held for review.

+ Fix: Speacial handling for echecks: REVIEW; 'Under Review', 'Approved Review', 'Review Failed'
+ New feature: Upload a CSV file for echecks (capability: enrol/authorize:uploadcsv level: user)
+ New feature: Search payments by orderid and transid
+ New function: send_welcome_messages()

merged from 17stable.
2006-10-16 09:39:08 +00:00
ethem
9c59948e63 * enrol_into_course() doesn't send welcome message unless $course->welcomemessage is set.
This is actually good thing, because we can send our welcome message.

* enrol_into_course() added in Moodle(2006091700), so authorize plugin requires this version.
2006-10-03 18:00:48 +00:00
ethem
37f9ca4e8f Some cleanup for cron. 2006-09-22 16:19:53 +00:00
ethem
f0f8e34c5d isguest() to has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM, SITEID), $USER->id, false) 2006-09-22 15:31:04 +00:00
ethem
778326bef8 Some cleanup. 2006-09-22 14:04:11 +00:00
ethem
33f9bffe90 Last commit for enrol_student().
enrol_student($order->userid, $order->courseid, $timestart, $timeend, 'manual')
to
role_assign($role->id, $user->id, 0, $context->id, $timestart, $timeend, 0, 'manual'))
2006-09-22 13:50:10 +00:00
ethem
fddf3cfb56 + Changed deprecated enrol_student() function to enrol_into_course().
+ No need extra check: if (!empty($CFG->enrol_mailstudents)):  enrol_into_course calls email_welcome_message_to_user() internally.
2006-09-22 13:33:37 +00:00
ethem
b001dec454 No need get_student_courses() and get_teacher_courses() anymore. 2006-09-22 13:11:49 +00:00
ethem
131a7ca81b New config: Echeck bank account types enabled. 2006-09-04 12:09:30 +00:00
ethem
460635599a Autoconfigure accepted echeck bank account types. CHECKING, BUSINESSCHECKING, SAVINGS 2006-09-04 09:44:00 +00:00
ethem
07c48fcff6 Error message isn't shown when user clicked button without key if course key is set. 2006-09-04 07:09:44 +00:00
stronk7
afc36fdf2e Patch submitted by Ethem:
Error message isn't shown when user clicked without key.
Multienrol is enabled (course enrol key with authorize)

This patch allows showing error message when user clicked button without key.
2006-09-03 20:16:24 +00:00
ethem
be59e14b9e Remove +}
I like this format:
{
}

not {
}
2006-09-02 15:05:10 +00:00
ethem
6ce17f1ff0 Don't show "Notice: Undefined property: paymentmethod" 2006-09-02 13:42:28 +00:00
ethem
5b7e05d646 Submit buttons (ccsubmit, echecksubmit) are no longer used. Hidden field paymentmethod is enough for checking forms. 2006-09-02 13:09:21 +00:00
ethem
e3949d06af Moved all static functions in authorize class to localfuncs.php as normal function.
Removed abaval.php and ccval.php, because functions in these files moved to localfuncs.php.
2006-09-02 11:49:02 +00:00
ethem
a2cfb0ec00 FFFFFFFFAAAAAANNNNNNTTTTTAAAAASSSSTTTTTIIIIICCCCC
Echeck is ready for usage. I've been buying access into some test courses by echeck. :-)
2006-09-01 15:18:22 +00:00
ethem
79c63c4415 + New ENUM field: paymentmethod(cc,echeck);
Store in database and when calling authorize_action() pass this method. Hence, removed $method=AN_METHOD_CC from this function.
    If a refund will be do, unset($order->paymentmethod); Because this field comes when joining(enrol_authorize)

+ AN_METHOD_CC and AN_METHOD_ECHECK is now lower case, because these fields are stored in database as enum.
  Eloy's response:
   They are lowercase because we decided to use lowercase identifiers everywhere and enum contents are,
   from a DB perspective, identifiers.

  Ok, NP. :)) set_config('an_acceptmethods', strtolower($CFG->an_acceptmethods)); solves this.
2006-08-31 18:24:37 +00:00
ethem
fde7c9dfc5 Added Echeck UI validation. 2006-08-31 07:11:31 +00:00
ethem
35f4a0772a Autoconfigure credit card types. This is not a Makefile :))) 2006-08-30 18:59:53 +00:00
ethem
d1b86e65cc Some documentation. 2006-08-30 14:33:31 +00:00
ethem
edbe60abb6 Deleted comment. 2006-08-30 14:16:45 +00:00
ethem
75bb06e0aa Some UI changes. 2006-08-30 14:06:40 +00:00
ethem
6b1d27020d Ported AUTHORIZE_ECHECK changes into HEAD. (cvs update -j HEAD -j AUTHORIZE_ECHECK)
* New Feature (Authorize.net eCheck)

Authorize.Net provides an exclusive, fully integrated electronic check payment method, eCheck.Net.
Using eCheck.Net, merchants can accept and process payments from consumer and corporate bank accounts
directly from their Web site or through the Authorize.Net Virtual Terminal. By accepting electronic checks,
you expand the payment options available to new and existing customers, enhancing customer loyalty and
potentially increasing sales.

+ Lower Fees - Lower rates than credit cards or PayPal.
+ More Efficient - eCheck.Net does everything online, eliminating the cost and inconvenience of manually
  processing paper checks and waiting for checks in the mail.
+ Fully Integrated Solution - No third-party integration required implementing eCheck.Net is easy
  for merchants already using the Authorize.Net Payment Gateway.
+ Integrated Reporting - Provides a combined view of all eCheck.Net and credit card payment transactions.
  Reconcile payment and billing activity using online reports and statements.
+ Ship Product Sooner - Improved up-front transaction validation that returns the status of transactions faster.
+ Security - Authorize.Net uses the latest 128-bit Secure Socket Layer (SSL) technology for
  secure Internet Protocol (IP) transactions.


== TO DO ==

- Generate Echeck forms.
- Show users a echeck option if admin enabled echeck method.
- Allow admins/teachers to enrol a student using echeck method (FIX: role consept)

==========
2006-08-30 10:29:10 +00:00
ethem
98d415567c If review enabled, get_users_by_capability('enrol/authorize:managepayments') at SYSTEM_LEVEL and send email for a new pending payment. 2006-08-29 14:30:11 +00:00
ethem
70b1aa8071 get_users_by_capability('enrol/authorize:managepayments') and send email for pending orders expiring. 2006-08-29 13:59:35 +00:00
ethem
839958faf6 * $CFG->teachermanagepayments will have to go since we are moving away from the rigid hardcoded teacher role concept.
* If a teacher has_capability('enrol/authorize:managepayments'), send email about pending orders expiring.

* All isteacher converted to has_capability.
2006-08-14 15:06:11 +00:00
ethem
d9d69929f5 Don't show authorize.net password for security reasons. Merged from 16stable. 2006-07-31 12:45:34 +00:00
ethem
08b9be083c Bug: Sending email to admins/teachers the count of pending orders expiring. "Column 'timecreated' in where clause is ambiguous."
We joins 2 tables: course and enrol_authorize. We didn't select course.timecreated, but it gives this error.
Merged from MOODLE_16_STABLE.
2006-07-27 10:57:58 +00:00
ethem
36e5d9b7e1 Merged from 16stable. 2006-07-25 17:38:32 +00:00
ethem
fc9e83ed5c * Update record as soon as possible. If update/insert record fails email to admin to have update manually.
* ignore_user_abort(true) at critical section (before fwrite($fp, "POST /gateway/transact.dll).
   This is last change to ignore request for user.
 * Made some functions "static" to call function directly. So, no need new enrolment_plugin_authorize() instance.
   Now, these are static:
   get_list_of_creditcards, zero_cost, get_course_cost, prevent_double_paid, email_to_admin, check_openssl_loaded
 * Some mtrace cleanup. Removed default new line.

This is big work. When PHP5 is required for moodle in the future, I will add static modifier to functions.
Now and future, this plugin is/will unbreakable; Merged from MOODLE_16_STABLE. :)
2006-07-24 12:19:20 +00:00
ethem
411df816d6 - authorize_expired function added to lessen the code.
- All functions in authorize plugin are named with authorize_ prefix.

Merged from 16stable.
2006-07-10 10:17:23 +00:00
ethem
f9bfa458a2 Some outputting debugging info for cron. Merged from 16stable. 2006-07-06 13:41:55 +00:00
ethem
1c23b14db3 - Daily cron seperated from main cron for performance.
- Performance for welcome message sending to students. Order by student. This sends only one message for each students.

Merged from MOODLE_16_STABLE.
2006-07-06 12:01:24 +00:00
ethem
11fffc6059 Merged from MOODLE_16_STABLE. 2006-06-29 19:07:28 +00:00
ethem
b1c87d90dc $teacher is used in manual form. No need global. merged from 16stable. 2006-06-29 15:03:54 +00:00
ethem
665d43006a get_student_courses and get_teacher_courses functions added for future reference.
Cron description added. Merged from 16stable.
2006-06-29 12:44:01 +00:00
ethem
8389613abb Don't show choose method string if course cost is 0. Merged from 16stable. 2006-06-29 11:27:32 +00:00
ethem
c1f6386c47 Interactive plugins (authorize and paypal ) must use 'manual'.
Some patches must be applied to lib/db.
http://moodle.org/bugs/bug.php?op=show&bugid=5941
Look: version.patch, lib_db.patch

Eloy, your question about enrol fields for interactive plugins were solved.
Now, we sure we never use authorize and paypal field for backup and restore.
Because manual is active and cannot be disabled when restoring.
Bug #5358 - Add support for enrol systems in backup/restore
http://moodle.org/bugs/bug.php?op=show&bugid=5358&pos=0

Merged from 16 stable.
2006-06-29 10:38:34 +00:00
ethem
c1a2545882 Bug #5941 - Myriad of problems with Paypal enrollmemts, au_enrol.patch
Merged from 16 stable.
2006-06-29 09:49:36 +00:00
ethem
bd4669d344 Very small change. A little performance for cron if admin enabled sending email for pending orders expiring.
1- If dailysettlement is 00:05 and cron executes at this time, nothing will occur. If it is executes at 00:10 it works. I think "<" works faster then "<=" :))
2- Don't compare course->ids by authorize->courseid, because courses are grouped by courseid. We sure each line is unique.
3- Only get pendingorderexpiring strings for sending email if course teachers exist.

Merged from 16stable.
2006-06-20 17:22:00 +00:00
ethem
2bc509a3c1 $a->course: course information added. Merged from stable. 2006-06-15 14:23:04 +00:00
ethem
e3df6104f4 pendingordersemailteacher string added
merged from stable
2006-06-15 13:37:25 +00:00