osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Worldpay Price dependant payment module

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 06-05-2006, 09:13 AM
New Member
 
Join Date: Jun 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hrhstephen
Default Worldpay Price dependant payment module

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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 06-08-2006, 05:27 AM
New Member
 
Join Date: Jun 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hrhstephen
Default

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
Can anyone tell me if my mod will cause problems elsewhere? As I am not brilliant at php, and only worked this out by echoing variables during the checkout process.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 01:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax