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

Failed saving invoice #9

Closed
otaviobonder-deel opened this issue Jan 24, 2018 · 28 comments
Closed

Failed saving invoice #9

otaviobonder-deel opened this issue Jan 24, 2018 · 28 comments

Comments

@otaviobonder-deel
Copy link

Lightningd is running and Charged is running as well. Charged shows HTTP server running on localhost:9112. My router port is open, and the lightning charge server on the plugin settings page points to my ip:9112.

However, when I try to create a payment using LN, Woocommerce shows failed saving invoice

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

  1. Do you have the Lightning Charge API token configured in WooCommerce's settings?

  2. Are WordPress and Lightning Charge running on the same server?

  3. If not, are you able to access Lightning Charge using curl from the machine running WordPress? You can try something like:

    $ curl -u api-token:[your-token] http://[ln.charge.hostname]:9112/invoices
    

@otaviobonder-deel
Copy link
Author

  1. Yes, API token configured
  2. No, WordPress running on SiteGround
  3. No, I get a connection failed even if my router port is correctly redirected to charged server

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Try running charged with --host 0.0.0.0

@otaviobonder-deel
Copy link
Author

No job, connection timed out.

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Are you able to access charged locally? Try this from the machine running charged:

$ curl -u api-token:[your-token] http://127.0.0.1:9112/invoices

If this works, I'm not really sure how to help you... this appears to be a router configuration issue.

@otaviobonder-deel
Copy link
Author

Yes I can, already tested it. Could create an invoice either

@otaviobonder-deel
Copy link
Author

I've already checked if the router port is really open using https://www.yougetsignal.com/tools/open-ports/ and it's everything fine with this port.

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Can you access the server by typing your public IP address into your browser URL bar?

@otaviobonder-deel
Copy link
Author

Yes, I can connect to it using SSH

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

SSH is different. Are you able to access the HTTP server running on port 9112?

@otaviobonder-deel
Copy link
Author

Yes, typing my IP address:9112 I receive Cannot GET /

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Oh, interesting. Then its probably not an issue with your router, but rather on SiteGround's side. My guess is that they're blocking outgoing requests to non-standard ports.

Can you set your router to forward port 80 to your machine's port 9112?

@otaviobonder-deel
Copy link
Author

Now I can't connect using my browser either

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Looks like port 80 might already be used for something else. Hmm, maybe reach out to SiteGround and ask them to whitelist port 9112, or give you the list of whitelisted ports and try to use one of them?

@otaviobonder-deel
Copy link
Author

Thank you again mate, will do it. Port 80 is used for Web Management, so I will try to change it to another port. If I get no success, I will contact them!

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Other ports that are commonly open include 443 (typically used for SSL, but you could use it for HTTP), 8080 and 81.

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

443 being the most common of them all, I would try that first if your router isn't listening on it already.

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

I'm closing this issue because its not charge-related, but feel free to continue posting here if you have more questions.

@shesek shesek closed this as completed Jan 24, 2018
@otaviobonder-deel
Copy link
Author

You were right sir! SiteGround was blocking the port. Now everything is working fine! Just one offtopic question, it seems that the invoice number isn't line breaking, I'm sending the image attached. Do you know how to configure it?
lnpayment

@shesek
Copy link
Contributor

shesek commented Jan 24, 2018

Add .ln-pay .payreq { word-wrap: break-word; } to your CSS.

Note that this isn't the invoice number, its the BOLT11 payment request.

shesek added a commit that referenced this issue Jan 24, 2018
This is already done by the default WooCommerce theme (StoreFront),
but looks broken with other themes.

Refs: #9 (comment)
@otaviobonder-deel
Copy link
Author

Yes sure, BOLT11, sorry for the mistake and thank you for the css code, sir!

@vnnkl
Copy link

vnnkl commented Jul 17, 2018

for anyone who might experience the similar issue with no line break after paying the invoice,
the css code for that is
.woocommerce-order .order_details{ word-wrap: break-word; }

@shesek
Copy link
Contributor

shesek commented Jul 19, 2018

@vnnkl Added in 7da4990.

@cmatrade
Copy link

Hi,
I have the same issue with the error msg "failed saving invoice", what the port did you configure into your router ? thanks

@normandmickey
Copy link

I have the same "failed saving invoice" problem. My WordPress/Woocommerce site is hosted at Pressable. My lightning node is self hosted and Lightning Charge works with NanoPos. The port is open and I get a response when I "curl $CHARGE/info" using the API token from a separate machine. Upgraded to latest Lightning Charge, still no joy.

@shesek
Copy link
Contributor

shesek commented Aug 17, 2018

@normandmickey Some suggestions:

  1. The port is open and I get a response when I "curl $CHARGE/info" using the API token from a separate machine.

    Can you verify this works if you run this from the same machine running WordPress?

  2. Are there any logs generated on Lightning Charge when you attempt to make an order on WooCommerce? If the request for creating the invoice is coming through, you should be seeing something there.

  3. Are you able to create an invoice with curl $CHARGE/invoice -d msatoshi=500?

@normandmickey
Copy link

normandmickey commented Aug 18, 2018 via email

@shesek
Copy link
Contributor

shesek commented Aug 19, 2018

It appears to be some communication problem between the two servers. Maybe Pressable is rejecting the outgoing connection?

Are you using the default port (9112) for Charge? Some firewalls don't like non-standard ports, which might be a reason Pressable blocks it. You might have better look running on port 80.

stuartsimonsen added a commit to stuartsimonsen/woocommerce_plugin that referenced this issue Mar 14, 2021
This is already done by the default WooCommerce theme (StoreFront),
but looks broken with other themes.

Refs: ElementsProject/woocommerce-gateway-lightning#9 (comment)
stuartsimonsen added a commit to stuartsimonsen/woocommerce_plugin that referenced this issue Mar 14, 2021
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

5 participants