Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / enrol / authorize / const.php
blobc66698625b61dfd2576f7d4c44ab60b011491aed
1 <?php // $Id$
3 /**#@+
4 * Authorize.net payment methods.
6 * Credit Card (cc)
7 * eCheck (echeck)
8 */
9 define('AN_METHOD_CC', 'cc');
10 define('AN_METHOD_ECHECK', 'echeck');
11 /**#@-*/
13 /**#@+
14 * Order status used in enrol_authorize table.
16 * NONE: New order or order is in progress. TransactionID hasn't received yet.
17 * AUTH: Authorized/Pending Capture.
18 * CAPTURE: Captured.
19 * AUTHCAPTURE: Authorized/Captured
20 * CREDIT: Refunded.
21 * VOID: Cancelled.
22 * EXPIRE: Expired. Orders be expired unless be accepted within 30 days.
24 * These are valid only for ECHECK:
25 * UNDERREVIEW: Hold for review.
26 * APPROVEDREVIEW: Approved review.
27 * REVIEWFAILED: Review failed.
28 * TEST: Tested (dummy status). Created in TEST mode and TransactionID is 0.
30 define('AN_STATUS_NONE', 0x00);
31 define('AN_STATUS_AUTH', 0x01);
32 define('AN_STATUS_CAPTURE', 0x02);
33 define('AN_STATUS_AUTHCAPTURE', 0x03);
34 define('AN_STATUS_CREDIT', 0x04);
35 define('AN_STATUS_VOID', 0x08);
36 define('AN_STATUS_EXPIRE', 0x10);
37 define('AN_STATUS_UNDERREVIEW', 0x20);
38 define('AN_STATUS_APPROVEDREVIEW', 0x40);
39 define('AN_STATUS_REVIEWFAILED', 0x80);
40 define('AN_STATUS_TEST', 0xff); // dummy status
41 /**#@-*/
43 /**#@+
44 * Actions used in authorize_action() function.
46 * NONE: No action. Function always returns false.
47 * AUTH_ONLY: Used to authorize only, don't capture.
48 * CAPTURE_ONLY: Authorization code was received from a bank over the phone.
49 * AUTH_CAPTURE: Used to authorize and capture (default action).
50 * PRIOR_AUTH_CAPTURE: Used to capture, it was authorized before.
51 * CREDIT: Used to return funds to a customer's credit card.
52 * VOID: Used to cancel an exiting pending transaction.
54 * Credit rules:
55 * 1. It can be credited within 120 days after the original authorization was obtained.
56 * 2. Amount can be any amount up to the original amount charged.
57 * 3. Captured/pending settlement transactions cannot be credited,
58 * instead a void must be issued to cancel the settlement.
59 * NOTE: It assigns a new transactionID to the original transaction.
60 * We should save it, so admin can cancel new transaction if it is a mistake return.
62 * Void rules:
63 * 1. These requests effectively cancel the Capture request that would start the funds transfer process.
64 * 2. It mustn't be settled. Please set up settlement date correctly.
65 * 3. These transactions can be voided:
66 * authorized/pending capture, captured/pending settlement, credited/pending settlement
68 define('AN_ACTION_NONE', 0);
69 define('AN_ACTION_AUTH_ONLY', 1);
70 define('AN_ACTION_CAPTURE_ONLY', 2);
71 define('AN_ACTION_AUTH_CAPTURE', 3);
72 define('AN_ACTION_PRIOR_AUTH_CAPTURE', 4);
73 define('AN_ACTION_CREDIT', 5);
74 define('AN_ACTION_VOID', 6);
75 /**#@-*/
77 /**#@+
78 * Return codes for authorize_action() function.
80 * AN_RETURNZERO: No connection was made on authorize.net.
81 * AN_APPROVED: The transaction was accepted.
82 * AN_DECLINED: The transaction was declined.
83 * AN_REVIEW: The transaction was held for review.
85 define('AN_RETURNZERO', 0);
86 define('AN_APPROVED', 1);
87 define('AN_DECLINED', 2);
88 define('AN_ERROR', 3);
89 define('AN_REVIEW', 4);
90 /**#@-*/