Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Clone a Payment Module?

    We currently have one domain for US transactions and a seperate domain & zen cart install for CA transactions. The reason it was done this way is because we use Moneris to accept credit cards on our store but different merchant numbers, bank accounts, etc. for the two currencies. What I would like to do is combine the two into one domain and zen cart install. The only way I can see us doing that is to somehow clone the moneris module and then set up a US Zone for moneris module 1 and then set up a CA Zone for moneris module 2.

    Is this possible? Am I on the right track? Or am I over thinking it?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Clone a Payment Module?

    Or you could enhance the moneris module to detect the currency the customer is shopping in and submit the transaction to the correct merchant account based on that currency choice, thus meaning you've only got one module needed.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Clone a Payment Module?

    Quote Originally Posted by DrByte View Post
    Or you could enhance the moneris module to detect the currency the customer is shopping in and submit the transaction to the correct merchant account based on that currency choice, thus meaning you've only got one module needed.
    Wow that sounds like it would be much more functional on the backend....however, that might be above my head php-wise. So I would need to enter in a code that would look at the currency selected by the customer and then pull up the correct merchant account. Can I bother you for an idea on WHERE I need to do that?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Clone a Payment Module?

    Got a link where I can download the module you're using?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Clone a Payment Module?

    I no longer see it listed under the payment plugins...I only see an updated one for 1.5 but I am still on version 1.39h. We have made small modifications but this is the original mod:

    moneris_payment_module_1-24.zip

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Clone a Payment Module?

    Around line 180 you've got this bit of code:
    Code:
            $process_button_string = zen_draw_hidden_field('ps_store_id', MODULE_PAYMENT_MONERISESELECTPLUS_PS_STORE_ID) . 
                                     zen_draw_hidden_field('hpp_key', MODULE_PAYMENT_MONERISESELECTPLUS_HPP_KEY) . 
                                     zen_draw_hidden_field('charge_total', number_format($order->info['total'], 2, '.', '')) . 
                                     zen_draw_hidden_field('cc_num', $this->cc_card_number) .
    Change that to read like this:
    Code:
    
        if ($order->info['currency'] == 'USD') { 
          $process_button_string = zen_draw_hidden_field('ps_store_id', MODULE_PAYMENT_MONERISESELECTPLUS_PS_STORE_ID) . 
                                   zen_draw_hidden_field('hpp_key', MODULE_PAYMENT_MONERISESELECTPLUS_HPP_KEY);
        } else {
          $process_button_string = zen_draw_hidden_field('ps_store_id', 'INSERT YOUR CA STOREID CODE HERE') . 
                                   zen_draw_hidden_field('hpp_key', 'INSERT YOUR CA HPP KEY HERE');
        }
        $process_button_string .= 
                        zen_draw_hidden_field('charge_total', number_format($order->info['total'], 2, '.', '')) . 
                        zen_draw_hidden_field('cc_num', $this->cc_card_number) .
    And in your ZC admin, enter your US account settings in the module's configuration details, and put your CA settings into the PHP file where shown above.

    Then when your customers choose USD for checkout, they'll use your US settings, and if they choose any other currency they'll use your CA settings.
    (So, hopefully you've only got USD and CAD enabled in your store, under Admin->Localization->Currencies)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Clone a Payment Module?

    This might work nicely.....however, could I change

    Quote Originally Posted by DrByte View Post
    if ($order->info['currency'] == 'USD')
    to read anything, such as if ($order->info['billing_country'] == 'United States')? ......this would accommodate the fact that we can be sure the right currency is billed even if they don't think to change the currency option.

  8. #8
    Join Date
    Apr 2010
    Posts
    39
    Plugin Contributions
    0

    Default Re: Clone a Payment Module?

    Upon testing your original code (without the modification that I suggested), I was unable to process a charge onto the credit card in any currency.

    Do I need to also address other locations in the mod that look for MODULE_PAYMENT_MONERISESELECTPLUS_HPP_KEY and MODULE_PAYMENT_MONERISESELECTPLUS_PS_STORE_ID?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Clone a Payment Module?

    Quote Originally Posted by swilliams88 View Post
    This might work nicely.....however, could I change
    ...
    to read anything, such as if ($order->info['billing_country'] == 'United States')? ......this would accommodate the fact that we can be sure the right currency is billed even if they don't think to change the currency option.
    It's more complicated than that, because if you just blindly charge in USD if the address is in Canada, and don't also calculate exchange rate on it, then you'll not be charging the correct amount, and therefore have unhappy customers.
    You'd need to do similarly even if you cloned the module to only work with CAD and a different specific zone.
    Much safer to ensure that the customer selects the right currency, and you submit that to your correct account based on currency.

    Also keep in mind that if I have 2 credit cards, one in each country, maybe I intentionally want to charge my purchase to a certain card in its own currency regardless of my address.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Flat Clone shipping module
    By Ms_X in forum Addon Shipping Modules
    Replies: 0
    Last Post: 24 Oct 2010, 03:57 PM
  2. Clone the COD module
    By thesinner in forum Addon Payment Modules
    Replies: 0
    Last Post: 27 Aug 2010, 12:20 PM
  3. Clone zone rates module
    By thesinner in forum Addon Shipping Modules
    Replies: 1
    Last Post: 31 Jul 2010, 05:32 PM
  4. Unable to clone Table Module
    By gtowle in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 5 Jul 2008, 07:23 PM
  5. Clone a shipping module or define a new shipping attribute under table rate module?
    By meeven in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 4 Sep 2007, 04:56 PM

Posting Permissions

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