Administration

Follow these steps to authenticate the app, use the console commands and listen to events.


  1. 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.

  2. Record storage

    Create a folder to hold the event and credit transaction record. The folder uid will be assigned to the site property storageUid.

  3. Site configuration

    • Create a wise folder in your site directory. In case the site identifier is default the directory hierarchy would be config/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 the eventUrlSegmentChallenge and the storageUid. The apiTokenKey will be set later.

      wise:
        apiTokenKey: '11111111-1111-1111-1111-111111111111'
        eventUrlSegmentChallenge: wdoufkyrkLoqaarxxvmdxyyj
        storageUid: 1
      
  4. 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
    
  5. 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.
  6. 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 property wise.eventUrlSegmentChallenge.

  7. Use it…

    Use the console commands, listen to events and create a test by transferring 0.1€ to your wise account.