osCmax v2.5 User Manual
Results 1 to 2 of 2

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

      
  1. #1
    New Member
    Join Date
    Jun 2005
    Posts
    9
    Rep Power
    0


    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;

  2. #2
    New Member
    Join Date
    Jun 2005
    Posts
    9
    Rep Power
    0


    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.

Similar Threads

  1. worldpay module problem
    By hrhstephen in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 06-08-2006, 04:30 AM
  2. Need to know if there is an eci-pay payment module.
    By fridgemags in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 05-16-2004, 10:28 PM
  3. WorldPay Module Install
    By Anonymous in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 04-19-2004, 09:47 PM
  4. Worldpay Module NOT transfering me back to OS-Commerce!?!?
    By magicant in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 11-11-2003, 11:54 AM
  5. Payment module
    By tozo in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 09-21-2003, 06:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •