Prerequisites: Payment Hub EE must be deployed before enabling the Mastercard CBS connector. For local development iteration, see LOCALDEV.md. For integration details, see MIFOS_GAZELLE_INTEGRATION.md.
The Mastercard CBS connector uses a Kubernetes Operator pattern:
- A
MastercardCBSConnectorCustom Resource (CRD) declares the desired connector state - A shell-based controller (
controllers/reconcile.sh) watches the CR and reconciles — creating/updating deployments, loading DB schemas, and deploying BPMN workflows - This lives entirely inside
src/deployer/operators/mastercard/in the mifos-gazelle repo; the operator manages the connector image from~/ph-ee-connector-mccbs
[mastercard-demo]
enabled = true
MASTERCARD_NAMESPACE = mastercard-demo
MASTERCARD_CBS_HOME = ~/ph-ee-connector-mccbs
MASTERCARD_API_URL = https://sandbox.api.mastercard.com
MASTERCARD_PARTNER_ID = <your-partner-id>
MASTERCARD_CONSUMER_KEY = <your-consumer-key>
MASTERCARD_SIGNING_KEY_ALIAS = <alias>
MASTERCARD_SIGNING_KEY_PASSWORD = <password>
MASTERCARD_SIGNING_KEY_PATH = /path/to/signing.p12
# JWE encryption (optional)
MASTERCARD_ENCRYPTION_ENABLED = false# Deploy with all other apps
./run.sh -m deploy -a all
# Or deploy Mastercard connector only (Payment Hub must already be running)
./run.sh -m deploy -a mastercard-demoThe deploy sequence (src/deployer/mastercard.sh):
- Creates
mastercard-demonamespace - Creates K8s secrets from config.ini values (credentials, certs, copies
operationsmysqlsecret) - Deploys the CRD, RBAC, and operator pod from
src/deployer/operators/mastercard/ - Applies the
MastercardCBSConnectorCR → operator deploys the connector - Deploys BPMN workflow (
MastercardFundTransfer-DFSPID.bpmnfor greenbank/redbank/bluebank) - Loads supplementary data (
src/utils/mastercard/load-mastercard-supplementary-data.sh) - Generates sample CSV (
src/utils/data-loading/bulk-gazelle-mastercard-6.csv)
# Custom Resource status
kubectl get mastercardcbsconnector -n mastercard-demo
# Pods
kubectl get pods -n mastercard-demo
# Operator logs
kubectl logs -n mastercard-demo -l app=mastercard-cbs-operator -f
# Connector logs
kubectl logs -n mastercard-demo -l app=ph-ee-connector-mastercard-cbs -fCR Status Fields:
| Field | Values | Meaning |
|---|---|---|
phase |
Pending, Initializing, Ready, Failed, Disabled | Overall lifecycle state |
connectorReady |
true/false | Connector deployment healthy |
workflowDeployed |
true/false | BPMN deployed to Zeebe |
dataLoaded |
true/false | Supplementary data loaded |
mifos-gazelle/
└── src/deployer/
├── mastercard.sh # Main deploy/cleanup functions
└── operators/mastercard/
├── config/
│ ├── crd/mastercard-cbs-connector.yaml
│ ├── rbac/{service_account,role,role_binding}.yaml
│ └── samples/
│ ├── mastercard-cbs-default.yaml # Standard CR sample
│ └── mastercard-cbs-localdev.yaml # hostPath local dev CR
├── controllers/reconcile.sh # Operator reconciliation logic
└── deploy-operator.sh # Operator install/uninstall
~/ph-ee-connector-mccbs/
└── orchestration/
└── MastercardFundTransfer-DFSPID.bpmn # BPMN workflow (required)
| Key | Required | Default | Description |
|---|---|---|---|
enabled |
Yes | false |
Set true to deploy |
MASTERCARD_NAMESPACE |
No | mastercard-demo |
K8s namespace |
MASTERCARD_CBS_HOME |
No | ~/ph-ee-connector-mccbs |
Path to connector source |
MASTERCARD_API_URL |
No | https://sandbox.api.mastercard.com |
Mastercard API endpoint |
MASTERCARD_PARTNER_ID |
For real payments | — | From Mastercard Developers portal |
MASTERCARD_CONSUMER_KEY |
For real payments | — | OAuth1 consumer key |
MASTERCARD_SIGNING_KEY_ALIAS |
For real payments | — | P12 key alias |
MASTERCARD_SIGNING_KEY_PASSWORD |
For real payments | — | P12 key password |
MASTERCARD_SIGNING_KEY_PATH |
For Docker mode | — | Local path to signing .p12 (bundled as K8s Secret) |
MASTERCARD_ENCRYPTION_ENABLED |
No | false |
Enable JWE encryption |
MASTERCARD_LOCALDEV_ENABLED |
No | false |
Mount local source via hostPath (see LOCALDEV.md) |
Note on cert paths:
MASTERCARD_SIGNING_KEY_PATHand related paths are read from the local machine and stored as a K8s Secret at deploy time. This is required for Docker image deployments. InMASTERCARD_LOCALDEV_ENABLED=truemode, certs can be bundled in the locally-compiled JAR instead.
The operator creates a CR like this (written to /tmp/mastercard-cbs-cr.yaml during deployment):
apiVersion: paymenthub.mifos.io/v1alpha1
kind: MastercardCBSConnector
metadata:
name: mastercard-cbs
namespace: mastercard-demo
spec:
enabled: true
replicas: 1
image:
repository: ph-ee-connector-mastercard-cbs
tag: "1.0.0"
mastercard:
apiUrl: "https://sandbox.api.mastercard.com"
clientSecretName: "mastercard-cbs-credentials"
paymenthub:
namespace: "paymenthub"
zeebeGateway: "phee-zeebe-gateway.paymenthub.svc.cluster.local:26500"
operationsDb:
host: "operationsmysql.paymenthub.svc.cluster.local"
port: 3306
database: "operations"
secretName: "mysql-secret"
dataLoading:
autoLoad: true
demoPayeeCount: 10
workflow:
autoDeploy: falseEdit the CR and apply:
kubectl edit mastercardcbsconnector mastercard-cbs -n mastercard-demo
# Operator automatically reconciles changeskubectl patch mastercardcbsconnector mastercard-cbs -n mastercard-demo \
--type='json' -p='[{"op":"replace","path":"/spec/replicas","value":2}]'kubectl patch mastercardcbsconnector mastercard-cbs -n mastercard-demo \
--type='merge' -p '{"spec":{"enabled":false}}'# Via run.sh
./run.sh -m cleanapps -a mastercard-demo
# Manually
kubectl delete mastercardcbsconnector mastercard-cbs -n mastercard-demo
cd ~/mifos-gazelle/src/deployer/operators/mastercard
bash deploy-operator.sh undeploy
kubectl delete namespace mastercard-demokubectl get pods -n mastercard-demo
kubectl describe pod -n mastercard-demo -l app=mastercard-cbs-operator
kubectl logs -n mastercard-demo -l app=mastercard-cbs-operator --tail=50kubectl get mastercardcbsconnector mastercard-cbs -n mastercard-demo -o yaml | grep -A10 statusCheck: PaymentHub namespace exists, mysql-secret was copied successfully, operator has correct RBAC.
kubectl logs -n mastercard-demo -l app=ph-ee-connector-mastercard-cbs | grep "Registered worker"Expected: 8 workers registered (mastercard-cbs-validate-input, mastercard-cbs-authenticate, etc.). Check Zeebe gateway connectivity between namespaces.
cat /tmp/mastercard-data-load.log
kubectl get jobs -n mastercard-demoEnsure MASTERCARD_SIGNING_KEY_PATH points to a readable .p12 file on the local machine before running run.sh. The file is read and stored as a K8s Secret (mastercard-cbs-certs).