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

Worldpay currency problem (CAD & USD)

This is a discussion on Worldpay currency problem (CAD & USD) within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; My worldpay module is installed and running. but... there is a big problem. The amount being transferred is incorrect when ...

      
  1. #1
    New Member
    Join Date
    Feb 2009
    Location
    Toronto, Canada
    Posts
    12
    Rep Power
    0


    Unhappy Worldpay currency problem (CAD & USD)

    My worldpay module is installed and running. but... there is a big problem.
    The amount being transferred is incorrect when the currency is changed.


    My website has two currencies - USD $ and CAD $.

    Default is USD. When the customer purchases using USD as the currency(example: USD $240 worth products) , oscmax passes correct amount to the worldpay in USD (i.e. USD $@240)

    Now I purchase the same products using CAD as currency.
    oscmax shows correct CAD (310$) but passes to worldpay CAD $240.

    This is the same amount that is in USD $ for the same product.

    Please help, I have spent hours and hours in forums searching for an answer.

  2. #2
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Worldpay currency problem (CAD & USD)

    Cause it does not pass currency type - Try find code:
    PHP Code:
     tep_draw_hidden_field('hideCurrency''true') . 
    Change to:
    PHP Code:
     tep_draw_hidden_field('hideCurrency''false') . 
    See if that works...
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  3. #3
    New Member
    Join Date
    Feb 2009
    Location
    Toronto, Canada
    Posts
    12
    Rep Power
    0


    Default Re: Worldpay currency problem (CAD & USD)

    I couldn't find that piece of code anywhere in the application.

    Could you please help me out here...

  4. #4
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Worldpay currency problem (CAD & USD)

    Then which Worldpay module are you using then?

    There is no default one in osCommerce -and the one I used is the one in osCMax....
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  5. #5
    New Member
    Join Date
    Feb 2009
    Location
    Toronto, Canada
    Posts
    12
    Rep Power
    0


    Default Re: Worldpay currency problem (CAD & USD)

    I don't know. I just clicked install in the Payment modules of the admin section. Here is the code I have in my Worldpay.php

    <?php
    /*
    $Id: worldpay.php,v4.1 Beta 2003/01/12 22:00:00
    Author : Graeme Simms (gsimms@icon.co.za)/Graeme Conkie (graeme@conkie.net)
    Title: WorldPay Payment Module V4.0 Beta

    osCommerce, Open Source E-Commerce Solutions
    osCommerce, Open Source Online Shop E-Commerce Solutions

    Copyright (c) 2002 osCommerce

    Released under the GNU General Public License

    */

    class worldpay {
    var $code, $title, $description, $enabled;

    // class constructor
    function worldpay() {
    $this->code = 'worldpay';
    $this->title = MODULE_PAYMENT_WORLDPAY_TEXT_TITLE;
    $this->description = MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION;
    $this->enabled = ((MODULE_PAYMENT_WORLDPAY_STATUS == 'True') ? true : false);
    $this->form_action_url = 'https://select.worldpay.com/wcc/purchase';
    }

    // class methods
    function javascript_validation() {
    return false;
    }

    function selection() {
    return array('id' => $this->code,
    'module' => $this->title);
    }

    function pre_confirmation_check() {
    return false;
    }

    function confirmation() {
    return false;
    }

    function process_button() {
    global $HTTP_POST_VARS, $shipping_cost, $total_cost, $shipping_selected, $shipping_method, $currencies, $currency, $customer_id , $order;
    $worldpay_url = tep_session_name() . '=' . tep_session_id() ;
    $process_button_string =
    tep_draw_hidden_field('instId', MODULE_PAYMENT_WORLDPAY_ID) .
    tep_draw_hidden_field('currency', $currency) .
    tep_draw_hidden_field('desc', 'Purchase from '.STORE_NAME) .
    tep_draw_hidden_field('cartId', STORE_NAME.' : '.$order->customer['firstname'].' '.$order->customer['lastname']) .
    tep_draw_hidden_field('amount', number_format($order->info['total'],2,'.',''));
    if (MODULE_PAYMENT_WORLDPAY_USEPREAUTH == 'True') $process_button_string .= tep_draw_hidden_field('authMode', MODULE_PAYMENT_WORLDPAY_PREAUTH);
    if (MODULE_PAYMENT_WORLDPAY_USEPREAUTH == 'True') $process_button_string .= tep_draw_hidden_field(MODULE_PAYMENT_WORLDPAY_PREA UTHACCID, MODULE_PAYMENT_WORLDPAY_PREAUTHID);
    $address = htmlspecialchars($order->customer['street_address'] . '
    ' . $order->customer['suburb'] . '
    ' . $order->customer['city'] . '
    ' . $order->customer['state'], ENT_QUOTES);
    $process_button_string .=
    tep_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_MODE) .
    tep_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
    tep_draw_hidden_field('address', $address) .
    tep_draw_hidden_field('postcode', $order->customer['postcode']) .
    tep_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
    tep_draw_hidden_field('tel', $order->customer['telephone']) .
    tep_draw_hidden_field('fax', $order->customer['fax']) .
    tep_draw_hidden_field('email', $order->customer['email_address']) ;
    return $process_button_string ;
    }

    function before_process() {
    global $HTTP_POST_VARS;
    }

    function after_process() {
    return false;
    }

    function output_error() {
    return false;
    }

    function check() {
    if (!isset($this->_check)) {
    $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_WORLDPAY_STATUS'");
    $this->_check = tep_db_num_rows($check_query);
    }
    return $this->_check;
    }

    function install() {
    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable WorldPay Module', 'MODULE_PAYMENT_WORLDPAY_STATUS', 'True', 'Do you want to accept WorldPay payments?', '6', '1', 'tep_cfg_select_option(array('True', 'False'), ', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Worldpay Installation ID', 'MODULE_PAYMENT_WORLDPAY_ID', '00000', 'Your WorldPay Select Junior ID', '6', '2', now())");

    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Mode', 'MODULE_PAYMENT_WORLDPAY_MODE', '100', 'The mode you are working in (100 = Test Mode Accept, 101 = Test Mode Decline, 0 = Live', '6', '3', now())");

    }

    function remove() {
    tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
    return array('MODULE_PAYMENT_WORLDPAY_STATUS', 'MODULE_PAYMENT_WORLDPAY_ID','MODULE_PAYMENT_WORLD PAY_MODE');
    }
    }
    ?>

  6. #6
    New Member
    Join Date
    Feb 2009
    Location
    Toronto, Canada
    Posts
    12
    Rep Power
    0


    Default Re: Worldpay currency problem (CAD & USD)

    Is this post related to my problem?

    Currency Problems

  7. #7
    New Member
    Join Date
    Feb 2009
    Location
    Toronto, Canada
    Posts
    12
    Rep Power
    0


    Smile Re: Worldpay currency problem (CAD & USD)

    Problem solved.
    Install the new Worldpay Junior module....

Similar Threads

  1. Worldpay 4.0 - V1.0
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 09-09-2008, 06:00 AM
  2. worldpay module problem
    By hrhstephen in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 06-08-2006, 04:30 AM
  3. New currency "problem"
    By damnedpig in forum osCmax v1.7 Discussion
    Replies: 3
    Last Post: 08-24-2005, 07:04 AM
  4. Small Currency Problem
    By energeeuk in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 09-02-2004, 04:57 AM
  5. Worldpay Help
    By Waza04 in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 02-25-2003, 10:20 AM

Tags for this Thread

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
  •