From 7f78d8c611a64b30cdb14382412a56f7e2c43707 Mon Sep 17 00:00:00 2001 From: juandiego Date: Mon, 11 Mar 2024 09:18:10 -0500 Subject: [PATCH 1/5] Refactor: set starting-page as start-page --- Writerside/p.tree | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Writerside/p.tree b/Writerside/p.tree index ab2a0dd..3fac00c 100644 --- a/Writerside/p.tree +++ b/Writerside/p.tree @@ -4,7 +4,7 @@ + start-page="Starting-Page.topic"> From 15723c94df7725c641c178fa83c8614ce29a18b1 Mon Sep 17 00:00:00 2001 From: juandiego Date: Mon, 11 Mar 2024 09:20:11 -0500 Subject: [PATCH 2/5] Refactor: change name from Proxy Server to Docker support --- Writerside/topics/Proxy-Server.md | 2 +- Writerside/topics/SDK-and-tools.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Writerside/topics/Proxy-Server.md b/Writerside/topics/Proxy-Server.md index 094d66f..a895bca 100644 --- a/Writerside/topics/Proxy-Server.md +++ b/Writerside/topics/Proxy-Server.md @@ -1,4 +1,4 @@ -# Proxy Server +# Docker support **%product_name%** for non-Java based application, it possible to run a lightweight proxy server that exposes all SDK methods as a diff --git a/Writerside/topics/SDK-and-tools.md b/Writerside/topics/SDK-and-tools.md index b38ea31..af6e323 100644 --- a/Writerside/topics/SDK-and-tools.md +++ b/Writerside/topics/SDK-and-tools.md @@ -38,6 +38,6 @@ In the SDK Settings home screen you wil be able to see the followin ProWallet will require you user secret before to allow see or copy the Private key value. Get private key -Private key is used to sign each transaction, avoid share it +Private key is used to sign each transaction, avoid to share it \ No newline at end of file From f6a8441b2fbedd471702bca016d84f5016c857f7 Mon Sep 17 00:00:00 2001 From: juandiego Date: Mon, 11 Mar 2024 11:18:42 -0500 Subject: [PATCH 3/5] Doc(JavaSDK): update Java SDK documentation --- Writerside/topics/AboutProWallet.md | 3 +- Writerside/topics/Java-SDK.md | 303 ++++++++++++---------------- 2 files changed, 131 insertions(+), 175 deletions(-) diff --git a/Writerside/topics/AboutProWallet.md b/Writerside/topics/AboutProWallet.md index 051ab11..dfbce0f 100644 --- a/Writerside/topics/AboutProWallet.md +++ b/Writerside/topics/AboutProWallet.md @@ -23,7 +23,8 @@ Most of the features from Qenta can be performed through our comprehensive RESTf Utilizing standard HTTP protocols, our RESTful API empowers developers to effortlessly access and leverage Qenta's functionality, facilitating smooth communication and streamlined workflows for your applications. See more -The Qenta SDK for Java enhances the integration of Qenta Services by offering a comprehensive suite of libraries specifically designed to be intuitive and user-friendly for developers.
For non-Java based application, it possible to run a lightweight proxy server that exposes all SDK methods as a RESTful API. See more +Effortlessly integrate %product_name% services into your projects with our SDK and Tools.
+Our toolkit enhances the integration of %product_name% by offering a comprehensive suite of libraries specifically designed to be intuitive and user-friendly for developers.See more
Stay seamlessly informed about updates on your transactions through our notification tools. Our WebHooks empowers you to effortlessly integrate and leverage real-time transaction updates, ensuring you are always in the know. See more diff --git a/Writerside/topics/Java-SDK.md b/Writerside/topics/Java-SDK.md index 849d5d8..851a5e1 100644 --- a/Writerside/topics/Java-SDK.md +++ b/Writerside/topics/Java-SDK.md @@ -1,183 +1,138 @@ # Java SDK -The following steps are required to install the Qenta SDK server in a Windows Server 2016 computer. + This toolkit offers streamlined methods designed for creating orders and seamless interaction with the %product_name% API. Our Java SDK facilitates the integration process and enhance the functionality of your Java based applications. -> **BEFORE YOU START** +> **Requirements** > -> Make sure the server has internet access to download the required JRE files and administrative access to your -> Windows Server. +> - Java 11 or later +> - Maven 3.6.3 or later or Gradle 6.7 or later -{style="note"} +{style="tip"} - - -

Download JRE 21 and select a procedure type from the completion suggestions:

- -
  • Open your web browser and visit the Adoptium website to download JRE 21 manually.
  • -
  • Use the following URL: - Adoptium Temurin JRE 21 -
  • -
  • Save the downloaded file to a location on your server.
  • -
    -
    - -

    Create Target Directory

    - -
  • Open Command Prompt as an administrator
  • -
  • Run the following command to create a directory for Java

    - mkdir C:\Java\jre-21 -
  • -
    -
    - -

    Extract JRE Files

    - -
  • Navigate to the directory where you saved the downloaded ZIP file
  • -
  • Right-click on the ZIP file, choose Extract All and select the target directory as C:\Java

    -
  • -
    -
    - -

    Set JAVA_HOME

    - -
  • Open Command Prompt as an administrator.
  • -
  • Run the following command to set the JAVA_HOME environment variable

    - setx JAVA_HOME "C:\Java\jre-21" /M -
  • -
    -
    - -

    Copy JAR Files

    - -
  • Open a new Command Prompt as an administrator.
  • -
  • Run the following command to copy JAR files to the designated location

    - - xcopy /Y /S /E C:\Java\jdk-21.0.1+12-jre\* %JAVA_HOME%\ - -
  • -
    -
    - -

    Update PATH Variable to persist across restarts

    - - setx PATH "%PATH%;%JAVA_HOME%\bin" /M - -
    - -

    Verify Installation

    - -
  • Open a new Command Prompt as an administrator and execute the command:

    - - setx PATH "%PATH%;%JAVA_HOME%\bin" /M - - -
  • -
    -
    - -

    Depending on the configuration type, set the environment variables if using ENVIRONMENT VARIABLE or - JSON_FILE

    - -
  • CONFIGURATION_TYPE= ENVIRONMENT_VARIABLE

    - - setx ENVIRONMENT_CONFIG_URL https://config-url /M - setx QENTA_ACCESS_TOKEN token /M - setx QENTA_ENVIRONMENT DEVELOPMENT /M - setx QENTA_ORGANIZATION_ID 2648 /M - setx QENTA_PRIVATE_KEY privateKey /M - setx QENTA_USER_ID 6730 /M - -

    Then, restart the command line and execute:

    - java -jar qenta-sdk-server-1.0.0.jar -
  • -
  • CONFIGURATION_TYPE= JSON_FILE

    - - java -jar qenta-sdk-server-1.0.0.jar - --sdk.json-file-path=path\to\your\json\file\configuration.json - --sdk.configuration-source-type=JSON_FILE - -
  • -
    -
    -
    - -> **Optional** -> -> add: --server.port=custom_port_number +## Installation + +To install the Java SDK, you can use Maven. Add the following dependency to your `pom.xml` file: + +```xml + + com.qenta + qenta-sdk-java + + 1.14 + +``` + +or Gradle: + +```groovy +implementation 'com.qenta:qenta-sdk-java:1.14' +``` + +## Configuration + +To use the SDK, you need to initialize a `QentaClient` instance on your code. + +An instance of `QentaConfigurationProvider` is required to provide the necessary configuration parameters to the `QentaClient`. + +### The configuration provider + +The `QentaConfigurationProvider` interface provides the necessary configuration parameters to the `QentaClient`. You can implement this interface to provide the configuration parameters from environment variable or JSON configuration file. + + + +You can use environment variables to provide the configuration parameters. The following example shows how to use environment variables to provide the configuration parameters.
    + +```java +@Bean +public QentaConfigurationProvider defaultConfigurationProvider() { + return new EnvironmentVariableConfigurationProvider(); +} +``` + +You need to provide the following environment variables: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Environment variableDescription
    ENVIRONMENT_CONFIG_URLThe URL where the SDK will take the configuration from
    QENTA_ENVIRONMENTQenta environment identifier. Allowed values: SANDBOX and PRODUCTION
    QENTA_USER_IDUnique identifier of the user
    QENTA_ORGANIZATION_IDUnique identifier of the organization
    QENTA_ACCESS_TOKENAllow the SDK make request to the REST APIs
    QENTA_PRIVATE_KEYAllows a client side signature of transactions
    + +
    + +You can use a JSON configuration file to provide the configuration parameters. The following example shows how to use a JSON configuration file to provide the configuration parameters. + +```java +@Bean +public QentaConfigurationProvider configurationProvider() { + return new JsonFileConfigurationProvider(Paths.get("src/main/resources/qenta_configuration.json")); + } +``` + + +
    + + +> You can consult the previous topic to get the configuration JSON file from the %prowallet_name%. > -{style="tip"} +{style="note"} + +## Usage + +### Initialize the client + +You can initialize the `QentaClient` instance using the `StandardQentaClient.Builder` class. The following example shows how to initialize the client in a Spring base project, using the `QentaConfigurationProvider` instance. + +```java +@Bean +public QentaClient qentaClient(QentaConfigurationProvider configurationProvider) { + return StandardQentaClient.builder() + .withConfiguration(configurationProvider) + .build(); +} +``` + +Once you have the `QentaClient` instance, you can use it to create orders and interact with the %product_name% API. + +```java +import com.qenta.sdk.QentaClient; +import com.qenta.sdk.model.OrderRequest; +import com.qenta.sdk.model.OrderResponse; + +// ... + +private final QentaClient qentaClient; + +// ... + +OrderRequest orderRequest = new OrderRequest(/* provide order details here */); +OrderResponse orderResponse = qentaClient.createOrder(orderRequest); +// You can now work with the order response +``` -## Qenta Integration Using Windows Batch Scripts - -The following steps are required to install the Qenta SDK server in a Windows Server 2016 computer using two batch -files, one that installs JRE 21 and another one that runs the SDK Server. - - - - -

    Download and Install Java

    - -
  • Open the install.bat file and ensure that the DOWNLOAD_URL points to the correct Java version -
  • -
  • Run the install.bat file as an administrator by right-clicking and selecting Run as administrator. -
  • -
  • The script will download and install Java. Once completed, it will set up the necessary -environment variables.
  • -
    -
    -

    Prepare the Server JAR:

    - -
  • Place your Spring server JAR file (e.g., qenta-sdk-server-1.0.0.jar) and the corresponding - JSON configuration file (e.g., configuration.json) in the same directory as the batch files -
  • -
    -
    - -

    Configure Environment Variables

    - -
  • Navigate to the directory containing the batch files and execute the following commands to -set environment variables if you are going to use
  • -
    -
    - -

    Prepare the Server JAR:

    - -
  • Place your Spring server JAR file (e.g., qenta-sdk-server-1.0.0.jar) and the corresponding - JSON configuration file (e.g., configuration.json) in the same directory as the batch files -
  • -
    -
    - -

    Configure Environment Variables

    - -
  • Open a new command prompt as an administrator
  • -
  • Navigate to the directory containing the batch files and execute the following commands to set environment variables, when using: CONFIGURATION_TYPE=ENVIRONMENT_VARIABLE - - setx ENVIRONMENT_CONFIG_URL https://config-url/dev /M - setx QENTA_ACCESS_TOKEN token /M - setx QENTA_ENVIRONMENT DEVELOPMENT /M - setx QENTA_ORGANIZATION_ID 2648 /M - setx QENTA_PRIVATE_KEY privateKey /M - setx QENTA_USER_ID 6730 /M - -
  • -
  • Close and reopen the command prompt to apply the changes.
  • -
    -
    - -

    Run the Server

    - -
  • Double-check that the JAR file (qenta-sdk-server-1.0.0.jar) and the JSON configuration file -(configuration.json) are in the same directory as the batch files.
  • -
  • Update the execute.bat file depending on your preferred configuration source type - - set CONFIGURATION_TYPE=JSON_FILE - set CONFIGURATION_TYPE=ENVIRONMENT_VARIABLE - -
  • -
  • Run the execute.bat file as an administrator by right-clicking and selecting Run as -administrator
  • -
    -
    -
    \ No newline at end of file +That's it! You've successfully integrated the Qenta Java SDK into your Spring Boot project. You can now create orders and interact with Qenta's services. \ No newline at end of file From 2805d6dd5bab23170ec48769e211af285740e472 Mon Sep 17 00:00:00 2001 From: juandiego Date: Mon, 11 Mar 2024 11:30:07 -0500 Subject: [PATCH 4/5] Doc(!ProxyServer): change proxy-server page to Docker support --- Writerside/p.tree | 2 +- Writerside/topics/{Proxy-Server.md => Docker-Support.md} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Writerside/topics/{Proxy-Server.md => Docker-Support.md} (100%) diff --git a/Writerside/p.tree b/Writerside/p.tree index 3fac00c..5f2650a 100644 --- a/Writerside/p.tree +++ b/Writerside/p.tree @@ -15,6 +15,6 @@
    - +
    \ No newline at end of file diff --git a/Writerside/topics/Proxy-Server.md b/Writerside/topics/Docker-Support.md similarity index 100% rename from Writerside/topics/Proxy-Server.md rename to Writerside/topics/Docker-Support.md From 61bcf6bd3ebc90d8cb8e508f3d17c6ee1cbc300a Mon Sep 17 00:00:00 2001 From: juandiego Date: Mon, 11 Mar 2024 14:14:58 -0500 Subject: [PATCH 5/5] Doc(Docker-Support): update java-sdk and docker-support documentation --- Writerside/topics/Docker-Support.md | 127 ++++++++++------------------ Writerside/topics/Java-SDK.md | 6 +- Writerside/v.list | 2 + 3 files changed, 52 insertions(+), 83 deletions(-) diff --git a/Writerside/topics/Docker-Support.md b/Writerside/topics/Docker-Support.md index a895bca..b73e071 100644 --- a/Writerside/topics/Docker-Support.md +++ b/Writerside/topics/Docker-Support.md @@ -1,8 +1,7 @@ # Docker support -**%product_name%** for non-Java based application, it possible to run a lightweight proxy server that exposes all SDK methods as -a -RESTful API with JSON payloads to use SDK methods using a standard HTTP connection. +**%product_name%** for non-Java based application, it possible to run a lightweight server that exposes all SDK methods as +a RESTful API with JSON payloads to use SDK methods using a standard HTTP connection. ```plantuml @startuml @@ -35,93 +34,61 @@ SDK .right.> [API Gateway] ``` -## Qenta SDK Server Manual Integration - - -## Deploying Qenta Proxy server with Docker on Windows Server 2016 - -> **BEFORE YOU START** -> -> Make sure you have Docker Installed. -> -{style="warning"} - - - -

    Pull the Docker image

    - -
  • Execute the following command:

    - docker pull public.ecr.aws/f5d3l7y2/qenta-sdk-server:<image_tag>\ -
  • -
  • Use the following command to tag the image in Docker:

    - docker tag public.ecr.aws/f5d3l7y2/qenta-sdk-server:<image_tag>\ qenta-sdk-server:latest -
  • -
    - - -
    - -

    Run the container:

    - - docker run -d -p 8080:8081 - -e SDK_CONFIGURATION_SOURCE_TYPE=ENVIRONMENT_VARIABLE \ - -e ENVIRONMENT_CONFIG_URL=https://hxklzo87t9.execute-api.us-east2.amazonaws.com/config/development \ - -e QENTA_ACCESS_TOKEN= <your_access_token>\ - -e QENTA_ENVIRONMENT=dev \ - -e QENTA_ORGANIZATION_ID= <your_organization_id>\ - -e QENTA_PRIVATE_KEY= <your_private_key>\ - -e QENTA_USER_ID= <your_user_id>\ - qenta-sdk-server:latest - -
    +## Running the docker image + + + + +Before to start +

    Make sure you have a docker based runtime installed in your environment.

    +
    + +Pull the docker image from the Qenta repository. + +docker pull %sdk_docker_image_uri%:%sdk_docker_image_tag% + + + +Optional: If you want to use a shorter name for the image, you can tag it with a different name. + +docker tag %sdk_docker_image_uri%:%sdk_docker_image_tag% qenta-sdk-server:latest + + + +Once you have the image, you can run the server with the following command. + +docker run -d -p 8080:8081 -e SDK_CONFIGURATION_SOURCE_TYPE=ENVIRONMENT_VARIABLE \ +-e ENVIRONMENT_CONFIG_URL=https://hxklzo87t9.execute-api.us-east2.amazonaws.com/config/development \ +-e QENTA_ACCESS_TOKEN= your_access_token\ +-e QENTA_ENVIRONMENT=SANDBOX \ +-e QENTA_ORGANIZATION_ID= your_organization_id\ +-e QENTA_PRIVATE_KEY= your_private_key\ +-e QENTA_USER_ID= your_user_id\ +qenta-sdk-server:latest + + + +You can consult the SDK and Tools topic to get the configuration values from the %prowallet_name%. +
    -## Access the server +## Using the server -To verify the server is up and running, In the address bar, enter the URL where the Spring server is configured to run. -If not specified in your configuration, a common default URL is: +To verify the server is running, you can perform a `GET` request to the server at port `8080` or the port you have configured set in the running command. -http://localhost:8080/swagger-ui.html - -Make sure to set the correct port number in case you used the --server.port=custom_port_number or docker run in -a different port. - - -## Confirming Server Availability - -If the server is running and accessible, Swagger UI will load, displaying a user-friendly interface for exploring and -testing your API endpoints. -Navigate through the available API documentation to understand the available endpoints, request/response -formats, and any additional information provided. - -![Swagger](swagger.png){ style="block" thumbnail="true"} - -## Test the server +```shell +curl --location --request GET "http://localhost:8080/v3/api-docs" +``` -You can use curl to test the `REST API` endpoints of your Proxy Server. Here's an example using the provided curl -command: +Once you verified the server is running, you can use the SDK methods using a standard HTTP connection. +Following is an example of how to create an order using the server. -```bash +```shell curl --location --request POST "http://localhost:8080/qenta-sdk/orders" ^ --header "Content-Type: application/json" ^ --header "Accept: */*" ^ --header "Host: localhost:8080" ^ --header "Connection: keep-alive" ^ --data-raw "{ \"currency\" : \"EUR\", \"fiatAmount\" : 120.0, \"accountId\" : \"3213\"}" -``` - -

    This curl command performs a POST request to the specified URL (http://localhost:8080/qenta-sdk/orders) with a -JSON payload

    - - - - After executing the curl command, you should receive an HTTP response. A successful request returns a 200 OK -status. - - -

    Below is an example screenshot from a REST client showing a successful 200 OK HTTP response after executing the - curl command.

    -
    -
    - +``` \ No newline at end of file diff --git a/Writerside/topics/Java-SDK.md b/Writerside/topics/Java-SDK.md index 851a5e1..22e84a3 100644 --- a/Writerside/topics/Java-SDK.md +++ b/Writerside/topics/Java-SDK.md @@ -97,9 +97,9 @@ public QentaConfigurationProvider configurationProvider() { -> You can consult the previous topic to get the configuration JSON file from the %prowallet_name%. -> -{style="note"} + +You can consult the previous topic to get the configuration JSON file from the %prowallet_name%. + ## Usage diff --git a/Writerside/v.list b/Writerside/v.list index a2fbe10..a671403 100644 --- a/Writerside/v.list +++ b/Writerside/v.list @@ -10,4 +10,6 @@ + +