Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joomla 3.8 Webhook Issue #239

Open
tmumm opened this issue Oct 19, 2017 · 18 comments
Open

Joomla 3.8 Webhook Issue #239

tmumm opened this issue Oct 19, 2017 · 18 comments

Comments

@tmumm
Copy link

tmumm commented Oct 19, 2017

Since Joomla 3.8 update I've been getting an error on webhook. I suspect the router changes in 3.8 may have impacted this. Cron URL's were impacted as well, which was resolved in the latest Civi update. https://github.com/joomla/joomla-cms/projects/7

@mattwire
Copy link
Contributor

@tmumm There have been a few Joomla 3.8 / Civi issues. The fixes for cron/cli.php got merged today (civicrm/civicrm-core#11062). You'll need to provide more details:

  • what is the error?
  • what URL is it trying to connect to?

This probably not Stripe specific, in which case it should be opened against Civi core. But more detail is required.

@tmumm
Copy link
Author

tmumm commented Oct 19, 2017

Thanks. This is the URL: https://bicyclecollective.org/index.php/component/civicrm/?task=civicrm/stripe/webhook.

Stripe indicates a 500 error, Civi shows:

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.

@studio136
Copy link

Stripe 4.7.1
Civi 4.7.25 (with civicrm/civicrm-core#11062 patch)
Joomla 3.8.1
I am also getting these Webhook errors. Specifically, 'You are not authorized to access that page'.

I upgraded to Stripe 4.7.2, applied the patch here https://github.com/drastik/com.drastikbydesign.stripe/pull/208/files to fix the Back-End member renewal page that was coming up blank and causing a server error. I believe this fixed the Webhook errors, but then I was receiving fatal error 'js token not passed' when processing payments on the back end.

I rolled back to Stripe 4.7.1 and can now process payments but that leaves me stuck again with the Webhook issue.

@mattwire
Copy link
Contributor

Are you able to try this experimental version?
https://github.com/mattwire/com.drastikbydesign.stripe/tree/4.7-mjwconsulting-dev

It doesn't have any specific fixes for the webhook, but is based off the 4.7.2 version and has some fairly major refactoring to fix the js token issues. It would be very helpful to get your feedback

@studio136
Copy link

Thanks, I'll see if I can recreate the issue on a dev site and test this out.

@studio136
Copy link

I tested this out, I immediately got 'js token not passed'. It appears that stripe.js is not loading at all.
In stripe.php, if I go back to using the buildForm hook instead of the alterContent, and let stripe.js load the js.stripe.com/v2/ script, contributions are successful both on front-end and back-end. Of course this is no good for Webforms but not an issue with Joomla.
I believe the webhooks are working fine.

@studio136
Copy link

Update: Even if I patch this experimental version to work with Joomla, then back end event registration doesn't work, either token not passed OR billing form not loaded.

Wondering, is there any plans to get the Stripe extension working with Joomla? 4.7.1 works except for the webhook - permission denied error (the original problem posted in this issue).

I currently have 3 sites using this extension, 2 of which need the webhook to work.

@mattwire
Copy link
Contributor

mattwire commented Oct 25, 2017

@studio136 I need to get it working on a Joomla site too... any info you can give me on where it does/doesn't work would be helpful.
There is also a branch here which makes changes to the webhook functions to bring them inline with Civi: https://github.com/progressivetech/com.drastikbydesign.stripe/tree/ptp-latest
@jmcclelland and I are working to merge the changes from our two branches together.

@tmumm
Copy link
Author

tmumm commented Oct 25, 2017

@mattwire Also, noted this error hidden in the messy error page: Stripe Callback: cannot json_decode data
0_-__div_id__crm-container__class__crm-container__lang__en__xml_lang__en____style_type__text_css__media__screen____import_url_https___bicyclecollective_org_administrator_components_com_civicrm_civicrm_css_civicrm_css____import_url_https___b

@studio136
Copy link

@mattwire For your branch: com.drastikbydesign.stripe-4.7-mjwconsulting-dev

Backend Submit Credit Card Contribution & Backend Submit Credit Card Event Registration
stripe.php -> stripe_civicrm_alterContent
if (($context == 'form' && !empty($object->_paymentProcessor['class_name'])) || (($context == 'page') && !empty($object->_isPaymentProcessor)))

Neither of these is ever true, so the civicrm_stripe.js file is not loading, causing a Token Not Passed error
$object->_paymentProcessor & $object->_isPaymentProcessor don't exist

Backend Submit Credit Card Membership - WORKS
Frontend Contribution - WORKS
Frontend Membership - WORKS
Frontend Event Reg - WORKS

Webhook Test:
Error 500: No such event: evt_00000000000000
I believe this would work had an acutal event id been sent

@studio136
Copy link

Branch: com.drastikbydesign.stripe-ptp-latest

Backend Submit Credit Card Membership / Backend Submit Credit Card Contribution /Backend Submit Credit Card Event Registration

**stripe.php -> stripe_civicrm_alterContent**
	`if($context == 'form' && !empty($object->_paymentProcessor['class_name'])) {
  if($object->_paymentProcessor['class_name'] == 'Payment_Stripe') {`

civicrm_stripe.js file is not loading because $object->_paymentProcessor does not exist

Frontend Membership / Frontend Contribution / Frontend Event Registration

Warning: require_once(CRM/Core/Payment/Stripe.php): failed to open stream: No such file or directory in .../public_html/administrator/components/com_civicrm/civicrm/Civi/Payment/System.php on line 59

Fatal error: require_once(): Failed opening required 'CRM/Core/Payment/Stripe.php'

For Clarity, tested both of these on:
Joomla 3.8.1
Civi 4.7.25

@studio136
Copy link

@tmumm Curious of what version of Stripe you are using

@tmumm
Copy link
Author

tmumm commented Oct 26, 2017

Are you referring to plugin version or API version? Original issue was 4.7.1, upgrading to 4.7.2, and just now upgraded to 4.7.3 and issue remains. Interestingly, when I updated to 4.7.2 I got an email from Stripe that said the webhook was fixed, but then the error returned shortly.

On Stripe API Version was outdated, and just upgraded it to the latest - no change.

Also, Joomla 3.8.1 and Civi 4.7.25

@studio136
Copy link

studio136 commented Oct 26, 2017

Sorry, was referring to the extension version.
One of my sites that reported the webhook was not working, is still on 4.7.1. This morning, I was notified that another extension, Sparkpost, also had an issue accessing the webhook. When I tried to go to the Outbound Email(Sparkpost) settings page, it threw me back to the main civi administrative settings page. So I cleared Civi Cache and was able to then get to the proper page.
Funny thing is that right after I cleared the cache, I got a notification from Stripe saying 'Good news - we were able to successfully deliver an event to your endpoint'.
So I can only assume that clearing Civi Cache resolved the issue. Thought you might want to give it a shot?

@tmumm Update: I can confirm that clearing Civi Cache resolved the webhook error on 3 sites (as well as the Sparkpost webhook error on numerous sites).

@drastik
Copy link
Owner

drastik commented Oct 30, 2017

Update: I can confirm that clearing Civi Cache resolved the webhook error on 3 sites (as well as the Sparkpost webhook error on numerous sites).

This is extremely valuable info.

@tmumm Can you try clearing Civi Cache and let us know how that went? This would be great information to put in the README, I've been getting a ton of e-mails about issues w/ upgrade.

@mattwire
Copy link
Contributor

@drastik @tmumm Clearing cache sound like it might well be the IDS system in Civi which would probably be resolved by #229

@drastik
Copy link
Owner

drastik commented Oct 30, 2017

Clean, merged #229

@tmumm
Copy link
Author

tmumm commented Oct 30, 2017

Unfortunately clearing the cache had no impact for me. I cleared both the Joomla and Civi cache.

scardinius pushed a commit to WeMoveEU/com.drastikbydesign.stripe that referenced this issue Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants