I can successfully enable/disable worldpay module by price so i can now seperate cheap (50p) debit card transactions, and expensive (4.5%) credit card transactions and use cheaper nochex as necessary.
worldpay.php, Disable if amount is less than £11:
$this->enabled = ((MODULE_PAYMENT_WORLDPAY_DC_STATUS == 'True')? true : false);
if ( $order->info['total' ] < 11) {
$this ->enabled = false;
}
If I set $this ->enabled = true; it works but the condition is not what I want it will not disable if less than £11.
What is more baffling is that I have another worldpay module called worldpay_cc.php
$this-> enabled = (( MODULE_PAYMENT_WORLDPAY_CC_STATUS == 'True') ? true : false);
if ( ( $order->info['total' ] < 300) && ( $order->info['total' ] > 11)) {
$this ->enabled = false;
}
This one works no problem, if I copy this if statement to the other worldpay.php that works as well.
The problem is that dependent on the if condition worldpay works or does not work, I get error in worldpay website:
Sorry, there was an error in processing this transaction:
The information sent from the merchant's site is invalid or incomplete. Please send the following information to the merchant:
The transaction cannot be processed due to one or more of the following:
the installation ID field is blank or contains invalid characters
a different submission protocol is required. For instance, a more secure submission may be required
the installation number is invalid
I have searched the forums but no-one seems to have tested this in v1.6/1.8 which has global $order;





LinkBack URL
About LinkBacks






Bookmarks