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
3 changes: 1 addition & 2 deletions charts/plugin-br-payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ The chart **fails fast** on `helm install` if any of the following are missing:
| `app.configmap.OUTBOX_ENABLED` | Must be `"true"`. The plugin only registers HTTP routes when the outbox is enabled. |
| `app.configmap.BTG_API_BASE_URL` | BTG API base URL. |
| `app.configmap.BTG_AUTH_URL` | BTG OAuth2 token URL. |
| `app.configmap.MIDAZ_ONBOARDING_URL` | Midaz onboarding service URL. |
| `app.configmap.MIDAZ_TRANSACTION_URL` | Midaz transaction service URL. |
| `app.configmap.MIDAZ_LEDGER_URL` | Midaz Ledger service URL (single plane). The deprecated `MIDAZ_ONBOARDING_URL` + `MIDAZ_TRANSACTION_URL` pair is still accepted as a fallback. |
| `app.secrets.BTG_CLIENT_ID` | BTG OAuth2 client ID. |
| `app.secrets.BTG_CLIENT_SECRET` | BTG OAuth2 client secret. |
| `app.secrets.BTG_WEBHOOK_SECRET` | Bearer token for incoming BTG webhooks. |
Expand Down
3 changes: 1 addition & 2 deletions charts/plugin-br-payments/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ The following values MUST be set for the deployment to start successfully:
- app.configmap.OUTBOX_ENABLED (must be "true" — HTTP routes only register when the outbox is enabled)
- app.configmap.BTG_API_BASE_URL (BTG API base URL)
- app.configmap.BTG_AUTH_URL (BTG OAuth2 token URL)
- app.configmap.MIDAZ_ONBOARDING_URL (Midaz onboarding service URL)
- app.configmap.MIDAZ_TRANSACTION_URL (Midaz transaction service URL)
- app.configmap.MIDAZ_LEDGER_URL (Midaz Ledger service URL; deprecated MIDAZ_ONBOARDING_URL + MIDAZ_TRANSACTION_URL pair still accepted as a fallback)
- app.secrets.BTG_CLIENT_ID (BTG OAuth2 client ID)
- app.secrets.BTG_CLIENT_SECRET (BTG OAuth2 client secret)
- app.secrets.BTG_WEBHOOK_SECRET (BTG webhook bearer token)
Expand Down
16 changes: 10 additions & 6 deletions charts/plugin-br-payments/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ plugin-br-payments README.
{{- fail "\n\nERROR: app.secrets.BTG_WEBHOOK_SECRET is REQUIRED.\n Set the BTG webhook bearer token in the secrets section.\n" }}
{{- end }}

{{/* Midaz Ledger URLs — required for production */}}
{{- if not .Values.app.configmap.MIDAZ_ONBOARDING_URL }}
{{- fail "\n\nERROR: app.configmap.MIDAZ_ONBOARDING_URL is REQUIRED.\n Set the Midaz onboarding service URL.\n" }}
{{/* Midaz Ledger URL — required for production.
Preferred: app.configmap.MIDAZ_LEDGER_URL (single Ledger plane URL; the
app now serves onboarding + transaction from one plane).
DEPRECATED fallback: MIDAZ_ONBOARDING_URL + MIDAZ_TRANSACTION_URL (the
former split pair). Still accepted for backward compatibility with
environments that have not migrated yet; remove once all overlays use
MIDAZ_LEDGER_URL. */}}
{{- if not .Values.app.configmap.MIDAZ_LEDGER_URL }}
{{- if not (and .Values.app.configmap.MIDAZ_ONBOARDING_URL .Values.app.configmap.MIDAZ_TRANSACTION_URL) }}
{{- fail "\n\nERROR: app.configmap.MIDAZ_LEDGER_URL is REQUIRED.\n Set the Midaz Ledger service URL.\n (Deprecated: the former MIDAZ_ONBOARDING_URL + MIDAZ_TRANSACTION_URL pair is still accepted as a fallback.)\n" }}
{{- end }}

{{- if not .Values.app.configmap.MIDAZ_TRANSACTION_URL }}
{{- fail "\n\nERROR: app.configmap.MIDAZ_TRANSACTION_URL is REQUIRED.\n Set the Midaz transaction service URL.\n" }}
{{- end }}

{{/* PostgreSQL password is single-sourced from the postgresql subchart Secret
Expand Down
4 changes: 2 additions & 2 deletions charts/plugin-br-payments/templates/bootstrap-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ spec:
DB_EXISTS=0
ROLE_EXISTS=0

if PGPASSWORD="$DB_ADMIN_PASSWORD" psql -At -v ON_ERROR_STOP=1 -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER_ADMIN" -d "$DB_DATABASE" -c "SELECT 1 FROM pg_database WHERE datname='$APP_DB'" | grep -q 1; then
if PGPASSWORD="$DB_ADMIN_PASSWORD" psql -At -v ON_ERROR_STOP=1 -v db="$APP_DB" -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER_ADMIN" -d "$DB_DATABASE" -c "SELECT 1 FROM pg_database WHERE datname=:'db'" | grep -q 1; then
DB_EXISTS=1
fi
if PGPASSWORD="$DB_ADMIN_PASSWORD" psql -At -v ON_ERROR_STOP=1 -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER_ADMIN" -d "$DB_DATABASE" -c "SELECT 1 FROM pg_roles WHERE rolname='$APP_ROLE'" | grep -q 1; then
if PGPASSWORD="$DB_ADMIN_PASSWORD" psql -At -v ON_ERROR_STOP=1 -v role="$APP_ROLE" -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER_ADMIN" -d "$DB_DATABASE" -c "SELECT 1 FROM pg_roles WHERE rolname=:'role'" | grep -q 1; then
ROLE_EXISTS=1
fi

Expand Down
6 changes: 3 additions & 3 deletions charts/plugin-br-payments/values-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ app:
# BTG Provider integration (REQUIRED)
BTG_API_BASE_URL: ""
BTG_AUTH_URL: ""
# Midaz Ledger (REQUIRED)
MIDAZ_ONBOARDING_URL: ""
MIDAZ_TRANSACTION_URL: ""
# Midaz Ledger (REQUIRED) — single Ledger plane URL. The deprecated
# MIDAZ_ONBOARDING_URL + MIDAZ_TRANSACTION_URL pair is still accepted.
MIDAZ_LEDGER_URL: ""
# Auth
PLUGIN_AUTH_ENABLED: "true"
PLUGIN_AUTH_ADDRESS: ""
Expand Down
7 changes: 4 additions & 3 deletions charts/plugin-br-payments/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ app:
BTG_API_BASE_URL: ""
BTG_AUTH_URL: ""
BTG_TOKEN_REFRESH_INTERVAL: "1h"
# Midaz Ledger URLs (REQUIRED for production - validated by helper)
MIDAZ_ONBOARDING_URL: ""
MIDAZ_TRANSACTION_URL: ""
# Midaz Ledger URL (REQUIRED for production - validated by helper).
# Single Ledger plane URL; the deprecated MIDAZ_ONBOARDING_URL +
# MIDAZ_TRANSACTION_URL pair is still accepted as a fallback.
MIDAZ_LEDGER_URL: ""
# Reconciliation worker (in-process)
RECONCILIATION_INTERVAL: "5m"
RECONCILIATION_LOOKBACK_HOURS: "24"
Expand Down
Loading