mirror of
https://github.com/moodle/moodle.git
synced 2025-07-27 01:10:51 +02:00
Merged from MOODLE_17_STABLE.
This commit is contained in:
@@ -50,7 +50,7 @@ function authorize_process_csv($filename)
|
|||||||
|
|
||||||
/// We need these fields
|
/// We need these fields
|
||||||
$myfields = array(
|
$myfields = array(
|
||||||
'Transaction ID', // enrol_authorize.transid
|
'Transaction ID', // enrol_authorize.transid or enrol_authorize_refunds.transid; See: Reference Transaction ID
|
||||||
'Transaction Status', // Under Review,Approved Review,Review Failed,Settled Successfully
|
'Transaction Status', // Under Review,Approved Review,Review Failed,Settled Successfully
|
||||||
'Transaction Type', // Authorization w/ Auto Capture, Authorization Only, Capture Only, Credit, Void, Prior Authorization Capture
|
'Transaction Type', // Authorization w/ Auto Capture, Authorization Only, Capture Only, Credit, Void, Prior Authorization Capture
|
||||||
'Settlement Amount', //
|
'Settlement Amount', //
|
||||||
@@ -59,7 +59,7 @@ function authorize_process_csv($filename)
|
|||||||
'Authorization Amount', //
|
'Authorization Amount', //
|
||||||
'Authorization Currency', //
|
'Authorization Currency', //
|
||||||
'Submit Date/Time', // timecreated
|
'Submit Date/Time', // timecreated
|
||||||
'Reference Transaction ID', // enrol_authorize_refunds.transid
|
'Reference Transaction ID', // enrol_authorize.transid if Transaction Type = Credit
|
||||||
'Total Amount', // enrol_authorize.cost
|
'Total Amount', // enrol_authorize.cost
|
||||||
'Currency', // enrol_authorize.currency
|
'Currency', // enrol_authorize.currency
|
||||||
'Invoice Number', // enrol_authorize.id: Don't trust this! Backup/Restore changes this
|
'Invoice Number', // enrol_authorize.id: Don't trust this! Backup/Restore changes this
|
||||||
@@ -124,18 +124,24 @@ function authorize_process_csv($filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($reftransid) && $transstatus == 'Settled Successfully' && $transtype == 'Credit') {
|
if (!empty($reftransid) && $transstatus == 'Settled Successfully' && $transtype == 'Credit') {
|
||||||
if ($refund = get_record('enrol_authorize_refunds', 'transid', $reftransid)) {
|
if ($order = get_record('enrol_authorize', 'transid', $reftransid)) {
|
||||||
$order = get_record('enrol_authorize', 'id', $refund->orderid);
|
|
||||||
if (AN_METHOD_ECHECK == $order->paymentmethod) {
|
if (AN_METHOD_ECHECK == $order->paymentmethod) {
|
||||||
|
$refund = get_record('enrol_authorize_refunds', 'transid', $transid);
|
||||||
|
if ($refund) {
|
||||||
$refund->status = AN_STATUS_CREDIT;
|
$refund->status = AN_STATUS_CREDIT;
|
||||||
$refund->settletime = $settlementdate;
|
$refund->settletime = $settlementdate;
|
||||||
update_record('enrol_authorize_refunds', $refund);
|
update_record('enrol_authorize_refunds', $refund);
|
||||||
$updated++;
|
$updated++;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$ignored++;
|
||||||
|
$ignoredlines .= $reftransid . ": Not our business(Reference Transaction ID)\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$ignored++;
|
$ignored++;
|
||||||
$ignoredlines .= $reftransid . ": Not our business, in refunds\n";
|
$ignoredlines .= $reftransid . ": Not our business(Transaction ID)\n";
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user