Tutorial — Payments
Pay with Mastercard Agent Pay
Mastercard Agent Pay mirrors the Visa TAP flow on the Mastercard network. The mandate is issued out-of-band on Mastercard's side; Tenzro takes the resulting payment credential and settles through its payment gateway, recording the receipt on-chain for audit.
- Level
- Intermediate
- Time
- ~20 min
- Prerequisites
- Mastercard Agent Pay credentials, delegated machine DID
- Stack
- TypeScript
01
Acquire an Agent Pay credential out-of-band
Mastercard issues the mandate and the resulting payment credential — that's outside the Tenzro flow.
const credential = {
mandate_id: "mc_mandate_...",
merchant: "merch_xyz",
amount: "120.00",
currency: "EUR",
signature: "..."
};02
Submit through the Tenzro gateway
The node verifies the credential, dispatches the card-rail authorization, and emits the on-chain settlement entry.
import { TenzroClient } from "tenzro-sdk";
const client = new TenzroClient({ endpoint: "https://rpc.tenzro.network" });
const receipt = await client.payment.payMastercard(credential);
console.log("settled:", receipt);03
Inspect the settlement entry
Receipts include the card-network reference and the on-chain settlement ID.
const entry = await client.settlement.getSettlement(receipt.receipt_id);
console.log(entry);04
Confirm gateway support
The gateway info call confirms Mastercard Agent Pay is live on the connected node.
const info = await client.payment.gatewayInfo();
console.log(info);Related