Skip to content

Commit

Permalink
Bugfix: Fix merchant transaction id
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Nov 11, 2024
1 parent e5527b3 commit ba48f8a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions classes/external/get_config_for_js.php
Original file line number Diff line number Diff line change
@@ -166,20 +166,13 @@ function($item) {
$course = $item->itemid;
}

$substring = ' K' . $course . ' ' . $item->price;
$substring = ' K' . $course;
$merchanttransactionid .= $substring;

}
$pricestring = ' ' . $amount;
$merchanttransactionid .= $pricestring;
$longmtid = $merchanttransactionid;
// Payment provider accepts max string length of 40 characters.
if (strlen($merchanttransactionid) >= 39) {
$merchanttransactionid = $itemid . ' ' . $USER->id . ' ' . $amount . ' ' . $timestamp;
}
if (strlen($merchanttransactionid) >= 39) {
$merchanttransactionid = $string . $timestamp;
}
$merchanttransactionid = substr($string, 0, 40);
} else {
$merchanttransactionid = $string . $timestamp;
$longmtid = $merchanttransactionid;

0 comments on commit ba48f8a

Please sign in to comment.