Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/platform/payments/dpsg/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
id: config
title: Config
sidebar_label: Config
---

If you want to connect to our payment service locally or want to manually configure your environment please follow the guide below

## Local Configuration

**server/local.json**

```
"modules": {
"dpsg": {
"enabled": true,
"config": {
"redirectBaseUrl": "http://localhost:3000",
"serviceUser": "[USER]", // format = project:environment:profile
"serviceToken": [SERVICE_TOKEN]",
"webhookBaseUrl": [SERVER_URL], // when working locally we recommend using ngrok so your server instance is accessible
"region": "[REGION]" eu, us, au (defaults to eu)
}
}
}

```

## Environment Variables

```
"config": {
"redirectBaseUrl": "PAYMENTS_REDIRECT_BASE_URL",
"serviceUser": "PAYMENTS_SERVICE_USER",
"serviceToken": "PAYMENTS_SERVICE_TOKEN",
"webhookBaseUrl": "PAYMENT_WEBHOOK_BASE_URL",
"region": "ENV_REGION"
}
```
16 changes: 16 additions & 0 deletions docs/platform/payments/dpsg/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: events
title: Events / Webhooks
sidebar_label: Events / Webhooks
---

Our payment service emits events to a message queue that Deity platform subscribes to.

This is all handled by our `@deity/falcon-dpsg-module` package.

When messages are consumes this package emits events that are picked up by other parts of the app. You can also watch for these events and create your own action.

## Events

- `PaymentEvents.PAYMENT_STATUS_UPDATED` when a payment is updated, currently used for refunds
- `Events.ERROR` when a payment error occurs it's sent to our normal error event.
37 changes: 37 additions & 0 deletions docs/platform/payments/dpsg/glossary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
id: glossary
title: Glossary
sidebar_label: Glossary
---

## Provider

We use the term provider to refer to a payment service provider (PSP). e.g. Stripe, Mollie, Braintree.

## Method

When referring to a method we are talking about a specific payment method e.g credit card, paypal, Apple Pay.

## Stored Method

A stored method is a payment method that is stored / vaulted and connected to a customer. We map shop customers (by ID) against payment provider customers (by ID).

## Payment Profile

Our payment service allows for multiple environments specific to each customer, these are called profiles. Each profile should be unique to each Deity Platform instance (including local instances). Each profile can have it's own configuration including payment providers, methods & filters.

## Filter

Payment providers and methods can be filtered by country, currency & cart total. What this means is you can show Stripe methods for US customers and Mollie for European customers. You can also only show methods like Klarna for orders over $100.

## Event / Messages

Our payment service uses both API (Rest) endpoints and messages for various parts of the payment flow. Deity platform subscribes to these messages and handles them appropriately. These messages occur for things such as payment updates from refunds. [LINK TO MORE INFO]

## Region

Our payment service has instances in the US, EU or AU for optimum performance. This can be chosen when you create a profile.

- **EU (Default)**: [https://dpsg.deity.cloud/](https://dpsg.deity.cloud/)
- **US**: [https://dpsg.us.deity.cloud/](https://dpsg.us.deity.cloud/)
- **AU**: [https://dpsg.au.deity.cloud/](https://dpsg.au.deity.cloud/)
29 changes: 29 additions & 0 deletions docs/platform/payments/dpsg/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: overview
title: Overview
sidebar_label: Overview
---

Our payment service is available to all Deity platform users. It acts as a middleman between payment providers and Falcon server.

It exposes various REST Api endpoints for doing things like querying payment methods, making payments and storing payment methods.

Alongside this it always exposes a message queue that Deity Platform subscribes to. This publishes events such as payment updates after refunds.

## Payment Service Swagger

Our payment service exposes a public swagger so you can use for testing and documentation. Make sure you visit the instance you will be using and your payment profile is set up on.

- **EU (Default)**: [https://dpsg.deity.cloud/](https://dpsg.deity.cloud/)
- **US**: [https://dpsg.us.deity.cloud/](https://dpsg.us.deity.cloud/)
- **AU**: [https://dpsg.au.deity.cloud/](https://dpsg.au.deity.cloud/)

### Swagger Authorization

To use the public swagger you'll need your payment profile credentials.

You will need to use `token` based authorization.

Your token will be `[SERVICE_USER]:[SERVICE_TOKEN]`. It will look something like this:

`project:environment:profile:123456`
33 changes: 33 additions & 0 deletions docs/platform/payments/dpsg/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: setup
title: Setup
sidebar_label: Setup
---

Our payment service should be set up using [dcloud](/docs/next/platform/cloud/dcloud).

Please make sure your `dcloud` is up to date before configuration.

## 1. Create a profile

`dcloud payments:profile:create`

When configuring your profile please choose a region closest to your main customer base.

Once configuration of your profile is complete you will see a user and a auth token, if you wish to connect to this profile using a local Deity Platform instance please make note of this. You can get them later if you forget.

## 2. Configure a payment provider

`dcloud payments:provider:configure`

## 3. Set up a payment method

`dcloud payments:method:configure`

## 4. Connect your Deity Platform environment

`dcloud payments:profile:apply`

## 5. Apply your changes

`dcloud env:var:apply <env>`
235 changes: 0 additions & 235 deletions docs/platform/payments/falcon-payments/features.md

This file was deleted.

Loading