com.drastikbydesign.stripe icon indicating copy to clipboard operation
com.drastikbydesign.stripe copied to clipboard

Joomla 3.8 Webhook Issue

Open tmumm opened this issue 7 years ago • 18 comments

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

tmumm avatar Oct 19 '17 17:10 tmumm

@tmumm There have been a few Joomla 3.8 / Civi issues. The fixes for cron/cli.php got merged today (https://github.com/civicrm/civicrm-core/pull/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.

mattwire avatar Oct 19 '17 17:10 mattwire

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.

tmumm avatar Oct 19 '17 18:10 tmumm

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.

studio136 avatar Oct 23 '17 19:10 studio136

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

mattwire avatar Oct 23 '17 19:10 mattwire

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

studio136 avatar Oct 23 '17 20:10 studio136

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 avatar Oct 24 '17 13:10 studio136

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.

studio136 avatar Oct 25 '17 16:10 studio136

@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.

mattwire avatar Oct 25 '17 16:10 mattwire

@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

tmumm avatar Oct 25 '17 18:10 tmumm

@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 avatar Oct 25 '17 19:10 studio136

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 avatar Oct 25 '17 20:10 studio136

@tmumm Curious of what version of Stripe you are using

studio136 avatar Oct 26 '17 16:10 studio136

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

tmumm avatar Oct 26 '17 16:10 tmumm

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).

studio136 avatar Oct 26 '17 16:10 studio136

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.

drastik avatar Oct 30 '17 15:10 drastik

@drastik @tmumm Clearing cache sound like it might well be the IDS system in Civi which would probably be resolved by https://github.com/drastik/com.drastikbydesign.stripe/pull/229

mattwire avatar Oct 30 '17 15:10 mattwire

Clean, merged #229

drastik avatar Oct 30 '17 15:10 drastik

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

tmumm avatar Oct 30 '17 15:10 tmumm