Receiving with LNURL

When other services scan an LNURL address generated by your service, they follow the lnurl-pay standard to connect with your service to make payments.

To make this possible, you must have indexed/registered an LNURL address for your users. Start here. An LNURL is a static internet identifier.

After creating an LNURL address or static QR, other services will send requests to your customers for payment invoices without them having to manually create invoices.

You need the following items to easily accept payments via LNURL addresses on Bitnob.

  1. Indexed (create LNURLs) customers via LNURL. Do that here
  2. Domain with HTTPS
  3. Configuring your custom domain for routing through Bitnob nodes

Server Configuration

Depending on the kind of setup you have and how you will want to host lnurl, there are several ways you can configure your server to allow us to handle the process of receiving payments for you.

  1. You want to use an existing domain with an existing project. E.g You have an existing app called Bitcoin and your domain is bitcoin.org. If you want your lnurl to use this domain, then we recommend this kind of configuration.

Configuration for services running behind Nginx
Add the following configuration to your Nginx

location /.well-known/lnurlp {
     rewrite ^/.well-known/lnurlp(.*)$ https://api.bitnob.co/<your-public-api-key>/lnurlp$1 permanent;
     return 301;
 }

location /lnurlpay {
     rewrite ^/lnurlpay(.*)$ https://api.bitnob.co/<your-public-api-key>/lnurlpay$1 permanent;
     return 301;
 }

Configuration for services running behind Apache webservers

<IfModule mod_rewrite.c>
# LNURL CONFIG
RewriteCond %{REQUEST_URI} ^/\.well\-known/lnurlp
RewriteRule ^.well\-known/lnurlp(.*)$ https://api.bitnob.co/your-public-api-key/lnurlp$1 [R=301,L]

RewriteCond %{REQUEST_URI} ^/lnurlpay
RewriteRule ^lnurlpay(.*)$ https://api.bitnob.co/<your-public-api-key>/lnurlpay$1 [R=301,L]
</IfModule>

Important - this apache config should be added at the top of the config file.

What this does is redirect all requests to your service to Bitnob for handling the complex parts of the payment flow.

👍

Domain and server configuration

For a lot of services, you are probably running the website and backend on separate domains. E.g website is on bitcoin.org while the backend is on api.bitcoin.org. You only need to add these config details to server hosting the website


Did this page help you?