To be able to place orders locally using a payment app it needs to be able to communicate with the outside world. Lets have a look how to get that working with ngrok.
1. Download and register ngrok
Download ngrok and sign up free account. We will need that to use https. After you have signed up you will get an authtoken. Fire up you ngrok-terminal and type:
use ngrok.exe if you are using windows.
2. Exposing a server
Open up your docker-compose.yaml-file and scroll down to the ports section of the desired app. Shown below is the direct-payment example, in which we are interested in knowing that it uses port 10011.
The direct-payment app doesn’t need ngrok to work. But since it is present in the default installation of Litium we will use it as an example. You are probably doing this for a payment app such as Svea or Klarna.
Now go back to your terminal and run:
Or this in Windows:
You will now see something looking like this:
Copy the ngrok-url using https and lets continue.
3. Using the ngrok url
Go back to your docker-compose.yaml-file and set the AppMetadata__AppUrl to your ngrok url.
4. Docker time
Now stop your applications in docker and then run:
And that is it. Thanks to Nils at Litium support!