Code Monkey home page Code Monkey logo

nexio-assessment's Introduction

Nexio Express Payment App

This is a simple Express app that allows users to process payments and fetch transactions using Nexio's APIs. The app is built using Node.js and the Express framework.

Features

  1. An endpoint to process a card payment through Nexio's processing API.
  2. An endpoint to fetch transactions from Nexio's transactions API.

Prerequisites

Before you begin, make sure you have the following installed:

  • Node.js (version 14.x or higher)
  • npm (version 6.x or higher)

Installation

  1. Clone the repository:
git clone https://github.com/adirksen/Nexio-Assessment.git
  1. Change to the project directory:
cd Nexio-Assessment
  1. Install the required dependencies:
npm install
  1. Create a .env file in the project root directory, and add the following environment variables:
NEXIO_API_USER=your_nexio_user
NEXIO_API_KEY=your_nexio_api_key
NEXIO_API_BASE_URL=https://api.nexiopaysandbox.com
PORT=3000

replace your_nexio_api_key with your actual Nexio API key. replace your_nexio_user with your actual Nexio API user identifier.

Usage

  1. Start the server:
node app.js

The server will be running at http://localhost:3000.

  1. Use the following endpoints:
  • Process a payment:

    POST http://localhost:3000/api/payment
    

    Request body example:

    {
        "amount": 10,
        "currency": "USD",
        "expirationMonth": "12",
        "expirationYear": "28",
        "cardType": "amex",
        "cardHolderName": "John H Doe",
        "securityCode": "927", 
        "cardNumber": "4111111111111111"
    }
    
  • Fetch transactions (Example):

        GET http://localhost:3000/api/transactions?startDate=2023-01-01&endDate=2023-12-31
    

nexio-assessment's People

Contributors

adirksen avatar

Watchers

 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.