DEV Community

ServicesAI VN
ServicesAI VN

Posted on

VietQR Payments for AI Agents—No Stripe Setup

VietQR Payments for AI Agents—No Stripe Setup

The Problem

Building AI agents in Vietnam that need to collect payments? Stripe doesn't support VietQR, and integrating traditional payment gateways means managing API keys, webhooks, and fund settlement delays. Most solutions require your agent to hold or route money through intermediaries.

What if your AI could generate a QR code that points directly to your business bank account?

Introducing AgentPay VN

AgentPay is an open-source (MIT) Python SDK + MCP server that lets Claude, local LLMs, and custom agents collect VietQR payments in three lines of logic:

  1. Create a payment request
  2. Send the checkout URL to your customer
  3. Await settlement confirmation from the bank feed

No middleman. No fund holding. The QR points straight to your merchant account.

How It Works

AgentPay reads your bank's SePay feed to confirm when a payment settles. It doesn't touch the money—it just watches for it. Your AI agent can then trigger downstream workflows (send invoice, unlock feature, etc.) once settlement is confirmed.

Installation

pip install agentpay-vn
Enter fullscreen mode Exit fullscreen mode

Or run the MCP server for Claude Desktop / Code:

pip install agentpay-mcp
Enter fullscreen mode Exit fullscreen mode

Quick Example

from agentpay import AgentPayClient

client = AgentPayClient(
    api_key="your_api_key",
    merchant_id="your_merchant_id"
)

# Step 1: Create payment request
payment = client.create_payment_request(
    amount=100000,  # 100K VND
    description="AI consulting session",
    order_id="order_12345"
)

print(f"Checkout URL: {payment.checkout_url}")
# Share with customer → they scan QR → money hits your bank

# Step 2: Poll for settlement
import time
while True:
    status = client.get_payment_status(payment.id)
    if status.settled:
        print("✓ Payment confirmed! Triggering downstream workflow...")
        break
    time.sleep(5)
Enter fullscreen mode Exit fullscreen mode

MCP Integration

Add to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "agentpay": {
      "command": "python",
      "args": ["-m", "agentpay_mcp.server"],
      "env": {
        "AGENTPAY_API_KEY": "your_api_key",
        "AGENTPAY_MERCHANT_ID": "your_merchant_id"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Now Claude can:

  • Generate payment QR codes on demand
  • Check settlement status mid-conversation
  • Chain payments into multi-step workflows

Real Use Cases

  • AI Consulting Chatbots: "That analysis will cost ₫500K. [Scan QR]. Thanks! Here's your report."
  • Autonomous Trading Bots: Collect fees when trades execute; settle directly to ops account.
  • AI Content Marketplace: Agent lists content, collects micro-payments, splits revenue—all via QR.

Honest Limitations

  • Vietnam-only: Requires a VietQR-compatible bank account.
  • SePay dependency: Settlement confirmation relies on your bank's SePay feed API (not all banks fully supported yet—check docs).
  • Polling model: No real-time webhooks; you'll poll for status updates.
  • Early-stage: Open-source project; production use should include your own monitoring.

Get Started

AgentPay strips away payment infrastructure complexity so you can focus on what your AI agent does best. No Stripe. No holding accounts. Just QR → Bank → Done.

Try it. Open an issue. Build something interesting.

Top comments (0)