Socket
Socket
Sign inDemoInstall

github.com/companieshouse/payments.api.ch.gov.uk

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/companieshouse/payments.api.ch.gov.uk


Version published

Readme

Source

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

VariableDefaultDescription
BIND_ADDRPayments API Port
MONGODB_URLMongoDB URL
MONGODB_DATABASEpaymentsMongoDB database name
MONGODB_COLLECTIONpaymentsMongoDB collection name
DOMAIN_WHITELISTList of valid domains for the Resource URL
PAYMENTS_WEB_URLURL for the Payments Web service
PAYMENTS_API_URLURL for the Payments API
GOV_PAY_URLURL for GOV.UK Pay
GOV_PAY_BEARER_TOKENBearer Token for GOV.UK Pay
EXPIRY_TIME_IN_MINUTESNumber of minutes before a payment session expires
KAFKA_BROKER_ADDRKafka Broker address
SCHEMA_REGISTRY_URLSchema Registry URL

Endpoints

MethodPathDescription
GET/healthcheckChecks the health of the service
POST/paymentsCreate Payment Session
GET/payments/{payment_id}Get Payment Session
PATCH/private/payments/{payment_id}Patch Payment Session
POST/private/payments/{payment_id}/external-journeyReturns 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.

FAQs

Last updated on 19 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc