Installation and Setup (TEST)

Requirements

Installing and running the connector requires the following:

  • Java 17 JDK

  • A Linux Environment

  • A mail server for sending alerts and notifications

  • A web server

  • A valid SSL/TLS certificate

Configuration Variables for Building the Connector

The connector uses the Mirakl SDK, so the build system will need to download it from a private Maven repository owned by Mirakl. This repository is user/password protected so the build scripts need these two environment variables:

PAYPAL_MIRAKL_SDK_USER
PAYPAL_MIRAKL_SDK_PASSWORD

Folders

The connector stores information in the following folders:

  • ./data: Contains the connector’s database. Can be customized using the environment variable PAYPAL_HYPERWALLET_DATA_DIR.

  • ./financial-report: Contains the financial reports generated by the connector. Can be customized using the environment variable PAYPAL_HYPERWALLET_FINANCIAL_REPORTS_OUTPUT_DIR.

Build and run from source (Quickstart)

This is the easy and most straightforward way of running the connector. You simply download the code, build it and run it from the same directory.

Building the connector

  1. Clone the GitHub repository of the project:

    $ git clone https://github.com/paypal/mirakl-hyperwallet-connector.git
  2. Set up build required environment variables

  3. Execute build script:

    $ ./gradlew clean build

After these steps the connector is ready to run.

Running the connector

  1. Set up the required configuration environment variables

  2. Run the connector

    $ ./gradlew app:bootRun

Checking if the connector is ready

Run the connector with docker

With this setup workflow you will generate a docker image that can be used to run the connector and that is easily exportable to other environments.

Requirements

  • Docker and Docker Compose installed on your system.

Building the connector

  1. Clone the GitHub repository of the project:

    $ git clone https://github.com/paypal/mirakl-hyperwallet-connector.git
  2. Set up build required environment variables

  3. Execute build script:

    $ ./gradlew clean build

Creating a docker image

  1. Create the docker image

    $ ./gradlew hmc-app:bootBuildImage

Running the docker container

  1. Create an .env file with the environment variables. You can use the provided .env.sample as a reference

  2. Start the connector with docker using this command (change X.Y.Z` with the version of the connector, e.g. 5.0.0)

    $ docker run --env-file .env -p 8080:8080 hyperwallet-mirakl-connector:X.Y.Z
If needed, you can also map the volumes for the folders described at the begining of the page and for the encryption keys.

Running the docker container with docker compose

  1. Create a docker compose file

    $ ./gradlew buildDockerCompose -Pprod=true
You can also generate a docker compose file for development or testing purposes by omitting -Pprod=true. This docker compose file will also launch additional dependencies like mail server so you don’t need to setup one.
  1. Create an .env file with the environment variables. You can use the provided .env.sample as a reference

  2. Start the connector with docker compose using this command

    $ docker-compose up
If needed, you can also edit the generated docker-compose file to change the volume mappings.

Building and running a binary

With this setup workflow you will build an executable JAR that you can move to the target machine where you want to execute the connector. This allows you to build only one time and reuse the executable JAR for multiple environments (like your pre-production and production environment).

Building the connector

  1. Clone the GitHub repository of the project:

    $ git clone https://github.com/paypal/mirakl-hyperwallet-connector.git
  2. Set up required environment variables for the build process

  3. Execute build script:

    $ ./gradlew clean build

After these steps the connector is ready to run.

Creating executable JAR file

The first step for having the connector up and running is building it from source code.

  • ./gradlew clean build bootJar

It will generate a file named hmc-app-X.Y.Z.jar in the ./hmc-app/build/libs directory.

Running executable JAR file

  1. Execute the JAR using Java:

    $ java -jar hmc-app-X.Y.Z.jar