I just got off the #stripe IRC freenode live channel trying to finalize the Stripe integration.

Hey folks,

I just got off the #stripe IRC freenode live channel trying to finalize the Stripe integration.

I am trying to get it to notify the website, have the thank you/redirect page after payment is made, and set a potential error page if something goes wrong. I just did a live test payemnt and it did go through but just stayed on the register page with no notification nor account updates or thank you page etc.

Please let me know how to set that up (just like you do for Paypal and their IPN and other setting that can be made on their end . . . Stripe is not clear as far as how to completely setup to get it to work right).

Here is my IRC channel chat at #stripe I just had FYI:

I just got off the #stripe IRC freenode live channel trying to finalize the Stripe integration:

-----

Hi all: I have configured my live Stripe account per wpmudev to work on my Wordpress site. I just tested it and the payment test live did go through. However, how do I have Stripe send notification to update their account as active and drop them on a thankyou page? Also, how can I drop them on a page for further instructions if something goes wrong? Lastly, how can I make Stripe notify the website of any nonpayments to make their account expired till they do? I already have Paypal working perfectly with their setting and IPN (just need Stripe to work in a similar way). I am using this: https://premium.wpmudev.org/project/protected-content/ Thanks for any help. I am looking at your documentation now but have not found anything yet.

<koopajah>: so that would be on your integration/plugin. Stripe only creates the charge and sends an ok/not ok response. No that would be on your integration or the plugin you're using. I have never used wpmudev, only the developers of that plugin would be able to help you with that.

-----

I hope that helps for context.

***Please let me know how I can finalize the integration to make it do similar to what Paypal does to notify, let the customer know their payment went through or if there was a issue, redirect to a thank you page, and potential have a special error WP page if something goes wrong etc.

***Also, how can I confirm they have a active recurring subscription on Stripe's platform (like Paypal) and confirm that on our website site on their account (where we see their next charge coming up etc similar to Paypal) etc?

Update at 3:04 pm USA EST: I am trying to find the correct webhook url path to use now. So far, it has resulted in this error to the customer site: Fatal error: Call to a member function create() on null in /home/myqsl/public_html/wp-content/plugins/protected-content/app/gateway/stripe/class-ms-gateway-stripe.php on line 363

I am using this right now but not sure if it is correct for PC: http://mysite.com/wp-admin/admin-ajax.php?action=psts_stripe_webhook (whatever it is I think you should consider posting it like you do in the "configure" area for Paypal's IPN). Still trying to find the right one . . .

:slight_smile:

Best,

Greg

  • Greg

    Update 5:49 pm usa est: Let me correct something actually too. The users info and record is sent to Stripe BUT the about is not charged and therefor they show as a new customer but the amount is not paid under Stripes Dashboard:

    General>Customers>YES it shows the new customer from the website purchase.

    but

    Transactions>Payments>NO no payments associated with the customer show up at all.

    So, that is another piece of info for you on this.

    :slight_smile:

  • Michael Bissett

    Hey @Greg,

    This is quite a bit of information to consider, I think it would be best to back up here for a moment...

    I just did a live test payemnt and it did go through but just stayed on the register page with no notification nor account updates or thank you page etc.

    It's possible that there's a conflict taking place here, as I'm able to reach the thank you page on my test site (with the Twenty Fourteen theme active, and only Protected Content & our WPMU DEV Dashboard plugin enabled).

    Have you tried going through our basic troubleshooting flowchart here, and seeing if that changes things?

    https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    I tried logging in via Support Access, but I got an invalid access token error. If going through that flowchart doesn't dig anything up here, could you please revoke & re-grant the Support Access?

    Kind Regards,
    Michael

  • Greg

    @Michael Bissett

    Yea, I have gone through that flow chart a few times. Also, I use the Divi theme fyi.

    Since you mentioned that, you may be correct because I have not been getting all my automated emails from Protected Content either. But I have exhausted doing the plugin and theme troubleshooting. It began I think soon after the 2 or 3 most recent updates that were done on PC before as well.

    This is likely related if there is some conflict . . .

    It goes back to early this month:

    See (also still not resolved): https://premium.wpmudev.org/forums/topic/emails-to-users-and-notices-to-me-have-stopped-for-pc-and-other-wpmudev-plugins#post-844364

    Does eNewsletter share the same base code for sending emails or anything else (just a side question) with Protected Content?

    I have revoked and reenabled Support so you should be good to go.

    :slight_smile:

    Greg

  • Greg

    Update 9:06 pm usa est:

    I received this from @Tyler Postle on live support just now which is good news (so just need to find out the issue with it and Protected Content stopping sending out automated emails as well):

    Tyler Postleat 9:02 pm
    @Greg, I believe only the API credentials are needed for stripe payment. That is how I have it setup and it's working as expected :slight_smile:

    @Greg, I haven't had any myself and there isn't any current ones to my knowledge. It is one of the most used gateways too :slight_smile: next to PayPal of course.

    ALSO...regarding emails I ran the "check email" plugin again and the mandrill test email and received them all perfectly.

    When, however, I send a test email from Enewsletter is says it sent ok on the admin side, but I never get anything at all (this is the reason I was asking above how Enewsletter and Protected Content are related) too just as a sidenote.

  • Greg

    @Michael Bissett

    Just thinking, you identified a issue here that was a bit weird with Protected Content: https://premium.wpmudev.org/forums/topic/carousel-slider-not-showing-on-the-frontend-but-does-when-logged-in-we-confirmed-it-is-pc#post-834942

    I am just thinking with all the updates and especially the big one a while back it caused something to go haywire. I did deactivate every plugin one by one 1 day prior to the last successful email I received from Protected Content and ENewsletter and the WP system notifications to the present.

    And, I use the Divi theme which I do not think you are reporting any issue with either on that popular theme.

    Would it be something strange like that for both Protected Content Stripe and/or the reason for the Protected Content automated email issue as well . . . just a thought . . . ?

  • Greg

    I tried deactivating https://wordpress.org/plugins/bwp-minify/

    and https://wordpress.org/plugins/wordfence/description/

    for now. The payment received a green Stripe check mark but the amount did not go through even though customer info may have gone through.

    Getting this after paying even after that still getting:
    Fatal error: Call to a member function create() on null in /home/laseyqsl/public_html/wp-content/plugins/protected-content/app/gateway/stripe/class-ms-gateway-stripe.php on line 363

  • Greg

    Hey @Philipp Stracker

    Ok, I just updated it and tried again. It creates the customer at Stripe BUT it does not actually charge anything at Stripe or update the account on the website/give access. Also, the register page just refreshes and does not go to a successful registration page or anything like that. I just takes the card, shows a green check mark, and creates the Stripe new customer only.

    Here is the test link I am using. Stripe's min. transaction is 0.50 cents. I like to test in a live environment: http://bit.ly/1CP3rhE

    ***Are we sure no specific "webhook" notification url needs to be declared on the Stripe platform?

    Right now, I have no webhook setup because there is no additional instructions in the PC "configure"/"edit" link area for Stripe. All I have done is put in the attached info and marked it as live.

    What is the url webhook that should be declared as a callback to the site IF WE NEED IT? Some say yes and some say no so I am confused on that part. Or, is that something you do in the background with PC somehow? If there are additional steps needed to get this to work with PC, you may want to add that info in the "edit" link when setting up the Stripe info on that page (see attached image). Just a thought. The Paypal setup was dead simple, easy, and working pretty much immediately (hopefully Stripe with PC can be that way soon) . . . smile.

    Also, I have a confirmed Stripe account and they have all my details in case you might be wondering about that part.

    Please let me know how to fix or what your thoughts are?

    I have the support wpmudev dashboard enabled fyi.

    :slight_smile:

  • Philipp Stracker

    Hi Greg,

    thanks for the details and allowing us Support Staff Access :slight_smile:
    I have tested registration/payments on your site just now and would ask you to check your Stripe Account once again:
    - Log into your Stripe Dashboard and open the Account/API Keys page
    (Use this link: https://dashboard.stripe.com/account/apikeys)

    Then in the top make sure that you're using the latest stripe API version.
    If it's not latest then click the Update button.

    Tests I have done on your site
    1. I have changed Stripe to Sandbox mode and tested the registration. I could reproduce the issue you described on your site. However, my other test sites did not have that issue, so I assumed it must have something to do with the Stripe account and not with Protected Content.
    2. So I entered MY stripe API test-keys on your site (only changed test-keys) and tried again - this time everything was working and the payment was recognized and membership was activated!
    -> This confirms that the problem comes from somewhere in the Stripe Account...

    I have reverted the API keys to your original keys, but please double check them or generate new keys!

    The only thing that needs to be done in Stripe is generating API keys and keeping the API version up to date... So I guess the problem is an old API version in your Stripe account.

    Note: Payment confirmation
    Each payment button is inside an HTML form-tag that has some information on membership/gateway/etc. When the payment was successful, then the form is submitted and the page reloads.
    During page reload we do an API call to the payment gateway to confirm the payment was completed successfully, and if it was then the user is redirected to the thank you page; if not then the payment form is displayed again.
    No webhook is used for this - we wanted to keep the setup as simple as possible!

    In your case the problem is, that the payment confirmation from stripe is invalid or says "the user did not pay yet", so it will display the form again.

    ----

    Please test this and let us know if you could resolve the payment issues. If not then I can check your site again and add some debug/logging to the payment to find out what causes the error.

  • Greg

    @Philipp Stracker

    Ok. Here is my update and more info:

    updated the Stripe API per your instructions.

    Updated all my API keys

    Thought that was going to do it and was excited about it, but it does the same thing. In fact, it stays on the registration page and this time does not even send the customer info to Stripe. See the screenshot.

    I noticed you mentioned the Stripe update and looked at your changelogs and see that you mentioned a different date from the API update I just updated to via Stripe. Do you think that is it? See the screenshots of my Stripe version I just updated to and the date of the API update you posted in the most recent PC changelog (they are DIFFERENT DATES). Mine is 2015-03-24 and yours is 2015-02-18. My "roll back" version per the screenshot as you can see is 2015-02-18. Maybe that is what is what you mean by using the word from in your changelog description. If so, let me know. I would expect to see in the changelog the Stripe API version that I must be on regarding a particular update myself. So, let me know what you mean. It looks like Stripe actually update there API literally yesterday usa time. Maybe they updated the API even after you change PC's. So, perhaps you might need to update PC again for Stripe's even newer API??? I think PC needs to be updated according to Stripe's even newer API version.

    Also, if the date of the update is, indeed, our issue here then how can we be sure that when PC does updates in the future we can be notified or something that makes it obvious we need to adjust something to be sure Stripe always works seemlessly???

    Looked at code in firebug to get some other ideas though.

    Still testing stuff and looking myself too . . .

    Let me know what the next steps are Phillip!

    :slight_smile:

  • Greg

    @Philipp Stracker

    Nevermind . . . I think it may be working now . . . I am getting to the success page, payment made, and account updated.

    However, still working with it.

    IS THERE A MIN. amount that Stripe allow FROM a website though? I noticed I did a LIVE $97 plan purchase and it went through perfectly (see above). But, when I do a level live of a test at only 0.50 cents it just refreshes the page. Unless, there is some min. from sites or something I do not know what I would not work on the lower amount.

    It will auto bill recurringly if they pay through Stripe and it is a PC recurring plan right? However, the recurring plan does not show in Stripe's dashboard though (like it does in Paypal) right?

    So, at leasst some progress is being made on it now.

    -----

    Next, I need to find out why all the PC automated emails are not going out. I have already done the basic troubleshooting with plugins and themes. It has been going on for about 1 month now. Also, the "Check Email" WP plugin sends perfectly (and I received). And, the WPMandrill app test emails send perfectly too (and I receive). I mentioned both ENewsletter and Protected Content together because I remember you says something about them sharing the same or similar code, structure, or email sending methods in another thread you and I had a while back. However, I noticed that with ENewsletter's test email send, says it has sent from the admin area fine (but I do NOT receive). Also, I am not getting all Protected Content's automated email notices nor are customers. The only one I get usually is the invoice notice and even then I do not get that sometimes too. I do not see a test email I can send via PC in the admin area. Here is the full info on this and a bit of history: https://premium.wpmudev.org/forums/topic/emails-to-users-and-notices-to-me-have-stopped-for-pc-and-other-wpmudev-plugins#post-844364

    Please let me know your thoughts on the automated email stuff and a wrap up on the Stripe issue (I am still testing Stripe but it is looking better now).

    :slight_smile:

    Greg

  • Michael Bissett

    Hey @Greg! :slight_smile:

    It will auto bill recurringly if they pay through Stripe and it is a PC recurring plan right?

    Yes, that's right. :slight_smile:

    However, the recurring plan does not show in Stripe's dashboard though (like it does in Paypal) right?

    The member wouldn't have a Stripe dashboard for this, but he would be able to view the plan inside of the Account page provided by Protected Content. :slight_smile:

    As for the email issue you mentioned, I would advise taking that particular discussion back to that thread, as we've already got quite a bit going on in this thread here.

    Kind Regards,
    Michael

  • Greg

    @Michael Bissett

    Thanks. Ok.

    The member wouldn't have a Stripe dashboard for this, but he would be able to view the plan inside of the Account page provided by Protected Content. :slight_smile:

    Right, but in Paypal on our side we see recurring plans from our end though (that is what I meant as far as like Paypal being able to see the member plans from both ends). I guess with Stripe it will be just from one end for both us and the customer. Just to clarify.

    What about the min amount issue from websites with Stripe though? The $97 live worked in Stripe but the 0.50 cents level still does they same thing. There must be a min. from a website vs. direct. I saw direct transactions placed within the Stripe dashboard is 0.50 cent but not sure about from website (must be something like that as to why 0.50 cent level live will not go through and the $97 level live does)?

    Ok, I will pull it over to the other email thread.

  • Greg

    @Philipp Stracker

    Last item I think on this . . .

    I think this is working now, BUT one little thing that does not make sense unless you can help shed light on it:

    What about the min amount issue FROM websites with Stripe though? The $97 live worked in Stripe (was charged, account updated, hit the success page etc) BUT the 0.50 cents level still does they same thing (no charge, no account update, no success page, Stripe gets customer info only). I have not tried higher amounts like $1.00 etc but just wondering if you know if that may be the reason. Like I said, the test $97 one worked (those are the only two I tested in a live environment so far).

    Can you shed light as to why the 0.50 cent one will not work but the $97 does?

    There must be a min. from a website or something vs. direct. I saw the DIRECT PLATFORM min. transactions within the Stripe dashboard is 0.50 cents but not sure about from a website . . . perhaps it is different? It must be something like that as to why the 0.50 cents level live will not go through and the $97 level live does?

    :slight_smile:

  • Michael Bissett

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

    I did a bit of testing over on a site of mine with the Stripe gateway set to Sandbox, and here's what I found.

    With the membership set to 0.50 (or even just 0.5), only the 0 is picked up, the period (and anything after it) don't seem to be sent to Stripe, as this entry from the log indicates:

    Parsed Request POST Body
    
    {
       amount: "0"
       currency: "usd"
       customer: cus_5zKJ0RJGdQMKwZ
       description: "Invoice for Fifty Cent Membership - username"
    }

    And as Stripe has a minimum of 0.50 cents for a transaction, it doesn't like when it sees that 0 is the amount sent to it, and it gives this response:

    Response body
    
    {
       error:
       {
             type: "invalid_request_error"
             message: "Invalid positive integer"
             param: "amount"
       }
    }

    However, on changing the amount to $1, the POST body is like this:

    Parsed Request POST Body

    {
       amount: "100"
       currency: "usd"
       customer: cus_5zKJ0RJGdQMKwZ
       description: "Invoice for Fifty Cent Membership - username"
    }

    Which satisfies Stripe's minimum transaction requirements, and proceeds to process the transaction as it should. :slight_smile:

    Looks like we'll need to dig into the logic for that here, and see what can be done about .50 cent transactions.

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.