-
Notifications
You must be signed in to change notification settings - Fork 3
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
WHMCS integration isn't working after latest update #4
Comments
Can you try this patch, looks like it's not liking the title_link in attachments that are blank, so it makes it optional. https://github.com/digitalsparky/rocketchat-whmcs/blob/ISSUE-4/RocketChat.php |
Thanks for the patch, but unfortunately that didn't sort the issue :(
Can you please shed some light on this further there? |
Ok, no worries, I'll have a look to see where things are going awry in a test instance - looks like the actual inbound hook is requiring some data that's not being provided. It's probable that attachments with no custom links would need to default to the main link for the notification - theoretically, that should work... |
I've made another quick change that will change the title_link to the notification link by default, which theoretically should make it happier as it'll be providing a title link regardless. |
I will test and let you know shortly. Thanks for your efforts! :) |
@digitalsparky I just tested that new patch, but that isn't parsing correctly and getting 500 error on Notification page for me here so I reverted it back. Looks like there is a syntax error on the new patch file RocketChat.php php -l RocketChat.php I'm not good at PHP coding, however, had a quick overview and seems like 65th and 66th line is causing the issue since "'title_link' =" actually would be "'title_link' =>" and the square bracket isn't closed that might have causing this situation. :\ |
Oops, sorry, try now. |
Thanks for sorting out the syntax, however, the initial issue persists. I'm getting below error when open a ticket or placing orders:
Not sure of the cause :( |
ugh, okay, bare with me, I'm going to stand up a staging system and I'll try and figure this out. |
Thanks Matt for your excellent assistance, much appreciated! :) |
Any update on this Matt? :) |
Hi @fasalsh I've setup a dev environment and tested, I was able to replicate the issue, however once I set the systemurl for WHMCS that issue went away and all was working fine. It relies on being able to post a static URL, so it uses the System URL defined in settings -> general to assemble that URL. If it doesn't have a System URL then it'll error out because the only part of the link it has to work with is the path. Can you check your system to make sure you've got that setting configured including http:// or https:// at the start. Cheers |
The system URL is already set correctly on our WHMCS, so that isn't the case in our case. The below are the package versions in use on our server: RocketChat: 2.3.0 Does any of the above will conflict with this module system? I can see a POST text is appending in front of the hook call, that could've causing this situation but not sure.
Please review and let me know if require any further details. Thanks :) |
Hey folks, sorry for the delay, I've been preoccupied with other things. I'll look at this again shortly. I do have both WHMCS and RocketChat installed locally for testing, so I hope I'll be able to come up with a solution sooner rather than later. It is rather odd though as all the documentation looks to be correct, unless RC has a bug in it resulting in the error. |
Hello, do you have any news about this problem? |
Hello Guys,
We had an integration between WHMCS and RocketChat to alert whenever an even occur on it. This isn't working after updating to the latest 2.3.0 version for some reason. The calls are coming from the WHMCS module same as before, however, the RocketChat always throwing "400 Bad Request" to those calls. Was there anything changed on this webhook treating part?
This is the RC log:
I20191127-19:46:28.243(5.5) API ➔ debug POST: /hooks/Z69xeq/iRRnsHBg3QvvsBG229jJv25ZAwPrMJAC678jP5 I20191127-19:46:28.246(5.5) Integrations ➔ Incoming WebHook.info Post integration: Orders I20191127-19:46:28.248(5.5) Integrations ➔ Incoming WebHook.debug @urlParams: { integrationId: 'Z69xeq', token: 'iRRnsHBg3QvvsBG229jJv25ZAwPrMJAC678jP5' } I20191127-19:46:28.250(5.5) Integrations ➔ Incoming WebHook.debug @bodyParams: { text: '[Order #690751](https://DOMAIN/admin/orders.php?action=view&id=22) <br> A new order has been accepted.', attachments: [ { title: 'Client', text: 'XXXXX', title_link: 'https://DOMAIN/admin/clientssummary.php?userid=20' }, { title: 'Amount', text: '$1.00 USD', title_link: '' }, { title: 'Invoice #', text: '14', title_link: 'https://DOMAIN/admin/invoices.php?action=edit&id=14' }, { title: 'Payment Method', text: 'PayPal', title_link: '' }, { title: 'Status', text: 'Active', title_link: '' } ] } I20191127-19:46:28.257(5.5) API ➔ debug Failure { statusCode: 400, body: { success: false, error: 'Invalid href value provided', stack: undefined } }
This is the error I'm getting on WHMCS:
Can you please shed some light on this to resolve? This is a crucial integration part for us.
Thanks :)
The text was updated successfully, but these errors were encountered: