Giter VIP home page Giter VIP logo

gateway-java-sample-code's Introduction

Gateway Java Sample Code

This is a sample application to help developers start building Java applications using the Gateway Java SDK.

Prerequisites

  1. Java 8
  2. Maven
  3. Registered account with MPGS Gateway system

Authentication

  1. You can authenticate in one of two ways:
  • Using your API key and password (available from the merchant portal). To do this, see instructions below. The following fields are required for password authentication: merchant ID, API password, currency, and gateway base URL.
  • Using a certificate, which can be downloaded from the merchant portal. To do this, see instructions here.

Steps for running locally

  1. Download code

  2. Run mvn clean install

  3. Set the environment variables

    • On Mac/Linux: Use the export command:

        prompt> export GATEWAY_MERCHANT_ID=YOUR_MERCHANT_ID
        prompt> export GATEWAY_API_PASSWORD=YOUR_API_PASSWORD
        prompt> export GATEWAY_BASE_URL=YOUR_GATEWAY_BASE_URL
        prompt> export GATEWAY_CURRENCY=YOUR_CURRENCY (optional - default is USD)
        prompt> export GATEWAY_VERSION=YOUR_VERSION (optional - default is version 45)
      
    • On Windows, use the set command:

        prompt> set GATEWAY_MERCHANT_ID=YOUR_MERCHANT_ID
        prompt> set GATEWAY_API_PASSWORD=YOUR_API_PASSWORD
        prompt> set GATEWAY_BASE_URL=YOUR_GATEWAY_BASE_URL
        prompt> set GATEWAY_CURRENCY=YOUR_CURRENCY (optional - default is USD)
        prompt> set GATEWAY_VERSION=YOUR_VERSION (optional - default is version 45)
      
  4. Run the following:

     java -jar dist/gateway-java-sample-code-1.1.0.jar
    
  5. Navigate to http://localhost:5000 to test locally

Proxy Configuration

If you are behind a proxy you need to add a couple of flags before running the .jar (in Step 4)

java -Dhttp.proxyHost=YOUR_PROXY_URL -Dhttp.proxyPort=YOUR_PROXY_PORT -jar dist/gateway-java-sample-code-1.0.jar

Disclaimer

This software is intended for TEST/REFERENCE purposes ONLY and is not intended to be used in a production environment.

gateway-java-sample-code's People

Contributors

siddii avatar jorsh avatar rishichowdarypentyala avatar ellenchristine avatar miriammc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.