Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    32
    Plugin Contributions
    0

    Default IP specific payment option

    Thanks for taking the time to read this. What we are trying to do: We need a payment option that is only available to a specific IP address, that being our shop where we can take payments in house and sign in as the customer to place the order and have the stock removed from Zen Cart inventory. We do not want the payment option available for regular customers to use, only our specific IP address.

    What would be the best way to go about this and is it even possible?

    We have tried several other options including POS systems and such and each has its own failing, such as incompatibility with attribute stock etc... so this seems like the best way.

    Any suggestions would be greatly appreciated
    Thanks again and I look forward to your comments

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

    Default Re: IP specific payment option

    Sure. Put the code for checking the IP address into the update_status() method of your payment module, and then it'll only show up when that IP address is used.

    However, I would assert that if I were your customer and shopping online, I'd want to settle payment immediately and securely, not wait to tell you credit card info over the phone while you log in to my account as me.
    .

    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 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: IP specific payment option

    Quote Originally Posted by DrByte View Post
    Sure. Put the code for checking the IP address into the update_status() method of your payment module, and then it'll only show up when that IP address is used.
    Thank you for the help DrByte. Would you happen to know off hand what the best code would be?
    Maybe something like this? again we only want a single IP address to be able to view this option.
    HTML Code:
    $ip = $_SERVER["REMOTE_ADDR"];
    if ($ip == ###.###.###.###)
    echo "function update_status() {
    etc...
    Quote Originally Posted by DrByte View Post
    However, I would assert that if I were your customer and shopping online, I'd want to settle payment immediately and securely, not wait to tell you credit card info over the phone while you log in to my account as me.
    Agreed. Which is why we would would only be using this for our in house (walk-in) purchases which is why we would like the payment option limited to our own IP address. If that makes sense.

    Thank you again DrByte, you are a great help to all of us Zenfolk

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

    Default Re: IP specific payment option

    In your payment module, you have an update_status() method, which starts with:
    Code:
      function update_status() {
        global $order, $db;
    Add these new lines, as shown, and adjust the 333.444.555.666 to the IP address you wish to restrict it to:
    Code:
      function update_status() {
        global $order, $db;
        // restrict module to only activate on our retail store IP address:
        if (IS_ADMIN_FLAG === FALSE and $this->enabled == TRUE and $_SERVER['REMOTE_ADDR'] != '333.444.555.666') {
          $this->enabled = FALSE;
        }
    
    .

    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 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: IP specific payment option

    Oh you are a life (and time) saver! That is huge! thank you so much for your help. Looks like it is working great.

    Really, can't say thanks enough

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

    Default Re: IP specific payment option

    You're welcome.

    And we always love it when people say thanks via this page: http://www.zen-cart.com/index.php?ma...es&pages_id=14
    .

    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 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: IP specific payment option

    Will do!

 

 

Similar Threads

  1. Payment option based on new option
    By timhersh in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 22 Dec 2011, 11:37 PM
  2. Replies: 6
    Last Post: 15 Nov 2011, 06:57 PM
  3. Product Specific option name notes
    By wheelchairguy in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 30 Nov 2009, 09:28 PM
  4. Paypal IPN payment option - limiting it to one specific country
    By nigelt74 in forum Addon Payment Modules
    Replies: 2
    Last Post: 22 Jun 2007, 01:43 AM
  5. How prevent auto-selection of payment option when only 1 payment option available
    By DogTags in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 3 Jun 2006, 01:24 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