Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDP: adjust docs for the 3.0.0 release #1093

Merged
merged 18 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a79b7fa
[SDP-1331] Rename `verification_type` to `verification_field` (#957)
marcelosalloum Oct 22, 2024
b0e05f3
[SDP-1302] Update `PATCH /receiver` with the option to patch the phon…
marcelosalloum Oct 22, 2024
4b6c7d5
Update `/wallet-registration/verification`.
marcelosalloum Nov 21, 2024
71b31ca
Update `/wallet-registration/otp`.
marcelosalloum Nov 21, 2024
c063824
Rename fields to reflect changes from https://github.com/stellar/stel…
marcelosalloum Nov 21, 2024
40f856b
Rename `last_sms_sent` to `last_message_sent_at`, in accordance with …
marcelosalloum Nov 21, 2024
d56a610
Mention Twilio SendGrid.
marcelosalloum Nov 21, 2024
1dfa27b
Replace `SMS message` with `invitation message`, now that emails are …
marcelosalloum Nov 21, 2024
cfcea45
Update mentions to the CSV format and where to get the sample files.
marcelosalloum Nov 21, 2024
35b156f
Add missing PATCH /wallets/{id} API doc
marcelosalloum Nov 21, 2024
deb6123
Add section for Wallet Address disbursement.
marcelosalloum Nov 21, 2024
a47da7f
Remove mentions of Country and update the disbursements API with the …
marcelosalloum Nov 22, 2024
10b7469
Polishes.
marcelosalloum Nov 22, 2024
1f6d485
Update platforms/stellar-disbursement-platform/admin-guide/30-getting…
marcelosalloum Dec 2, 2024
2ac87d3
Update platforms/stellar-disbursement-platform/admin-guide/30-getting…
marcelosalloum Dec 2, 2024
1394797
Update platforms/stellar-disbursement-platform/admin-guide/30-getting…
marcelosalloum Dec 2, 2024
aac86dd
Improve section in getting started.
marcelosalloum Dec 2, 2024
73e2ac5
Mention that the correct template that matches a certain config can b…
marcelosalloum Dec 2, 2024
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
70 changes: 34 additions & 36 deletions config/disbursementPlatform.sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";

import sdpSidebar from '../platforms/stellar-disbursement-platform/api-reference/sidebar'
import sdpSidebar from "../platforms/stellar-disbursement-platform/api-reference/sidebar";

const sidebars: SidebarsConfig = {
stellar_disbursement_platform: [
stellar_disbursement_platform: [
{
type: "category",
label: "Stellar Disbursement Platform",
link: {
type: "doc",
id: "README",
},
items: [
"README",
{
type: "category",
label: "Stellar Disbursement Platform",
link: {
type: 'doc',
id: 'README',
type: "category",
label: "Admin Guide",
link: {
description:
"All you need to know about setting up, running, and using the Stellar Disbursement Platform.",
type: "generated-index",
slug: "/admin-guide",
},
items: [{ type: "autogenerated", dirName: "admin-guide" }],
},
items: [
'README',
{
type: 'category',
label: "Admin Guide",
link: {
description: "All you need to know about setting up, running, and using the Anchor Platform.",
type: 'generated-index',
slug: '/admin-guide',
},
items: [
{ type: "autogenerated", dirName: "admin-guide" }
]
},
{
type: 'category',
label: 'API Reference',
collapsed: false,
link: {
description: 'View all Stellar Disbursement Platform API information.',
type: 'generated-index',
slug: '/api-reference',
},
items: [
...sdpSidebar.filter((item) => item.type === 'category'),
],
},
],
{
type: "category",
label: "API Reference",
collapsed: false,
link: {
description:
"View all Stellar Disbursement Platform API information.",
type: "generated-index",
slug: "/api-reference",
},
items: [...sdpSidebar.filter((item) => item.type === "category")],
},
],
],
},
],
};

export default sidebars;
259 changes: 111 additions & 148 deletions openapi/stellar-disbursement-platform/bundled.yaml

Large diffs are not rendered by default.

270 changes: 118 additions & 152 deletions openapi/stellar-disbursement-platform/main.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion platforms/stellar-disbursement-platform/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ This is an open-source project that is built on top of the Stellar network, and
- [stellar/stellar-disbursement-platform-frontend](https://github.com/stellar/stellar-disbursement-platform-frontend): This repository contains the web frontend code for the Stellar Disbursement Platform.
- [stellar/helm-charts](https://github.com/stellar/helm-charts/tree/main/charts/stellar-disbursement-platform): This repository contains the Helm chart for deploying the Stellar Disbursement Platform using kubernetes.

In this section, you'll find an [Admin Guide](./admin-guide/10-overview.mdx) that will teach you how to run the Stellar Disbursement Platform as well as an [API Reference](./api-reference/admin.tag.mdx).
In this section, you'll find an [Admin Guide](./stellar-disbursement-platform/admin-guide/) that will teach you how to run the Stellar Disbursement Platform as well as an [API Reference](./api-reference/admin.tag.mdx).
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The entire SDP step-by-step process usually looks something like the following a
1. The organization funds the SDP’s distribution account with a Stellar-based asset (e.g. USDC)
2. An administrator logs in to the SDP’s dashboard and uploads a CSV file containing the payment information to initiate a new disbursement
3. The SDP sends a text message to every first-time recipient in the CSV inviting them to download a Stellar-enabled wallet application
4. Meanwhile, the SDP immediately begins making payments to each recipient that has already registered a wallet through a prior payment
4. Meanwhile, the SDP immediately begins making payments to each recipient that already has a wallet registered to them
5. Each first-time recipient clicks a deep link to download the Stellar-enabled wallet application chosen by the organization for this disbursement, downloads the app, and goes through the wallet sign-up process
6. Once the recipient has signed up and their Stellar account has been created, the wallet immediately authenticates with the SDP using parameters from the deep link and opens the SDP registration web view for the recipient to complete verification
7. The user confirms their identity by providing an OTP code sent to their phone number and an additional piece of verification information for security purposes. The SDP supports three different types of verification information: Date of Birth, Personal PIN, and National ID. This information is input by the recipient in a web flow and passes directly to the SDP, meaning the wallet does not need to process or store this information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The Stellar Disbursement Platform consists of four services deployed together:
- **Container Orchestration**: the SDP is packaged as Docker containers and can be deployed to Kubernetes or AWS Fargate. SDF provides a Helm Chart for Kubernetes
- **Postgres**: the SDP uses a Postgres database server for all of its services
- **Apache Kafka**: the SDP optionally uses Kafka for streaming events between services. This is primarily used between SDP Core Service and Transaction Submission Service
- **Twilio or AWS SNS and SES**: the SDP’s messaging service uses SMS messages via Twilio or AWS SNS and administrative emails for organization account setup and recovery via AWS SES
- **Twilio or AWS SNS and SES**: the SDP’s messaging service uses SMS messages via Twilio or AWS SNS and administrative emails for organization account setup and recovery via AWS SES or Twilio SendGrid
- **Stellar Accounts**:
- Distribution Account: the SDP requires access to at least one funded Stellar account to make payments to the recipient
- SEP-10 Auth Account: the SDP requires a Stellar account for the mutual authentication protocol [SEP-10: Stellar Web Authentication](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md) used to connect to wallet applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,6 @@ Go to Forgot Password page on `http://${tenant}.stellar.local:3000/forgot-passwo

A token will be generated, and it's possible to check it on `sdp-api` logs. This token will be needed to Reset Password on `http://${tenant}.stellar.local:3000/reset-password`.

## Create Your First Disbursement

Navigate to the frontend service by opening a browser and going to http://bluecorp.stellar.local:3000.

- Click `New Disbursement+` on the Dashboard screen.
- Use `Demo Wallet` as your wallet and choose a verification method.
- Upload a disbursement file. A sample file is available at `./dev/sample/sample-disbursement.csv`. Make sure to update the invalid phone number before using it.
- Finally, confirm the disbursement.

## Log In

Once the password for your target org user has been reset to one of your choice, navigate to the dashboard by opening a browser to localhost:3000 and login with the user account. ![Login](/assets/SDP/SDP26.png)
Expand All @@ -163,7 +154,14 @@ Click the Sign in button and the SDP Dashboard will open. You will have no disbu

## Create Your First Disbursement

Create your first disbursement by clicking the New Disbursement button. Use Demo Wallet as your wallet and USDC as your asset. You can choose whatever values you like for Country and Name, but ensure that Verification type matches the type used in the disbursement file that you will then upload with receiver information. Refer to `./dev/sample/sample-disbursement.csv` for the disbursement file template. ![Disbursement Details](/assets/SDP/SDP28.png)
Navigate to the frontend service by opening a browser and going to http://bluecorp.stellar.local:3000.

- Click `New Disbursement+` on the Dashboard screen.
- Use `Demo Wallet` as your wallet and choose a verification method.
- Upload a disbursement file. The file format can vary according with the disbursement configuration and a few sample files are available at [public/resources/disbursementTemplates](https://github.com/stellar/stellar-disbursement-platform-frontend/tree/58873bbf36cff4614e603daf449079b1d9fad24a/public/resources/disbursementTemplates). Make sure to update the file before using it by changing the contact info to yours and removing the comment line.
marcelosalloum marked this conversation as resolved.
Show resolved Hide resolved
- Finally, confirm the disbursement.

![Disbursement Details](/assets/SDP/SDP28.png)

You also have the option of modifying the message in the receiver invite. ![Disbursment Details 2](/assets/SDP/SDP29.png)

Expand Down Expand Up @@ -198,15 +196,21 @@ Payments will start failing if the distribution account runs out of funds. To fi

## Verify Your Identity

When a disbursement is created, the SDP attempts to send SMS messages to receivers using either Twilio or AWS SNS. This message includes a link to the wallet application selected when creating the disbursement, and should direct the receiver to install the wallet app, go through the wallet's onboarding flow, and finally register with the SDP. However, neither service is configured by default, so the SDP will not send an SMS message to the phone numbers listed in the CSV uploaded in the previous step. You can still see the message in the `sdp-api` container logs.
When a disbursement is created, the SDP attempts to send message receivers using either Twilio/AWS for SMS or email, according to the contact type associated with the user. This message includes a link to the wallet application selected when creating the disbursement, and should direct the receiver to install the wallet app, go through the wallet's onboarding flow, and finally register with the SDP.
marcelosalloum marked this conversation as resolved.
Show resolved Hide resolved

:::info

Please notice that the initial configuration has `SMS_SENDER_TYPE=DRY_RUN` and `EMAIL_SENDER_TYPE=DRY_RUN`, which means the messages will be printed in the logs (of the `sdp-api` container) instead of being sent.

Check out the [Email and SMS Messages](#email-and-sms-messages) section to learn how to configure messaging in the SDP. When you do, and another disbursement is created, you should get a message like the following.

![Verify Identity](/assets/SDP/SDP8.png)

:::

## Create a Receiver Account

Clicking on the link within the SMS message will bring you back to the Stellar Demo Wallet, where you'll need to create another account to receive the USDC. Follow the same process described earlier to create the account and add a USDC trustline.
Clicking on initation message link will take the receiver to the [demo-wallet], where they'll need to create an account to be used to receive the USDC payment. Follow the same process described earlier to create the account and add a USDC trustline.

## Initiate SEP-24 Webflow

Expand All @@ -216,9 +220,13 @@ In the "Select Action" dropdown, select "SEP-24 Deposit" to initiate a SEP-24 we

![SEP-24](/assets/SDP/SDP13.png)

A SEP-24 interactive window will appear. This simulates the wallet application popup you would see on your mobile phone. Enter the phone number from the disbursement CSV.
A SEP-24 interactive window will appear, where the receiver can select the contact info type (e.g. phone number or email) that is registered for them in the SDP database.

![Webflow1](/assets/SDP/SDP14.2.png)
marcelosalloum marked this conversation as resolved.
Show resolved Hide resolved

In the next SEP-24 screen the user should enter the contact info data (phone number or email) from the disbursement CSV.

![Webflow](/assets/SDP/SDP14.png)
![Webflow2](/assets/SDP/SDP14.2.png)

Next, enter the passcode and the verification field that you used in the disbursement file. Note: use 000000 for this example (or 999999 if you want to see an error response).

Expand All @@ -244,9 +252,9 @@ Now that you've been able to make a disbursement, let's go back to our docker co

### Email and SMS Messages

The Stellar Disbursement Platform sends SMS messages and emails to receivers and users, respectively. For SMS messages, the Stellar Disbursement Platform supports Twilio, AWS SNS, and a dry run mode that just logs the messages. For emails, it supports AWS SES and dry run.
The Stellar Disbursement Platform sends emails to users and SMS/emails to receivers. For SMS messages, the Stellar Disbursement Platform supports Twilio, AWS SNS, and a dry run mode that just logs the messages. For emails, it supports AWS SES, Twilio SendGrid, and dry run.

These services can be selected through the `SMS_SENDER_TYPE` and `EMAIL_SENDER_TYPE` configurations. When selecting Twilio or AWS services, you'll need to fill their service-specific configuration as well. Here are some example configurations. You can mix and match the services as you see fit.
These services can be selected through the `SMS_SENDER_TYPE` and `EMAIL_SENDER_TYPE` configurations. When selecting Twilio or AWS services, you'll need to fill their service-specific configuration as well. Below there are some example configurations, and you can mix and match the services as you see fit.

#### Dry Run Configuration

Expand Down Expand Up @@ -276,6 +284,20 @@ TWILIO_SERVICE_SID:

</CodeExample>

#### Twilio Email (Send Grid) Configuration

<CodeExample>

```yaml
SMS_SENDER_TYPE: TWILIO_EMAIL

# Twilio specific configuration
TWILIO_SENDGRID_API_KEY:
TWILIO_SENDGRID_SENDER_ADDRESS:
```

</CodeExample>

#### AWS SMS Configuration

<CodeExample>
Expand Down Expand Up @@ -364,11 +386,13 @@ EC256_PRIVATE_KEY:

There are many other configuration values to update when moving to a production environment, such as database credentials, URLs, and more.

## Level Up: Customize Default Options
## Level Up

The SDP contains a list of assets, countries, and wallets available for disbursements out-of-the-box. You might want to customize these, either to limit/expand options or to prepare for going live in production. Now that you've made a disbursement and added application secrets, let's look at how to customize the new disbursement options.
### Custom Assets and Wallets

### Assets
The SDP contains a list of assets and wallets available for disbursements out-of-the-box. You might want to customize these, either to limit/expand options or to prepare for going live in production. Now that you've made a disbursement and added application secrets, let's look at how to customize the new disbursement options.

#### Assets

You can add and remove assets easily in the SDP dashboard. The SDP backend handles the request seamlessly, including checking for outstanding balance and adding/removing trustlines on the Stellar network. When assets are removed, the record is still retained in the database to preserve a full history. However, the asset will no longer be available for disbursements or holding a balance in the distribution account.

Expand All @@ -380,25 +404,21 @@ Please make sure to update the appropriate configuration on the Anchor Platform

:::

### Countries

To customize wallets and countries, you’ll need to do some backend work.

The list of available countries is seeded with a database patch. The default list includes every country except North Korea, Iran, Cuba, and Syria for easy testing. If you want to narrow the list, you will need to remove the country record directly from the countries table within the SDP database.
#### Wallets

Here is an example of how to remove France with its three-character ISO 3166 code:

<CodeExample>
For a full overview on how to add wallets and how to make a wallet SDP-compatible, check out the [Making Your Wallet SDP-Ready](making-your-wallet-sdp-ready) guide.

```sql
DELETE FROM countries WHERE code = 'FRA';
```
### Wallet Address Registration

</CodeExample>
Since version [`3.0.0`](https://github.com/stellar/stellar-disbursement-platform-backend/releases/tag/3.0.0), users can pay directly to Stellar wallet addresses rather than driving the users through the registration flow. This is useful for organizations that are paying receivers who already have Stellar wallets and don't need to create a new one.
marcelosalloum marked this conversation as resolved.
Show resolved Hide resolved

### Wallets
To use this feature, follow these steps:

For a full overview on how to add wallets and how to make a wallet SDP-compatible, check out the [Making Your Wallet SDP-Ready](making-your-wallet-sdp-ready) guide.
1. Make sure the User Managed Wallet is enabled at the Wallet Providers section (also available at [`GET /wallets`](/platforms/stellar-disbursement-platform/api-reference/get-all-wallets)).
2. If it's not enabled, you can update it through the UI dashboard or with [`PATCH /wallets/{id}`](/platforms/stellar-disbursement-platform/api-reference/update-wallet).
3. Now you can create a disbursement and select from the `registration Contact Type dropdown an option that contains `Walet Address` in the name.
4. Prepare the CSV file according with the [CSV sample](https://github.com/stellar/stellar-disbursement-platform-frontend/tree/58873bbf36cff4614e603daf449079b1d9fad24a/public/resources/disbursementTemplates) associated with your disbursement configuration.
5. Upload the CSV file and confirm the disbursement as usual. The SDP will send the payment directly to the wallet addresses provided in the CSV ✅.

[demo-wallet]: https://demo-wallet.stellar.org
[circle-sandbox]: https://login-sandbox.circle.com/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Operational Configuration allows controlling metrics, logging, and other operati

Messaging Configuration allows configuring the messaging service used to send messages to recipients and sdp dashboard users. The default configuration is set to "DRY_RUN" which means no messages will be sent and the messages will be logged to the console. This is recommended for testing purposes only.

- `EMAIL_SENDER_TYPE`: The messenger type used to send invitations to new dashboard users. Options: "DRY_RUN", "AWS_EMAIL". Default: "DRY_RUN".
- `EMAIL_SENDER_TYPE`: The messenger type used to send invitations to new dashboard users. Options: "DRY_RUN", "TWILIO_EMAIL", "AWS_EMAIL". Default: "DRY_RUN".
- `SMS_SENDER_TYPE`: The messenger type used to send SMS messages to recipients. Options: "DRY_RUN", "TWILIO_SMS", "AWS_SMS". Default: "DRY_RUN".

#### AWS Configuration
Expand All @@ -62,15 +62,20 @@ The following configurations are required when using AWS SES or SNS to send emai

#### Twilio Configuration

The following configurations are required when `SMS_SENDER_TYPE` is set to "TWILIO_SMS".
The following configurations are required when `SMS_SENDER_TYPE=TWILIO_SMS`.

- `TWILIO_ACCOUNT_SID` - 🔑 The Twilio account SID.
- `TWILIO_AUTH_TOKEN` - 🔑 The Twilio auth token.
- `TWILIO_SERVICE_SID` - The Twilio service SID.

General Messaging Configuration:
The following configurations are required when `EMAIL_SENDER_TYPE=TWILIO_EMAIL`.

- `MAX_INVITATION_SMS_RESEND_ATTEMPTS` - The maximum number of attempts to resend the SMS invitation to the Receiver Wallets. Default: 3.
- `TWILIO_SENDGRID_API_KEY` - 🔑 The API key for the Twilio SendGrid (email) service.
- `TWILIO_SENDGRID_SENDER_ADDRESS` - The email address used to send emails via Twilio SendGrid.

#### General Messaging Configuration

- `MAX_INVITATION_RESEND_ATTEMPTS` - The maximum number of attempts to (auto) resend the invitation to the Receiver Wallets. Default: 3.

### Stellar Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ It cannot be changed once the tenant is created.

### `base_url`, and `sdp_ui_base_url`

These are the URLs that the tenant will use to access the API and the dashboard, respectively. They are used to generate the tenant-specific URLs that are used in the dashboard and the email and SMS messages.
These are the URLs that the tenant will use to access the API and the dashboard, respectively. They are used to generate the tenant-specific URLs that are used in the dashboard and the user-targeted or receiver-targeted messages.

They are important to allow the SDP backend to route the unauthenticated requests to the correct tenant, and to generate the correct URLs in the dashboard.

Expand Down
Loading