Ap2 payment processor

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Ap2 payment processor is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Build an AP2 Merchant Payment Processor — the agent that constructs payment authorization messages, requests credentials from the Credentials Provider, processes payments, and returns receipts. Use when implementing the MPP role.

How to use this skill

Skill file

AP2 Merchant Payment Processor Implementation

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/ap2/specification/ for Payment Processor responsibilities
  2. Web-search site:github.com google-agentic-commerce AP2 samples roles merchant_payment_processor for reference implementation
  3. Web-search site:github.com google-agentic-commerce AP2 payment processor authorization for authorization flow
  4. Fetch https://ap2-protocol.org/overview/ for MPP role details

Conceptual Architecture

What the Payment Processor Does

The Merchant Payment Processor (MPP) handles the financial side of the transaction on behalf of the merchant:

  1. Receives payment requests from the Merchant Agent
  2. Requests credentials from the Credentials Provider using the Payment Mandate
  3. Constructs authorization messages for the payment network
  4. Processes the payment through the network/issuer
  5. Handles challenges (3DS2, OTP) when required
  6. Returns receipts to the Merchant Agent

Where It Sits in the Flow

Shopping Agent → Merchant Agent → MPP → Credentials Provider
                                  ↓
                            Payment Network / Issuer
                                  ↓
                            Authorization Result
                                  ↓
                     MPP → Merchant Agent → Shopping Agent → User

Key Responsibilities

Payment Authorization
Challenge Handling

When the network/issuer requires additional verification:

Receipt Generation

After successful authorization:

Payment Network Integration

The MPP interfaces with traditional payment infrastructure:

Risk Signals

The MPP may add risk signals to the authorization:

OTP Challenge Flow (Reference)

From the sample implementation:

  1. MPP receives payment request from Merchant
  2. MPP determines OTP is required
  3. MPP sends challenge to Shopping Agent (via A2A)
  4. Shopping Agent presents challenge to user
  5. User enters OTP (test value: "123" in samples)
  6. Shopping Agent returns OTP to MPP
  7. MPP verifies OTP
  8. MPP proceeds with payment authorization

Best Practices

Fetch the specification for exact MPP requirements, authorization message format, and challenge flow details before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.