sumup
RevBank plugin for SumUp card payments
Description
This plugin allows interactive card payments using the SumUp Cloud API and a connected terminal.
Installation
-
Get a compatible payment terminal
Note: SumUp calls their terminals "readers".
At the moment of writing, only the Solo model supports the "Cloud API". Note: the Solo Lite does not.
Because these terminals are not linked to specific accounts, you can get a used one. But they are country-locked so make sure it's one from where you intend to use it.
-
Create an account and have it approved.
Create a SumUp account and go through the verification process.
-
Create an API key
In the SumUp Developer site, create an API key. It is possible to create a test account with its own API key. It is recommended to test everything in a copy of your RevBank installation, using the test account.
Note that the test account has its own Merchant ID too, which you can look up in the Dashboard.
-
Install the API proxy
SumUp's API keys can only be linked to the admin account, and as such, have full rights. Yikes. You wouldn't want to use that in RevBank directly. The proxy provides very limited API access for RevBank to use.
git clone https://codeberg.org/revspace/sumup-proxy /opt/sumup-proxy cd /opt/sumup-proxy yarn install # NOTE: in Debian, use yarnpkg instead of yarnWhen using systemd:
cp sumup-proxy.service /etc/systemd/system cp config.example.json /etc/sumup-proxy.json chmod 600 /etc/sumup-proxy.json $EDITOR /etc/sumup-proxy.json # update merchantId and apiKey systemctl start sumup-proxy systemctl enable sumup-proxy systemctl status sumup-proxyWhen not using systemd, find another way to run the proxy with its own dedicated user account and config file that is not readable by others (including the user that runs `revbank`).
-
Enable a deposit_method
There are a few steps to get this working. First, ensure that a
deposit_methodsplugin is loaded. If you're not usingdeposit_methodsalready, note that it is recommended to copy the plugin and then edit the copy, e.g.:cp plugins/deposit_methods ~/.revbank echo './deposit_methods' >> ~/.revbank/plugins $EDITOR ~/.revbank/deposit_methodsThe example
deposit_methodsplugin in the Git repository already comes with an example for card payments: the method is called `pin`. You could use a different name, like `card`, but in that case you also have to configure thesumupplugin to use that. Seeplugins/config.examplefor that. -
Enable this plugin
Add
sumupto yourpluginsfile. Restart RevBank. -
Pair the payment terminal to the RevBank instance
Don't login on the card reader. If it's already log in, log it back out again. When it's logged in, the Cloud API feature is not available.
Connect the reader to the Cloud API. That will fail if it was previously paired, saying the code has expired. Just try it again.
In RevBank, use:
_sumup_pairThis command can't be tab-completed. Type the code from the reader's display.
It may take a few seconds for the device to start connecting. Don't panic if it doesn't respond immediately.
Configuration
There are a few variables you can configure. They're pretty self-explanatory if
you know how RevBank works. To disable accountless payments, you can set the
$passerby_command variable to an empty string.
Disclaimer
RevBank and its authors are not afiliated with SumUp in any way. The interoperability provided by this plugin should not be construed as endorsement of any company, products, or services.