Coder Social home page Coder Social logo

paymentgateway-standalone's Introduction

paymentgateway-standalone

Instructions

The Payment Gateway is a sample Rest application created in Spring Boot, to demonstrate calling a REST api. The concept is that when a customer wishes to make a purchase on one of your company's websites, the purchase request gets sent via REST to the payment gateway server.

The normal use case is:

Client sends a POST request to http://localhost:8080/api/payment to request a new payment is attempted The server responds to this request with a unique transaction ID The client sends a GET request to http://localhost:8080/api/payment/{transactionId} The server responds with the status of the payment request In addition clients can: Send a GET request to http://localhost:8080/api/payment to get a list of all payments attempted Send a PUT request to http://localhost:8080/api/payment/{transactionId} to refund a payment Clients must include a header containing a 3 letter code for the requesting system. Valid codes are BRL, RJK and MTY. You can only do a GET for a payment request with a matching requesting system code.

This page can be used to generate a rest request, and it will send it to the server. The equivalent CURL command will also be provided.

How to run this project

  • copy the file getpaymentgateway.bat to your computer - save it in the workspace folder e.g. W:\workspace
  • Open a command prompt
  • navigate to the workspace folder, type "getpaymentgateway" and press enter
  • Fetch the dependencies defined in the POM.XML file and run the application

Alternatively to run it from the command line:

  • Create a clone of the repository
  • Review application.properties - the connection to a MySQL server needs to be set
  • Ensure you have created an empty database on the mysql server with a name matching that in application.properties.
  • run the command: "mvnw clean compile package" to build the jar file
  • execute the jar file with "java -jar target/paymentgateway-1.3.jar"

Once the file is up and running, open the paymentgatewayclient.html file in a browser to test the Rest API.

paymentgateway-standalone's People

Contributors

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