Code Monkey home page Code Monkey logo

pagarme-psp-test's Introduction

Transaction Processing Service

The Transaction Processing Service is a backend application built with Nest.js and TypeScript. It allows you to process transactions, create payables, and provides a means for clients to check their balances.

Requirements

The service is designed to meet the following requirements:

  1. Transaction Processing:

    • Receive transaction information, including the transaction value, description, payment method (debit_card or credit_card), card details, and cardholder information.
    • Return a list of created transactions, displaying only the last 4 digits of the card number for security.
  2. Payables Creation:

    • For debit card transactions:
      • Create payables with a status of "paid" indicating that the client has received the amount.
      • Set the payment date (payment_date) as the transaction creation date (D+0).
    • For credit card transactions:
      • Create payables with a status of "waiting_funds" indicating that the client will receive the money in the future.
      • Set the payment date (payment_date) as the transaction creation date + 30 days (D+30).
    • Deduct a processing fee (fee) from the transaction amount:
      • 3% fee for debit card transactions.
      • 5% fee for credit card transactions.
  3. Balance Inquiry:

    • Provide a method for clients to check their balance, displaying:
      • Available balance (disponível): The total amount received (payables with status "paid").
      • Waiting funds (a receber): The total amount yet to be received (payables with status "waiting_funds").

Technologies Used

  • Nest.js
  • TypeScript
  • Prisma
  • MongoDB
  • MongoDB Atlas

Getting Started

To run the service locally, follow these steps:

  1. Clone the repository to your local machine.

  2. Install the project dependencies:

    npm install
    
  3. Start the application:

    npm run start

  4. The service will be accessible at http://localhost:3000.

pagarme-psp-test's People

Contributors

ruannjs avatar

Stargazers

 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.