# Build an end-to-end application source: https://developer.mastercard.com/mastercard-processing-debit/documentation/tutorials-and-guides/build-end-to-end-app-tutorial/index.md This tutorial helps you to create a simple Java application that makes an API call to the Mastercard Processing API in the Sandbox environment. **What you will learn** * How to set up the environment to develop a simple Java application * How to perform [payload encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/) * How to make an API call Note: The tutorial does not cover an additional level of encryption or decryption of the PIN block. For more information, refer to [PIN Block Formation and Encryption Process](https://developer.mastercard.com/mastercard-processing-debit/documentation/tutorials-and-guides/build-end-to-end-app-tutorial/index.md) tutorials. ## Step 1 - Set up the environment {#step-1---set-up-the-environment} ### 1. Pre-requisites {#1-pre-requisites} To complete this tutorial, you will need: * [JDK 1.8.0](https://www.java.com/en/) or later * [Maven 3.6](https://maven.apache.org/) or later * [IntelliJ IDEA](https://www.jetbrains.com/idea/) (or any other IDE of your choice) * Mastercard Developers account with access to the Mastercard Processing Core APIs ### 2. Create a Maven project {#2-create-a-maven-project} For this tutorial, IntelliJ IDEA is used as the IDE. In IntelliJ IDEA, create a new Maven project that automatically sets your directory structure. Provide an ArtifactId and a project name as per your choice. ![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/create-a-maven-project.png) ### 3. Add resources {#3-add-resources} Add the Mastercard Processing Core API specification to your Maven project folder. For API description, refer to the API Reference. Add the generated Sandbox signing key (`.p12` file), payload decryption key (`.p12` file), and payload encryption cert (`.pem` file) to your Maven project resources folder. Those files are generated by creating a Sandbox project in the Mastercard Developers. Keeping a separate resource folder for these files is suggested. Your Maven project directory structure should appear as follows: ![](https://static.developer.mastercard.com/content/mastercard-processing-debit/uploads/add-resources1.png) Note: This tutorial uses the specification for Mastercard Processing Core API, but you can easily adapt it to use any API specification file. ### 4. Update pom.xml file {#4-update-pomxml-file} In your IDE, add the [OpenAPI Generator maven plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin) to your project pom.xml file. Use the Plugin config as shown here: Note: [OpenAPI Generator](https://openapi-generator.tech/) generates API client libraries using OpenAPI Specification. It provides multiple generators and library templates to support multiple languages and frameworks. We will use the Java generator for this project. ```XML org.openapitools openapi-generator-maven-plugin 6.3.0 generate ${project.basedir}/src/main/resources/mastercard-processing-core-api-swagger.yaml java okhttp-gson false false com.mastercard.mpe.generated.apis com.mastercard.mpe.generated.models com.mastercard.mpe.generated.invokers src/gen/main/java java8 org.apache.maven.plugins maven-compiler-plugin 3.11.0 1.8 1.8 ``` Add the following dependencies to your pom.xml file to add dependencies for the API client library generation and the Mastercard OAuth1 Signer library. Note: Mastercard offers Oauth1 Signer Libraries, which offer code helpers targeting the HTTP clients used by the different OpenAPI Generator Library templates. The libraries are hosted on [GitHub](https://github.com/Mastercard?utf8=%E2%9C%93&q=client-encryption&type=&language=). Mastercard offers Client Encryption Libraries, which offer code helpers for payload encryption. The libraries are hosted on [GitHub](https://github.com/Mastercard?utf8=%E2%9C%93&q=client-encryption&type=&language=). ```XML org.openapitools openapi-generator-cli 6.6.0 io.swagger.core.v3 swagger-annotations 2.2.14 io.swagger.parser.v3 swagger-parser 2.1.16 com.squareup.okhttp3 okhttp 4.11.0 com.squareup.okhttp3 logging-interceptor 4.11.0 com.google.code.gson gson 2.10.1 io.gsonfire gson-fire 1.8.5 javax.annotation javax.annotation-api 1.3.2 javax.ws.rs javax.ws.rs-api 2.1.1