payments.api.ch.gov.uk

command module
v1.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 6 Imported by: 0

README

Companies House Payments API

GoDoc Go Report Card

The Companies House API for handling payments.

Requirements

In order to run this API locally you will need to install the following:

Getting Started

  1. Clone this repository: go get github.com/companieshouse/payments.api.ch.gov.uk
  2. Build the executable: make build

Configuration

Variable Default Description
BIND_ADDR Payments API Port
MONGODB_URL MongoDB URL
MONGODB_DATABASE payments MongoDB database name
MONGODB_COLLECTION payments MongoDB collection name
DOMAIN_WHITELIST List of valid domains for the Resource URL
PAYMENTS_WEB_URL URL for the Payments Web service
PAYMENTS_API_URL URL for the Payments API
GOV_PAY_URL URL for GOV.UK Pay
GOV_PAY_BEARER_TOKEN Bearer Token for GOV.UK Pay
EXPIRY_TIME_IN_MINUTES Number of minutes before a payment session expires
KAFKA_BROKER_ADDR Kafka Broker address
SCHEMA_REGISTRY_URL Schema Registry URL

Endpoints

Method Path Description
GET /healthcheck Checks the health of the service
POST /payments Create Payment Session
GET /payments/{payment_id} Get Payment Session
PATCH /private/payments/{payment_id} Patch Payment Session
POST /private/payments/{payment_id}/external-journey Returns URL for external Payment Provider
GET /callback/payments/govpay/{payment_id} GOV.UK Pay callback

The Create Payment Session POST endpoint receives a body in the following format:

{
    "redirect_uri": "string",
    "reference": "string",
    "resource": "string",
    "state": "string"
}

and returns a Payment Resource in the response:

{
    "amount": "string",
    "available_payment_methods": [
        "string"
    ],
    "completed_at": "date-time",
    "created_at": "date-time",
    "created_by": {
        "email": "string",
        "forename": "string",
        "id": "string",
        "surname": "string"
    },
    "description": "string",
    "links": {
        "journey": "string",
        "resource": "string",
        "self": "string"
    },
    "payment_method": "string",
    "reference": "string",
    "status": "string"
}

External Payment Providers

The only external payment provider currently supported is GOV.UK Pay.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package config defines the environment variable and command-line flags supported by this service and includes default values for particular fields.
Package config defines the environment variable and command-line flags supported by this service and includes default values for particular fields.
Package dao provides access to the database.
Package dao provides access to the database.
Package handlers contains the http handlers which receive requests to be processed by the API.
Package handlers contains the http handlers which receive requests to be processed by the API.
Package helpers contains helper functions.
Package helpers contains helper functions.
Package interceptors contains interceptors which make checks before a request reaches the handler.
Package interceptors contains interceptors which make checks before a request reaches the handler.
Package models contains the required data structures.
Package models contains the required data structures.
Package service contains the controllers used by the the API endpoints.
Package service contains the controllers used by the the API endpoints.
Package transformers contains the transformation functions between the REST and DB models.
Package transformers contains the transformation functions between the REST and DB models.

Jump to

Keyboard shortcuts

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