Code Monkey home page Code Monkey logo

golang-credit-card's Introduction

Golang-credit-card

It validates credit card details, display credit card types and reduces human error using the Luhn algorithm with REST APIs.

MIT License Go Doc Go Report Card

Basic credit card validation using the Luhn algorithm

Currently identifies the following credit card companies:

  • American Express
  • MasterCard
  • Visa
  • Visa Electron

Installation

$ git clone [email protected]:bitcyber/golang-credit-card.git

OR

$ go get github.com/bitcyber/golang-credit-card

Downloads

Download all go-gettable dependencies for your project.

$ go get -d ./... 

Quick Start

Run this command on Terminal after installation

$ go run main.go

Once the application is running, navigate to http://localhost:3000 in your browser. If all went well, you should see level 1 header text Welcome to the Credit Card Validation displayed.

REST API: Show Credit Card Validation

Returns json data about a single credit card.

  • URL

    http://localhost:3000/card-scheme/verify/:cardNumber
  • Method:

    GET

  • URL Params

    Required:

    cardNumber=[integer]

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: { "success" : "true", "valid": "true", "scheme": "AMEX/VISA/MASTERCARD" }

      OR

    • Code: 200
      Content: { "INVALID CARD NUMBER" }

  • Error Response:

    • Code: 404 NOT FOUND
      Content: { 404 page not found }
  • Sample Request:

    http://localhost:3000/card-scheme/verify/373473833566829
  • Sample Response:

      {
      "success": "true",
      "valid": "true",
      "scheme": "AMEX"
      }

Contributing ✨

Any help and suggestions are very welcome and appreciated.

golang-credit-card's People

Stargazers

 avatar Amit Kumar avatar

Watchers

James Cloos avatar Ritvik Roy 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.