monero-integrations / monerowhmcs

WHMCS for Monero
MIT License
15 stars 18 forks source link

RuntimeException: Syntax error: in [...]modules/gateways/monero/library.php:169 #35

Closed thestick613 closed 5 years ago

thestick613 commented 5 years ago
Oops!
Something went wrong and we couldn't process your request.
Please go back to the previous page and try again.

If the problem persists, please contact us.

« Back to Homepage

For additional assistance, please reference the WHMCS TroubleShooting Guide »

RuntimeException: Syntax error: in 
[...]/modules/gateways/monero/library.php:169
Stack trace:
#0 [...]/modules/gateways/monero/library.php(105): Monero_rpc->validate(true, 'Syntax error: ')
#1 [...]/modules/gateways/monero/library.php(231): Monero_rpc->request('make_integrated...', Array)
#2 [...]/modules/gateways/monero/library.php(292): Monero_rpc->_run('make_integrated...', Array)
#3 [...]/modules/gateways/monero/createinvoice.php(39): Monero_rpc->make_integrated_address('XXXXXXXXXXXXXXXXXXXX...')
#4 {main}

In the monero rpc i have the following log:

2019-01-06 11:50:53.342 [RPC0]  DEBUG   wallet.rpc      src/wallet/wallet_rpc_server.h:66       HTTP [y.y.y.y] POST /x.x.x.x:80/json_rpc
2019-01-06 11:50:53.342 [RPC0]  TRACE   net.http        contrib/epee/include/net/http_protocol_handler.inl:589  HTTP_RESPONSE_HEAD: << 
HTTP/1.1 404 Not found
Server: Epee-based
Content-Length: 0
Content-Type: text/plain
Last-Modified: Sun, 06 Jan 2019 11:50:53 GMT
Accept-Ranges: bytes
serhack commented 5 years ago

Hi @thestick613 , Thanks for opening this bug. Could you please write the version you're using of WHMCS? What steps did you take in order to reproduce this issue?

Best regards, SerHack

thestick613 commented 5 years ago

The version of WHMCS is 7.6.1 - General Release - 7.6.1-release.1. I have the WHMCS instance on the y.y.y.y server and the monero tools on another server, x.x.x.x.

I first ran on x.x.x.x: ./monero-wallet-cli --daemon-address node.moneroworld.com:18089 and created a new wallet called mywallet.txt, and then i ran

/home/user/monero-v0.13.0.4/monero-wallet-rpc --rpc-bind-port 80 --rpc-login user:pass --log-level 3 --wallet-file mywallet.txt --daemon-address node.moneroworld.com:18089 --password walletpassword --rpc-bind-ip x.x.x.x --confirm-external-bind --rpc-access-control-origins y.y.y.y

I've put all this data in the whmcs monero payment gateway module, and then tested it all out. The first error i got was connection refused, but it was caused by the firewall, which now has been solved. I can confirm that the connection is taking place between the whmcs instance and the monero json rpc server.

thestick613 commented 5 years ago

Upon further searching with a HTTP sniffer, a "working" rpc clients posts to this url POST /json_rpc HTTP/1.1

But the php code posts here POST /x.x.x.x:80/json_rpc HTTP/1.1 Any idea if this code ever worked?

serhack commented 5 years ago

The url is composed by this:

https://github.com/monero-integrations/monerowhmcs/blob/master/modules/gateways/monero/createinvoice.php#L16

It worked but I think there could be a compatibility issue. I do not know why it's sending POST through the /x.x.x.x:80/. Is your base URL your website or IP you set up?

thestick613 commented 5 years ago

It's an IP. I'll try with a hostname.

thestick613 commented 5 years ago

Same

POST /myhostname.monero.something.com:80/json_rpc HTTP/1.1