Git Product home page Git Product logo

paymentlcmule's Introduction

paymentlcmule

Payment LCM POC built on Anypoint Platform

Beware!! This wasn't meant for production use !!!

Prerequisites

  1. OpenJDK 11
  2. Maven
  3. Anypoint Studio. Grab it from here
  4. Docker

Running the Project

  1. Clone this project
  2. Running the database and Payment dummy services by executing docker-compose file.
cd <project directory>
docker-compose up
  1. Open the project using Anypoint Studio
  2. Run Mule runtime from within Anypoint Studio

Test the Endpoint

curl -X POST -H 'Content-Type: application/json' -d '{"merchant_id": <merchant_id>, "customer_id": <customer_id>, "payment_amount": <amount>, "currency_code": <currency_code>}' http://localhost:9000/payments
  1. You can get the merchant_id from the database. E.g.: 8282c796-19c7-11ec-83c1-0242ac110003
  2. For customer_id you can enter one of these following :
    • 001
    • 002
    • 003
    • 004
  3. And you can use any arbitrary value for the remaining.

E.g. :

curl -X POST -H 'Content-Type: application/json' -d '{"merchant_id": "8282c796-19c7-11ec-83c1-0242ac110003", "customer_id": "001", "payment_amount": 5000, "currency_code": "USD"}' http://localhost:9000/payments

You'll end up with getting one of these following responses:

{
  "id": "3szDVisyrR1byovXHziT5Ejsac8PMX46M",
  "transaction_id": "400a317e-1e87-4e17-a999-6a0638d38d8e",
  "transaction_code": "3h4AwAre1hts6n3oZMN4aHwSAmNY1",
  "transaction_type": "deposit",
  "payment_provider": "Lulupay",
  "customer_id": "001",
  "customer_name": "Yauri",
  "payment_amount": "5000",
  "currency_code": "001",
  "status": "success",
  "created_at": "Sun Oct 03 11:45:48 WIT 2021"
}

OR

{
  "statusCode": "400",
  "message": "Cannot proceed payment for Customer Rodtang",
  "reason": "Inactive Customer"
}

OR

{
  "statusCode": "400",
  "message": "Cannot proceed payment for Customer David",
  "reason": "Insufficient Balance"
}

paymentlcmule's People

Contributors

yauritux avatar

Watchers

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