Skip to content

This repository implements a mock payment gateway in Go, simulating transaction processing without connecting to real financial institutions. It supports various transaction types, including charges, refunds, and voids. This project serves as a demonstration of payment processing concepts and software architecture.

Notifications You must be signed in to change notification settings

gbburleigh/quick-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Gateway

Quick Gateway is a simple gateway for processing payments. It is designed to be easy to use and integrate with existing systems.

Getting Started

Installation

go get github.com/gbburleigh/quick-gateway

API

quick-gateway relies on a client-gateway-processor architecture. Transactions are created at the client level, to emulate a POS system such as a terminal. The client is responsible for creating the transaction and sending it to the gateway. The gateway is responsible for processing the transaction, normalizing and logging it as necessary, and sending it to the processor. The processor is responsible for processing the transaction and returning the result to the gateway. Most processors use proprietary APIs and require subscriptions to integrate with them, so quick-gateway is designed with a simple mock processor that simulates these services for us.

Usage

Create a Client

client := client.NewClient("terminal_id", "secret_key", "environment", "gateway_id")

// TODO: Hook into POS to read transaction data and trigger client to create transaction
const transaction_data = <Read from POS, API, etc>

const Transaction = client.CreateTransaction(
    transaction_data.Type,
    transaction_data.Amount,
    transaction_data.CardPresent,
    transaction_data.ACH,
    transaction_data.Method,
)

client.SendTransaction(Transaction)

Receive a Transaction

const Transaction = <Transaction from Client>

const Gateway = gateway.NewGateway(client)

Gateway.HandleTransaction(Transaction)

About

This repository implements a mock payment gateway in Go, simulating transaction processing without connecting to real financial institutions. It supports various transaction types, including charges, refunds, and voids. This project serves as a demonstration of payment processing concepts and software architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages