Pro Sites Gateway for Stripe not working

I'm testing out the gateway for Pro Sites and when I enter the credit card info the screen just flashes and doesn't do anything.

You can see the checkout page here: https://www.softwiredweb.net/checkout/

I've enabled the staff support access if you need to see the settings. Please advise. Thanks

  • Michael Bissett

    Hey @Tony, hope you're doing well this evening! :slight_smile:

    I'm seeing that there's test Public & Secret keys inserted into the Stripe settings, but that the mode for the site was set to Live Mode, I've switched that over here.

    However, in trying to test the checkout process, I noticed that I had to go through the checkout process twice in order to make a successful order.

    I also noticed that in the process of testing, when the page was reloaded, the protocol was HTTPS, what are you using to force that presently? I'm curious as to whether or not that might be part of what's causing this hiccup here.

    Please advise,
    Michael

  • Michael Bissett

    Hey @Tony,

    I'm uncertain what was setup at the moment because it seems things have changed. Maybe you found the Force SSL plugin?

    I don't recall seeing any sort of a SSL plugin enabled when I was last in your site, not seeing one there presently either.

    It looks like the SSL was removed from the checkout page. Can you please advise?

    When Test Mode is active for Stripe, SSL is disabled in the checkout process, that's probably why you're not seeing SSL active for there now when you try visiting the checkout page via your menu item. :slight_smile:

    (it'll still come up as HTTPS if you were to visit the page via the link you first mentioned in this thread, but SSL won't be forced)

    I just tried checking out several sites on your network, and found that each of them signed up just fine, I didn't run into the issues I did last time. :slight_smile:

    Can you confirm that signing up for a test site works on your end too? Stripe has some test card numbers over here:

    https://stripe.com/docs/testing

    If it does, then when it comes to trying out Live Mode inside of Stripe, you'll want to be sure to enter your Live Secret & Live Public keys into the settings for Stripe inside of Pro Sites.

    Let me know if this helps please! :slight_smile:

    Kind Regards,
    Michael

  • Tony

    Hi Michael,

    It appears the test mode was successful in the checkout process thank you! There are just a couple of small items to get things finished.

    1. I am unsure I want a trial period at this time. Should I just remove the free trial option in settings to get the card charged immediately?
    2. The pricing table is not showing 3 columns yet everything is set to default. Can you tell me what is wrong in the CSS?
    3. When I go through checkout and login there is a message that there are pending changes to my account. What does that mean?

    I think we're close! thanks!

  • Michael Bissett

    Hey @Tony, thanks for your patience here! :slight_smile:

    3. When I go through checkout and login there is a message that there are pending changes to my account. What does that mean?

    It means that Pro Sites is waiting for subscription information from Stripe, once it's received it, and has updated the records on your site accordingly, that message should disappear. :slight_smile:

    Hmmm... now I'm getting a weird text input in the CSS field for the pricing tables:

    <b>Warning</b>: sprintf(): Too few arguments in <b>/home/softwirednet/public_html/wp-content/plugins/pro-sites/pro-sites-files/lib/ProSites/View/Pricing/Styling.php</b> on line <b>357</b>

    Help!

    Did this show up after this change you made:

    Well I have manually fixed the CSS problem for now. I couldn't figure out why it was doing that but I believe it was a bug in the code.

    If so, what was the fix you applied? Did you modify the line of code mentioned in that error?

    And could you please send in the following via our secure contact form, so I can have a deeper look at things:

    - Mark to my attention, the subject line should contain only: ATTN: Michael Bissett
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress network admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    On the contact form (linked to below), please select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thanks a bunch! :slight_smile:

    Kind Regards,
    Michael

    P.S. To answer #1, yep, you can just disable the trial period to get the card charged right away. :slight_smile:

  • Michael Bissett

    Hey @Tony,

    The CSS message seemed to be related to the CSS code I tried to insert. I'm still a little unsure what the issue was.

    It's definitely a curious issue, which I haven't been able to reproduce over on my end yet. I'd be interested in knowing if a certain part of your CSS code caused a hiccup here, though I'd have to know which code was used in the first place.

    It doesn't seem like just inserting a lot of CSS code by itself does it at the moment.

    For the message that there are pending charges this occurred because of testing. Since I'm not going to every make a payment how do I make it disappear for my login?

    What's the subsite in question here? If you've got the ID, you could insert the following into your site as a mu-plugin:

    add_action ('plugins_loaded', 'reset_selected_pro_site_function');
    
    function reset_selected_pro_site_function() {
    
    	global $wpdb, $psts, $current_site;
    
    	if ( 1 == get_blog_option( 'enter-id-of-subsite-here', 'psts_stripe_waiting' ) ) {
    		update_blog_option( 'enter-id-of-subsite-here', 'psts_stripe_waiting', 0 );
    	}
    }

    (replacing "enter-id-of-subsite-here" with the ID of the subsite in question)

    That function would allow you to reset the waiting status, so you won't see that message come up anymore. You'll just need to visit a page inside the Dashboard in order for that function to execute, once you do that, it should be reset.

    You'll want to remove the script afterwards, so that it's not executing every time you go into the Dashboard.

    Kind Regards,
    Michael

      • Michael Bissett

        Hey @Tony,

        Due to the nature of the code, here's what you'll want to do:

        Inside your Network Dashboard, you'll want to go to:

        Sites -> All Sites

        And click on the "Edit" link for the subsite in question. On the page you go to, take note of the ID mentioned in the URL in the address bar of your browser:

        /wp-admin/network/site-info.php?id=1

        (replacing the 1 there with the ID for your subsite)

        Once you've got that ID noted down, go to your /wp-content/ folder via FTP, and find the folder called "mu-plugins". If there is no folder with that name, then you'll want to create one.

        Then, create a file inside that folder, and give the file any name you like and paste the code in there, making sure that there's an opening PHP tag at the beginning of the file, like this:

        <?php

        The code I mentioned will need to be adjusted, you'll want to replace the mention of "enter-id-of-subsite-here" with the ID of the subsite in question.

        After (and only after) you've done this, navigate to one page inside of your Network Dashboard. We don't need to change any settings, we just need to navigate to a page, so that our newly inserted code will run.

        Once that's done, remove the code, and go check the Pro Site status of your subsite, it should be removed now.

        Let me know if this helps please! :slight_smile:

        Kind Regards,
        Michael

  • Michael Bissett

    Hey @Tony, my apologies for the delay here!

    The only thing I'm particularly concerned with is getting live payments to work. I was able to successfully process a test mode but still haven't be able to complete a live payment.

    Could you elaborate on what happened when you tried doing a live payment? Also, was the subsite you were trying to do a live checkout for a subsite you had previously used to test with (back when Test Mode was enabled)?

    I ask that latter question due to this statement on the Stripe gateway setup page:

    When switching from test to live API credentials, if you were testing on a site that will be used in live mode, you need to manually clear the associated row from the *_pro_sites_stripe_customers table for the given blogid to prevent errors on checkout or management of the site.

    What if you tried checking out with a different subsite, does the checkout work then?

    Please advise,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.