WordPress.org

Ready to get started?Download WordPress

Forums

WP Stripe
[resolved] Uses other than donations (27 posts)

  1. hmoore71@cox.net
    Member
    Posted 2 years ago #

    I have implemented the plugin on a HOA (Home Owners Association) website so their members can pay their dues using Stripe. To do this I've had to make several modifications to the plugin that I think are really essential to make it work for other than donations.
    1) Short code processing needed to work to place the form in side of the page content.
    2) Made name mandatory.
    3) added additional fields: address 1 & 2, city, state, zip (most are required).
    4)added admin option to set the default amount. Made the amount field readonly.
    5)added admin options for the new fields default values.
    6)added admin option for the success message.
    7)configure Stripe::charge to pass the new fields plus description(comments).
    8)added timer for to hide the success message after 10 seconds.
    9)added to the admin transaction header and display the address and email.

    I would like to see the process using ajax.

    I hope this is positive feedback for continued development of the plugin.

    http://wordpress.org/extend/plugins/wp-stripe/

  2. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    Thanks for the feedback, it's all valuable. I'll try to review this and some of the other items I'm working on, to make a release next week. Invariably, the focus will remain on non-profit uses (i.e. donations).

    Currently at wordcamp, but like said, will look at the beginning of the next week.

  3. PaulMorris
    Member
    Posted 2 years ago #

    First off, nice plugin!

    Here's my +1 for a way to add additional fields and make them required. hmoore71, can you provide any advice on how you went about adding them?

    I am hoping to use this plugin for an event held by a local non-profit. It happens once a year and has a registration fee. We need more information than just name and email, so currently thinking of asking people to just put all the additional info in the comment field, which will get the job done, but is not that pretty.

    Looked at some e-commerce plugins but they seem like overkill for this once a year use we have.

  4. hmoore71
    Member
    Posted 2 years ago #

    @PaulMorris
    I actually added the fields in the html generated from the PHP code.
    Take a look at Development News to see the latest version and updates.

    If you want the plugin as is let me know but I am not actively working on it.

  5. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    Hi Paul,

    Working on making that more simple by all means :) I've just had a slew of updates that revise a lot of the core functionality (i.e. AJAX, jQuery refactoring, increased validation, etc.).

    I agree that it definitely needs to be more modular and working on that now :)

    Cheers!

    Noel

  6. PaulMorris
    Member
    Posted 2 years ago #

    My thanks to you both. I think I've successfully modified the 1.4.0 wp-stripe plugin code to provide us with the extra fields/info we need. They will just be stored as additional meta data fields on the transactions custom post type, and displayed in the admin interface (like email, comment, etc.).

    Is there any reason not to set these custom posts as "private" rather than "published" since I'm not showing them on our site? That seems like it would be more secure (since they'll now have phone and address info attached).

    Thanks again!
    -Paul

  7. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    Feel free to make them private, though no one will see the data if you don't query it anywhere on the front-end. Will be more a question of how secure your WP site as a whole is.

  8. PaulMorris
    Member
    Posted 2 years ago #

    That makes sense. I think I'm just being over-cautious. Thanks again! -Paul

  9. PaulMorris
    Member
    Posted 2 years ago #

    Hi Noel,

    I've had some success modifying 1.4.1 to provide additional fields for our needs, but I ran into something odd. It works fine when I am logged into wordpress, but when I am not logged in it doesn't work. Clicking the submit button results in a "0" appearing at the top of the form where the error and success messages appear. (Additional zeroes appear there, one for each attempt.) The zero(s) are not in the usual colored boxes that the error messages usually have. It's really strange.

    Anyway, I know this is out of scope for support because of my modifications. That said, if you have any clues about what might cause it to work when logged in, but not work when logged out, I would greatly appreciate it!

    Thanks again,
    -Paul

    PS. The page is the same one I emailed you before, should you want to take a look.

  10. PaulMorris
    Member
    Posted 2 years ago #

    The plot thickens...

    I uninstalled my modified version and did a fresh install of the official WP Stripe 1.4.1. But I found that I still had the same problem when I was not logged into wordpress -- the "0" appearing at the top instead of a successful submit (it still worked fine when logged into WP).

    I think that I never actually tried it when I wasn't logged in before now. So as a test, I did a fresh install of official WP Stripe 1.4.1 on a different wordpress site I run. But I found the same problem there. The "0" appearing at the top instead of a successful submit.

    In my stripe account logs I'm seeing the correct "200 OK POST /v1/tokens" but not the following "200 OK POST /v1/charges".

    Possible causes?
    - I do not have my https/SSL certificate set up yet.
    - I haven't activated my stripe account yet.

    Still, it seems odd that it would work when I am logged into wordpress, but not when I am logged out.

    I have run into this in wordpress 3.4.0 and 3.4.1 (I upgraded to see if that would help).

    Cheers,
    -Paul

  11. PaulMorris
    Member
    Posted 2 years ago #

    I have set up my https/SSL certificate, and it's working. But WP Stripe is still not working when I'm not logged into wordpress.

    As described above: I get the strange "0" appearing instead of the successful submit message. On stripe.com I get Tokens messages but no Charges messages. This is with the standard, unmodified WP Stripe 1.4.1 and wordpress 3.4.1.

    See:
    https://syracusecountrydancers.org/stripe-test-page-2/
    https://syracusecountrydancers.org/stripe-test-page/

    Cheers,
    -Paul

  12. hmoore71
    Member
    Posted 2 years ago #

    I just tried the new WP-Stripe with Firefox and Firebug and get the message "url : ajaxurl not defined" when I enter the test transaction.

    I'm using the [wp-legacy-stripe] short code.

    I only see the variable being set in the iframe code and not for the shortcode as I'm using it.

  13. hmoore71
    Member
    Posted 2 years ago #

    Okay I copied the <script> ..</script> from stripe-iframe.php to stripe-display.php after this "<!-- Start WP-Stripe -->" and now it plays nice.

  14. PaulMorris
    Member
    Posted 2 years ago #

    Hi hmoore71,

    I've been getting around this by just assigning the needed URL string to that ajaxurl variable at the top of the wp-stripe.js file. "Hardcoding" it that way seems to work.

    I tried your approach, but it wasn't working for me. It looks like it comes up with an http:// URL for the ajaxurl, when it needs a https:// url, since my page is now using SSL/https... But that may not matter...?

    In any case this seems unrelated to the problem of the "0" appearing at the top of the form. See my post under "Not Working Most of the Time" thread.

  15. hmoore71
    Member
    Posted 2 years ago #

    Paul I was testing using localhost. My hosted site has SSL so I'll try it there tomorrow sometime and see if I can see whats going on.

    Eventually I want to revert a customer site back to WP-Stripe when these issues are taken care of.

  16. hmoore71
    Member
    Posted 2 years ago #

    Okay In stripe-functions.php

    after ----
    add_action('wp_ajax_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

    add ------
    add_action('wp_ajax_nopriv_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

  17. hmoore71
    Member
    Posted 2 years ago #

    BTW my fix for the ajaxurl worked fine for my hosted SSL site. That being said I selectively set SSL usage so the php ajax is reached by http and not https.

  18. PaulMorris
    Member
    Posted 2 years ago #

    Thanks, I tried that (adding the second line of code in stripe-functions.php) and it didn't fix things... See my post in "Not Working Most of the Time" for more details.

  19. PaulMorris
    Member
    Posted 2 years ago #

    Good to know about your fix for ajaxurl working with your SSL site. I will have to try setting it to use http instead of https for that and see if it will work for me.

  20. hmoore71
    Member
    Posted 2 years ago #

    Paul i think you missed one of my posts. You need both of these
    add_action('wp_ajax_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

    add_action('wp_ajax_nopriv_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

    in stripe-functions.php the first sets up the ajax for admin. the second for non admin (nopriv)

    I verified on both localhost and hosted SSL installs.

  21. PaulMorris
    Member
    Posted 2 years ago #

    Hi hmoore71, Yeah, I actually did get your post, and I have tried adding both those lines in stripe-functions.php, but it's still not working for me...

    Have you seen the "0" appearing at the top of the form? Or has it worked when logged in, but not when logged out for you?

  22. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    As per the other threads. This is fixed now in 1.4.2

  23. hmoore71
    Member
    Posted 2 years ago #

    Paul I did see the "0" response when not logged in but worked okay when logged in.
    Looks like Noel has fixed the issue.

  24. PaulMorris
    Member
    Posted 2 years ago #

    I decided to try a new start for a new day. I re-installed WP Stripe 1.4.1 from scratch, then edited stripe-functions.php to include both these lines (to fix the problem with it not working when not logged into wordpress).

    add_action('wp_ajax_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

    add_action('wp_ajax_nopriv_wp_stripe_charge_initiate', 'wp_stripe_charge_initiate');

    This time it worked when using the iframe modal pop-up! No "0", a success message, and the transaction came through on stripe and in the WP Stripe admin area.

    Next up was trying to get the inline "legacy" form to work. So I tried hmoore71's fix for this, and then my "hardcoded" ajaxurl variable. In both cases the transaction went through on the back end (hooray!), but also in both cases I am not getting a "success" message for the user. The form just "freezes" with the submit button "greyed out" after clicking it.

    But this is real progress!

    EDIT: Oops, looks like Noel released 1.4.2 to fix this, going to try it now. Should have refreshed the page before posting. -Paul

  25. hmoore71
    Member
    Posted 2 years ago #

    Try Noel's latest version. I just did and it worked fine on my localhost.

  26. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    Slight glitch in the matrix, but all good now :)

  27. PaulMorris
    Member
    Posted 2 years ago #

    Awesome! 1.4.2 is working perfectly with both the inline form and the iframe modal form. No tweaking required.

    Thanks Noel and hmoore71!

    Looks like I might make my weekend deadline afterall. :)

    -Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags