Giter Site home page Giter Site logo

payment-service-1's Introduction

Payment Service

This service handles payment registration, processing and puhing notification back to originator system.

It's using Omnipay on top making service configurable with multiple vendors of gateways interacting with unified API.

Service is exposed via REST API and broacasting notification events on queue sytems using Enqueue.

Flow

  1. Payment is Registered first by originator system specifying: amount, currency, description, payment type (transfer).

    Originator system calls POST /api/payment

    Payment service returns paymentId and processing url to redirect user to process payment.

  2. Payment is Processed by gateway.

    User is redirected to processing url.

    Payment Service redirects user to vendor gateway where user does the payment.

    After that user is redirected back to originator service where waits payment to be completed.

  3. Once vendor gateway received the payment and calling back Payment Service, event is broadcast over messaging system and originator system can mark paymentId as completed.

Assumptions

  • Payment Service is responsible for doing payments using gateway vendors and do a notification after payment completion or failure.
  • Payment Service have no knowledge about content of the client's order for that payment is beeing done. Thus originator system need to store that information and correlate with paymentId. After payment is completed originator system completed order it ships or activates products.

Supportability

Manual interventions

Marking payment as completed success or failed

This manual intervention simulates callback from vendor gateway. Marks payment being IN_PROCESS state as COMPLETED if completion of payment couldn't be achieved. It also sends notification back to source systems.

bin/console app:payment:complete:success PAYMENT_ID -a AUTHOR -m INTERVENTION_REASON

To mark completion as failed use:

bin/console app:payment:complete:failure PAYMENT_ID -a AUTHOR -m INTERVENTION_REASON
Sending notification about payment completion

This manual intervention resents notification to source systems about completion of the payment. Payment needs to be in completed status. It's useful when payment has been completed, however sending notification failed.

bin/console app:payment:complete:success:notification PAYMENT_ID

To mark completion as failed use:

bin/console app:payment:complete:failure:notification PAYMENT_ID

Development

To setup development environment, run Docker Compose:

make
make start

Build and publish

./bin/build.sh
./bin/publish.sh

payment-service-1's People

Contributors

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