Membership Stripe payment
-
Hi Franky
My problem concerns the registration of the online payment of a membership by stripe.
The payment is done and I have the receipt from Stripe. But EME doesn’t seem to remember the gateway or the ID anymore, and the member is noted as pending, not active. It used to work fine. It still works fine for payment of an event booking.
Do you have any idea?Frédéric
-
I use other payment methods, which work ok for memberships, so: the error is not in the generic payment method handling for members. Since you also say it works fine for events/bookings, the error is not in the stripe payment handling code.
So: I’m guessing the user closed his/her tab immediately after stripe payment *and* the stripe notification did not come through on the website. Can you check your webserver logfiles for lines containing “eme_eventAction=stripe_notification” in the url?Also: can you reproduce the problem? Did you try with a stripe test account?
1/ I checked my logfile and there are this two lines :
xx.xxx.216.72 vogue-et-reve.fr – [05/Jul/2022:10:44:14 +0200] “POST /events/?eme_eventAction=stripe_notification HTTP/1.1” 500 285 “-” “Stripe/1.0 (+https://stripe.com/docs/webhooks)”
and
xx.xxx.174.169 vogue-et-reve.fr – [05/Jul/2022:10:44:33 +0200] “POST /events/?eme_eventAction=stripe_notification HTTP/1.1” 200 – “-” “Stripe/1.0 (+https://stripe.com/docs/webhooks)”
It’s about the same time of transaction but not from the IP of the person who pay the membership. What is the meaning of this two lines?
2/ I will try to reproduce the problem…Those lines come from stripe doing a callback to you (to inform you of a payment status).
But one of the calls gets a 500 reply back from your server, meaning some error occurred there. While I try to trap stripe errors, this code 500 typically means something happened on the server (code-wise error or something unexpected), most of the time your php logfile will then tell you what happened.
The other line is 200, which means there all was ok (in your booking/member overview you can see the payment date, normally that should be about the same time. Also your stripe portal might give you info on the failed call (unsure though).I only had two payments that day including the one I was talking about and another where the person once on the stripe gateway did not go through with it. Is it possible that the 500 error is due to the person not completing one payment? However, the other payment is marked “successful” on Stripe but was not saved by EME. It is possible that the person closed their browser too quickly. I’m trying to clarify on my local installation but I’m having some trouble at the moment.
Wouldn’t the line below be the identification of the payment?
xxxx:xxx:xxx:e7e0:c78:eb8c:316d:xxxx vogue-et-reve.fr – [05/Jul/2022:10:44:37 +0200] “GET / HTTP/1.1” 200 23728 “https://vogue-et-reve.fr/events/?eme_pmt_result=stripe&eme_pmt_rndid=fecde8ce954aaa14276360a6da7a13ab7784a11742bfee” “Mozilla/5.0The IP address at the beginning of the line is that of the customer who has paid his membership at this time and whose references EME has not noted
When a person pays in stripe, stripe calls back to your server (from their infra, so not the ip of the client), while the client gets redirected to your server. So I check the callback (notification) for info *and* also check the client upon being redirected to EME. Since I can’t trust the latter for happening (like if someone closes the browser before redirection happens), the notification from stripe is equally important.
But a status code 500 normally means a php code issue, but since you’re saying other payments are managed just fine, it is something weird …I’ll try to test on my end too to make sure notifications are handled 100% correctly.
I just tested a member-add + stripe payment : notification from stripe came through and was handled as expected (I even made sure the return-url for the user itself was not doing anything and printed all possible debug info in the notification callback to a logfile). The payment was marked as paid as the notification dictated, so all seems ok for me.
Thank you for all your explanations. I need to look again and especially to reproduce the problem. As it only happened once and on a particular membership I will see if it happens again or if I can reproduce it. Thank you again.
ok, for now I’ll close this. If you can reproduce it, feel free to reopen this or open a new thread.
When I try the same membership on my local installation I get the following errors:
fatal error: Uncaught TypeError: Return value of ExpressiveDate::createFromFormat() must be an instance of ExpressiveDate, bool returned in /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/ExpressiveDate.php on line 143
( ! ) TypeError: Return value of ExpressiveDate::createFromFormat() must be an instance of ExpressiveDate, bool returned in /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/ExpressiveDate.php on line 143But I don’t know if this is related?
These are error which are logged on my local installation with the same result in the production site (ie payment is not memorised).
#0 /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/eme_members.php(3179): ExpressiveDate::createFromFormat(‘Y-m-d’, ”, Object(DateTimeZone))
#1 /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/eme_members.php(3227): eme_member_calc_status(‘2022-07-07’, ”, ‘forever’, ‘0’)
#2 /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/eme_members.php(5523): eme_member_set_paid(Array, ‘stripe’, ‘pi_3LJ1gFGkwu2T…’)
#3 /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/eme_payments.php(2965): eme_accept_member_payment(‘135’, ‘stripe’, ‘pi_3LJ1gFGkwu2T…’)
#4 /Users/fredericmoriniere/Local Sites/voguer/app/p in /Users/fredericmoriniere/Local Sites/voguer/app/public/wp-content/plugins/events-made-easy/ExpressiveDate.php on line 143ok, it seems in case “forever” membership and status calculation, things can go wrong. But that also means that it never could’ve worked in your memberships in the first place …
This changeset should fix it:
https://plugins.trac.wordpress.org/changeset/2753441/In fact, easier is to take the comple eme_members.php : https://plugins.trac.wordpress.org/browser/events-made-easy/trunk/eme_members.php?rev=2753441&format=txt and replace the function eme_member_calc_status in your existing file with the one from the file downloaded. You could replace the whole eme_members.php file, but other changes are present too and so I don’t recommend it.
Update: small extra code fix added, best is to take eme_member_calc_status function from
https://plugins.trac.wordpress.org/browser/events-made-easy/trunk/eme_members.php?rev=2753443&format=txt(the extra changeset on itself is this: https://plugins.trac.wordpress.org/changeset/2753443/ )
-
This reply was modified 3 years, 4 months ago by
Franky.
Yes, it’s a membership that doesn’t get many new members and wasn’t “forever” at the beginning. I am going to test this changes.
I’m releasing the new version now (also including the latest php api code from stripe).
-
This reply was modified 3 years, 4 months ago by
The topic ‘Membership Stripe payment’ is closed to new replies.