PayPal Standard Button Filter

Issue #17 closed
Drew Angell repo owner created an issue

I'm not sure how feasible this is, but I'd like to give it a shot.

I'd like to add a filter that searches through pages when they're loaded in WP and tries to find PayPal standard button code. For example, it could look for the following HTML on the page...

<input type="hidden" name="business" value="me@mybusiness.com">

and if it finds it, add the bn parameter...

<input type="hidden" name="bn" value="AngellEYE_PHPClass" />

Not sure if this is something that could be done with jQuery, maybe..??

Comments (14)

  1. jignesh kaila

    I have added PayPal Standard Button Filter and push to development branch, please review it and let me know if any.

  2. Drew Angell reporter

    It looks like exactly what I was wanting, but I'm curious why it was placed in the admin classes..??

    The idea was to have this code checking for standard buttons on pages as people browse the site, and always inject/replace if it finds one. Is that what this is doing?

    Also, do you think this will cause a big delay in page load times for people? Do you have tools to test that sort of thing?

  3. jignesh kaila

    Actually in our base plugin there is no any fronted interface so we are not create public folder in our plugin. So I have put Javascript code to admin class. I think it will not effect the admin side any functionality because it will call when wp_footer hook will call. If you want to put this code in public folder in our plugin will able to do it please let me know.

    Yes I have tested this code in my end to add pay pal standard button in our site. it is working perfectly.

    Regarding load, it is small block of jQuery code will not affect load time of the page.

    Please let me know if any.

  4. Drew Angell reporter

    Ok, sounds good, thanks for the details. I'm going to play with this one a little bit more and then I'll close it out unless I have any other questions.

  5. Drew Angell reporter

    I just put together a simple test here and I'm not getting what I expect for this.

    I created the following post on my site: http://woo.angelleye.com/test-paypal-standard-filter/

    All it has on it is a basic PayPal cart button, which contains the following form...

    <form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart"><br />
    <input type="hidden" name="business" value="sandbo_1215254764_biz@angelleye.com"><br />
    <input type="hidden" name="item_name" value="Test Widget"><br />
    <input type="hidden" name="amount" value="10.00"><br />
    <input type="hidden" name="currency_code" value="USD"><br />
    <input type="hidden" name="add" value="1"><br />
    <input type="hidden" name="button_subtype" value="products"><br />
    <input type="hidden" name="no_note" value="0"><br />
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><br />
    <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
    </form>
    

    I have the IPN plugin enabled as well, of course, so when I browse to that page I'm expecting to be able to view source and see the bn parameter added to the form. This is not happening, and I also don't see the jQuery getting added to the footer of the page (which would explain why the injection of the bn parameter isn't happening.)

  6. Drew Angell reporter

    I think maybe I didn't have this merged like I thought I did when I tested. Hold off on this for now. I'll test again and let you know if I'm still having problems.

  7. Log in to comment