Payment Service

Payment service interfaces with Stripe and is backed by a database (payment_service) containing two tables:

  • subscriptions - which houses the users/organisations Stripe subscriptions, this contains information about the subscription type, i.e free, basic, pro.

  • quota - tracks the amount of resources used

  • payments - not yet used, but will track each subscription payment made

Stripe

The stripe details can be provided on request.

Database Migrations

This service uses Postgres as it's core database. You can run migrations using:

Create a migration

$ make migrate.create name="my_new_migration"

Migrate up

$ make migrate.local.up

Migrate production/staging database

$ make migrate.proxy.up password=<database-password>

Protobuf definition

This service exposes a gRPC + Protobuf server, for certain endpoints/functions. You

The protobuf definition can be found in ./proto, you can re-build the protobuf definitions $ make build.proto.

gRPC endpoints

ListSubscriptions(ListSubscriptionsRequest) ListSubscriptionsResponse // Lists subscriptions by user or organisation
ListUsage(ListUsageRequest) ListUsageResponse // Lists usage records (months)
IncrementUsage(IncrementUsageRequest) IncrementUsageResponse // Updates current usage 
CheckQuota(CheckQuotaRequest) CheckQuotaResponse // Returns current usage 

REST endpoint

A couple of public facing Stripe webhooks are exposed via the Ingress controller for this service, which deal with the Stripe payment process.

Last updated