Giter Club home page Giter Club logo

upaygo's Introduction

Go Tests Code scanning - action

Run in Postman

uPay in Golang

Payment Gateway Microservice in Golang

PSD2 SCA

EU SCA law will be on duty after 14th September 2019

Updates

Feature

  • SCA ready with Stripe Payment Intents
    • Off-session intents
    • Separation of auth and capture
      • New intent
      • Confirm intent
      • Capture/Delete intent
  • No database infrastructure needed
  • Stripe API keys configuration per currency

Installation

cp config.json.dist config.json
vi config.json # Add your config values

# API doc
swag init

# If you want to contribute
cp .github/hooks/pre-commit .git/hooks/pre-commit
# Open and change absolute config path

go run main.go -config=config.json

How to use

Example of a checkout web page

  1. User to insert card information with Stripe Elements
  2. Create an intent with JS SDK
  3. Confirm the intent
  4. Does the intent requires 3D Secure (intent status and next_action param)
    1. No, Point 5)
    2. Yes, Stripe Elements will open the a 3D Secure popup
  5. Do you after checkout domain logic
  6. Any error during your checkout process?
    1. Yes, cancel the intent
    2. No, capture the intent

Tests

go test ./... -failfast -tags=unit
go test ./... -failfast -tags=stripe -config=ABS_PATH/config.json

APIs

  • Swagger /swagger/index.html

TODO

See projects section

upaygo's People

Contributors

dependabot[bot] avatar lelledaniele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

upaygo's Issues

Swagger does not support models with interface type

Swagger does not support models with interface type.
This cause a lack in the documentation Swagger page /swagger/index.html.

Screenshot from 2019-08-15 14-18-21

lelle@lelle-pop:~/projects/github.com/lelledaniele/upaygo$ swag init
2019/08/15 14:16:02 Generate swagger docs....
2019/08/15 14:16:02 Generate general API Info, search dir:./
2019/08/15 14:16:02 Generating apprest.RESTError
2019/08/15 14:16:02 Generating paymentintent.Intent
2019/08/15 14:16:02 Type definition of type '*ast.InterfaceType' is not supported yet. Using 'object' instead.
2019/08/15 14:16:02 create docs.go at  docs/docs.go
2019/08/15 14:16:02 create swagger.json at  docs/swagger.json
2019/08/15 14:16:02 create swagger.yaml at  docs/swagger.yaml

Config pkg needs a permanent file config.json for go test

Config pkg uses a init function to process the config.json. This is a huge help for the microservice because it reads the file once at the program starts.

However, I cannot run go test if I do not include a fake config.json file for the init function.
I could not find a way to create it dynamically before the execution of the tests as the init function has a higher priority.

Looking for solutions...

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.