On a project I’m working on there is an integration to the payment provider Klarna. I was having trouble to get it to work on my local development environment.
Everytime a purchase was made the visitor(me) was supposed to get redirected back to the dev-environment. I was… but to the wrong url: https://local-dev-env-url/+CSCOE+/wrong_url.html In my case this was connected to the validation_uri setting.
What is the validation_uri ?
“This checkout function will allow you to validate the information provided by the consumer in the Klarna Checkout iframe before the purchase is completed.” – Klarna
This is an example of what is sent to Klarna in my local environment, and you can see the validation_uri at the bottom.
Since I’m running this code locally the Klarna API can’t reach my validation uri. That was what was causing my problem. For debugging purposes you can skip to send the validation_uri since it is an optional setting according to the documentation. To also debug the validation logic you need to make sure the Klarna API can reach that url.
Hopefully this helps someone else in the same situation as I was. But I have a feeling you can encounter the same error but it’s being caused by something else.
A big thanks to the Klarna support for helping out with this!
When I ran the last command to install dislocker this error showed up:
By unlinking ruby as explained by jricks92 on Github the install went through with no errors:
2. Drive identifier
Now we need to know the identifier of the bitlocker encrypted disk. In the terminal we’ll run the command diskutil list (on macOS).
The identifier i’m interested in here is called disk2s1
3. Encrypt with dislocker
First we need to create a folder where a virtual NTFS partition called dislocker-file will be created. I’ll call mine externalhdd and i’ll create it in the mnt folder.
Now it’s time to use Dislocker to decrypt the disk.
-V /dev/disk2s1 tells dislocker what disk to decrypt. -u tells dislockers to ask the user for the password the disk is encrypted with. -- /mnt/externalhdd passes the path to the folder we created to store the virtual ntfs-partition.
4. Create a block device
Now we need to create a block device before mounting the disk.
hdiutil - manipulate disk images (attach, verify, create, etc) attach - Attach a disk image as a device imagekey - specify a key/value pair for the disk image recognition system. I can’t find information on what the diskimageclass=creatdiskimage means in the man pages of hdiutil. nomount - indicate whether filesystems in the image should be mounted or not.
After running this command i got the line /dev/disk3 printed in the console. Now we’ll use that to mount the drive.
Start by creating a folder where the drive will be mounted
Then we run this command to mount it (only readable):
And by now, if you haven’t encountered any errors, you should see the disk in Finder.
There are more to dislocker than this post shows, take a look at the man pages to get more info:
Start by installing electron-installer-debian package:
2. Create config file
Then create a new file called debian.json that will contain settings we need to create the package.
With dest we set where the .deb package will be saved.
The icon options points to an icon the app will get.
categories sets the category where the application will be seen in menus. I’ve choosen Utility for this app since there is no real good place for it. You can take a look at the available categories for your app.
lintianOverrides is used to quieten Lintian, which is a debian package checker.
There are a lot of other options you can set. You might want to check how to set for example dependencies. But this will currently be enough for the Electron tutorial app.
3. Package the app
Now we need to make sure we have a packaged app. First I need to make an update to the packager script since I’ve missed a setting there. Thank you Felipe Castillo for the help!
The package script called package-linux in package.json that currently looks like this:
Needs to be updated with a setting called appname. So it will now look like this instead:
Now we can run the package script:
4. Creating the debian package
When the electron-packager is finished, we can run the electron-installer-debian to create a .deb package.
src points to the folder where the packager saved the app.
arch tells electron-installer-debian which architecture to build for.
config points to the file containing the settings we defined in step 2.
5. Adding script to package.json
So that we don’t need to remember the electron-installer-debian command everytime we can add it to package.json below create-installer-win:
Now we can run
This is what the package-installer looks like in Mint Linux when opening release-builds/electron-tutorial-app_0.1.0_amd64.deb
After doing that step I was happy and tired and didn’t add that key into the info.plist again before going on vacation. Bad move. I spent an hour figuring out why my app wouldn’t start when running react-native run-ios. Instead i got the error No bundle URL Present..
By adding the following to info.plist it started to work again:
However this is not the only thing that could produce this error. Checkout this Github issue if the solution above does not help.