Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Minneapolis MN, USA
    Posts
    136
    Plugin Contributions
    1

    Default Need Help Understanding javascript_validation

    Hello,

    Background: I have Virtual Check service thru Linkpoint -- it's a manual thing, you have to go to their POS site and input the check info to get it approved. So the OSC eCheck thing that was modified and put here back in Aug 06 (I think) works fine for this purpose.

    In fact, I've been using it without problem. It's just that some functionality is missing --> validating the input fields. [Using 1.3.6, no mods/contribs re pymt except Linkpoint, which comes with ZC.]

    I've been trying to update the eCheck contribution to validate the input fields via the "javascript_validation" section of the module. In doing this, I've been using the Linkpoint module and the standard cc.php as a guide.

    I can get it all coded in so that it is valid, but it doesn't trigger the JS Error window. Even stranger, once I upload that revised module the javascript_validation section in the Linkpoint module no longer works! (The php messageStack stuff still works tho.) As soon as I put back the echeck module without the validation section, the Linkpoint js validation works again.

    I can see by comparing the eCheck thing that the author used the cc.php file as a base, put in the echeck stuff and returned false on sections not being used for echeck. I've also compared it to the Linkpoint module and they are basically the same, for all intents and purposes. So A = B = C.

    So I must be missing something somewhere or I don't understand how it works. Probably both. "-)

    I understand the eCheck contribution is not a part of the ZC base, but I'd sure appreciate some help in understanding how to get the javascript_validation section working.

    Thanks!

    Becky

    [For anyone who sees this searching for 'echeck', once I get this working I'll make it available for other Linkpoint users who have that service (or anyone else who just wants to get the details in email for use with their own provider).]

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Need Help Understanding javascript_validation

    this part is pretty crucial, or else it'll not get triggered for the right module:
    Code:
     $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
    .

    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
    Jan 2005
    Location
    Minneapolis MN, USA
    Posts
    136
    Plugin Contributions
    1

    Default Re: Need Help Understanding javascript_validation

    Quote Originally Posted by DrByte View Post
    this part is pretty crucial, or else it'll not get triggered for the right module:
    Code:
     $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
    Hi DrByte,

    Thank you for looking at this. Yep, I do have that...
    Code:
        function javascript_validation() {
        $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
    Basically I took the javascript_validation section from cc.php and linkpoint_api.php as examples and changed the "contents" to match the fields I need validated.

    I look at the page source generated and the script is all there. One block for each payment method -- linkpoint_api (from memory) and echeck. The fields for the form are all named correctly and have values. The script seems to have generated properly, I'm not getting any JS errors thrown at me in the browser. It just doesn't work if they are both there. I don't feel 100% with JS and I can't figure out from reading the JS if there is some reason for this not liking two payment methods.

    Outside of that section of the file in modules/payment, is there any other section in that file that is critical? I do have the function get_error near the bottom, as in cc.php.

    It's not a large file -- it really only collects the info and emails it on. If you have the time and would be willing, I could send it to you or copy here any sections you'd want to see. Or you can get it from the downloads section (echeck) to see what other sections are being returned as false; all I did was add the validation section.

    Thanks again for looking,

    Becky

 

 

Similar Threads

  1. v139h Need help understanding Paypal IPN Address Override message
    By dinki in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 15 Feb 2012, 09:47 PM
  2. Newbie Need Help Understanding How To Get Started
    By eemiller in forum General Questions
    Replies: 7
    Last Post: 5 Mar 2010, 05:10 PM
  3. Need help understanding how to test PayPal Webite Payments Pro
    By alicia1234 in forum PayPal Website Payments Pro support
    Replies: 5
    Last Post: 4 Feb 2009, 12:04 AM
  4. Help! need help understanding override system
    By JenBaby in forum Templates, Stylesheets, Page Layout
    Replies: 17
    Last Post: 12 Dec 2006, 04:06 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