payment-reconciler

command module
v0.0.0-...-84b52ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 5 Imported by: 0

README

payment-reconciler

A lambda to reconcile payments. This service collates data from a payment reconciliation database and writes it to CSV's on an SFTP server.

The Lambda function

This API runs on AWS Lambda. Release and deployment of the lambda is similar to that of other trunk based services. After performing relevant unit tests, a github release task is run and the zip is uploaded to the S3 release bucket. Terraform is then run to deploy the new version.

Terraform deployment

All dependent AWS resources are provisioned by Terraform and deployed from a concourse pipeline. Click "plan" then "apply" jobs with desired environment to deploy the lambda. The pipeline is capable of deploying everything so manual deployment should not be necessary. For instructions on Terraform provisioning, see here.

Environment Variables

Environment variables required to execute the lambda:

Name Description Examples
MONGODB_PAYMENT_REC_TRANSACTIONS_COLLECTION The name of the collection within the payment reconciliation database from which to fetch transactions data.
MONGODB_PAYMENT_REC_PRODUCTS_COLLECTION The name of the collection within the payment reconciliation database from which to fetch products data.
MONGODB_PAYMENT_REC_DATABASE The name of the payment reconciliation database.
MONGODB_URL The Mongo database URL. mongodb://<mongo_host>:27017
SFTP_SERVER The SFTP server host name.
SFTP_PORT The port over which to connect to the SFTP server. 22
SFTP_USERNAME The username of the SFTP server credentials.
SFTP_PASSWORD The password of the SFTP server credentials.
SFTP_FILE_PATH The file path, relative to the root of the SFTP server, to which to upload CSV files. uploadPath (will result is CV's uploaded to directory: ~/uploadPath)
Testing

This Lambda can be executed manually by submitting a Test Event in AWS. The date of the required file can be specified with the Event JSON, for example: {"reconciliation_date" : "2022-10-14"}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package dao is a generated GoMock package.
Package dao is a generated GoMock package.
Code generated by MockGen.
Code generated by MockGen.
Package service is a generated GoMock package.
Package service is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL