Coder Social home page Coder Social logo

payment-gateway's Introduction

Getting Started

Prerequisites

  • NodeJS
  • Midtrans Account

Installation

  • Clone this repository
  • Navigate to the cloned repository, open terminal and run npm install
  • Open your browser and login to your Midtrans account and look for your Client Key and Server Key in the Settings > Access Keys menu
  • Create a .env file in the cloned repository with the variable CLIENTKEY=[Your Client Key] and SERVERKEY=[Your Server Key] (Recommended to use the Sandbox Environment Keys)
  • Navigate to the cloned repository's public/html and enter your Client Key at the #midtrans-script's data-client-key

How to Run the Server

  • Navigate to the cloned repository, open terminal and run npm start
  • Open your browser and go to address localhost:8000
  • You should see the payment gateway page

What it Can Do

Credit Card Payment

By entering credit card information and the amount you need to pay, you can process (dummy) credit card payments. Must first press the "Confirm Card Data" Button before the "Process Transaction" button to get a successful transaction. Note that as of writing this, the app is not connected to a database thus causing the need to change the value of parameter.transaction_details.order_id in server.js every time you want to submit a payment (The same applies to the other payments too)

Virtual Account Payment

By picking one of the available banks and the amount you need to pay, you can generate a virtual account number where you must transfer the money to complete your transaction

E-Wallet (Gopay) Payment

By entering the amount you need to pay, you can generate a QR Code that you can scan to process the transaction using GoPay

Rooms for Improvement

  • Actually using a frontend framework such as React instead of raw HTML
  • Connecting the app to a database to record transactions and keep track of the transaction ids (and removing the need of changing order_id every time)
  • Validating and formatting of the input fields with something like AJAX, etc
  • Use routers so backend app is less cluttery and easier to manage

payment-gateway's People

Contributors

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