Hi all
Now, maybe the double colon "Scope Resolution Operator" is a red herring here so forgive my thread title.
I have a block of code like this:
switch (MODULE_PAYMENT_PAYMOD_TRANSACTION_TYPE) {
case "Immediate Charge":
$transaction_type = PayModTransactionType::SALE;
break;
case "Pre-authorised":
$transaction_type = PayModTransactionType::PREAUTH;
break;
case "Stored":
$transaction_type = PayModTransactionType::STORE;
break;
}
When I run the page that includes this code, I get the following message:
Parse error: syntax error, unexpected ';', expecting '(' in /mydocumentroot/includes/modules/payment/paymodsave.php on line 1244
Line 1244 is the first line with the double-colon.
I've looked inside the PayModTransactionType class definition and found this:
final class PayModTransactionType
{
const UNKNOWN = 'UNKNOWN';
const SALE = 'SALE';
const REFUND = 'REFUND';
const PREAUTH = 'PREAUTH';
const VOID = 'VOID';
const COLLECTION = 'COLLECTION';
const RETRY = 'RETRY';
const STORE = 'STORE';
const KEEP_ALIVE = 'KEEP_ALIVE';
...
...
...
}
Can anyone assist with debugging this? To me, everything looks just fine. Is it something to do with the version or configuration of PHP on my server?