Categorygithub.com/SharkFourSix/go-transact
modulepackage
1.1.1
Repository: https://github.com/sharkfoursix/go-transact.git
Documentation: pkg.go.dev

# README

go-transact

Turn bank transaction notifications into action.

How it works


  1. You receive money in your bank account.
  2. Your institution sends a notification to your email address with transaction details. Importantly, the transaction has a description field which contains a unique string (let's call it a vendor reference id)
  3. Your email provider redirects the email to go-transact
  4. go-transact extracts transaction information from the email
  5. go-transact POSTS the transaction details to a callback url of your choosing

Use cases


  • Can be used in environments where payment API services are non-existent or hard to acquire to automate service offerings and subscriptions upon receipt of payment.
  • etc 👀

Data storage


A database (SQLite) file will be created in the current working directory to store the following:

  • Received emails (unmatched emails are treated as spam)
  • Callback status and data

Jump to setup

Building


The provided Makefile contains the necessary commans to build.

  • To build a stripped down version: make build
  • To clean without cleaning build and test cache: make clean
  • To clean everything: make clean-all

Usage


Requirements

  1. Have an account at a bank that allows specifying a description when sending money.
  2. Have the account receive email notifications upon receipt of credit transactions.
  3. Email provider must be able to redirect emails.
  4. Have a server to run go-transact on.

Setup

  1. In your mail client, note your bank's email address and create a rule to redirect credit transaction emails to where go-transact will be running, i.e, [email protected]. I recommend using unguessable generated mailbox names such as openssl rand -hex 24
  2. In your config.yaml, configure the regex patterns that will be used to extract transaction information from the mail.
  3. Run go-transact (prefereably as a service)
  4. (Optional but recommended) Setup firewall rules to only allow connections from mail service provider servers on port 25

To start daemon

./go-transact --config-file myconfig.yaml

To show usage

./go-transact --help

Security considerations


This program will only process emails from configured mailbox addresses to block uninvited visitors.

To prevent unwanted emails, you can setup firewall rules to only allow incoming connections from your mail provider.

The following example would only allow Outlook SMTP server to connect on port 25

iptables -A INPUT -s 40.92.18.77 -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j DROP

Changelog


v1.1.1 | 2022-05-08

v1.1.0 | 2022-05-08

  • Automatic cleaning of amount values.

v1.0.6 | 2022-05-08

  • Improvements

v1.0.5 | 2022-05-08

  • Improvements

v1.0.4 | 2022-05-08

  • Workflow improvements

v1.0.3 | 2022-05-08

  • Workflow improvements

v1.0.2 | 2022-05-08

  • Fix workflow write permissions

v1.0.1 | 2022-05-08

  • Small improvements

v1.0.0 | 2022-05-08

  • Initial release

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author