Administration¶
Follow these steps to authenticate the app, use the console commands and listen to events.
Url segment challenge
Create a url segment challenge consisting of lower case letters and numbers with about 20 characters. The value will be used in the site configuration (property
eventUrlSegmentChallenge
) and the wise web site.Record storage
Create a folder to hold the event and credit transaction record. The folder uid will be assigned to the site property
storageUid
.Site configuration
Create a wise folder in your site directory. In case the site identifier is
default
the directory hierarchy would beconfig/sites/default/wise
.Create a wise configuration file
config/sites/default/wise/site.yaml
.Include the wise configuration file in
config/sites/default/config.yaml
by adding the following lines on the bottom:imports: - { resource: './wise/site.yaml' }
Copy the following configuration into the wise configuration file (
config/sites/default/wise/site.yaml
) and set theeventUrlSegmentChallenge
and thestorageUid
. TheapiTokenKey
will be set later.wise: apiTokenKey: '11111111-1111-1111-1111-111111111111' eventUrlSegmentChallenge: wdoufkyrkLoqaarxxvmdxyyj storageUid: 1
Key files
Generate the key files and store them to
config/site/[identifier]/wise/
. The following linux command could be used to generate the key files:openssl genrsa -out private.pem 2048 openssl rsa -pubout -in private.pem -out public.pem
App authentication
- Login to your wise account and create an API token with “read only”
permissions and assign its key to the site configuration property
wise.apiTokenKey
. - Add the public key from
config/site/[identifier]/wise/public.pem
to the API tokens.
- Login to your wise account and create an API token with “read only”
permissions and assign its key to the site configuration property
Balance deposit hook
Register the event handler with a webhook. The webhook properties are:
- Subscription event: Balance deposits
- URL:
[https://domain.ch]/wise-event-handler-[url segment challenge]
Hint
Replace
[url segment challenge]
with the value previously assigned to the site configuration propertywise.eventUrlSegmentChallenge
.Use it…
Use the console commands, listen to events and create a test by transferring 0.1€ to your wise account.