This is a discussion on Worldpay Price dependant payment module within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; I can successfully enable/disable worldpay module by price so i can now seperate cheap (50p) debit card transactions, and expensive ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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; |
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| Thank God! Solved it after much prayer and loads of frustrating nights… Looks like payment modules get called twice, before being sent off to card companies. Once at checkout_payment.php, and again at checkout_confirmation.php $order->info['total' ] is ok the first time, which is what I use for checking the order value, the second time it is null, so I simply make sure it is not null when disabling the payment module, works with worldpay and nochex…. Code: // BOM
// Dynamic disable mod 24/05/06 Disable for trades less than £11
if ( ($this->enabled == true) && ( $order->info['total' ] < 11) && ( $order->info['total' ] !=null) ) {
$this->enabled = false;
}
// EOM
|
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| worldpay module problem | hrhstephen | osCMax v2 Customization/Mods | 1 | 06-08-2006 05:30 AM |
| Need to know if there is an eci-pay payment module. | fridgemags | osCommerce 2.2 Modification Help | 0 | 05-16-2004 11:28 PM |
| WorldPay Module Install | Anonymous | osCMax v1.7 General Mods Discussion | 1 | 04-19-2004 10:47 PM |
| Worldpay Module NOT transfering me back to OS-Commerce!?!? | magicant | osCommerce 2.2 Modification Help | 0 | 11-11-2003 12:54 PM |
| Payment module | tozo | osCMax v1.7 Discussion | 0 | 09-21-2003 07:05 AM |