# Ping++ MCP

> Ping++ is a multi-channel payment aggregator for AI agents. It lets your agent manage payments across WeChat Pay, Alipay, and UnionPay using one API endpoint. You can create charges, process refunds, list customer accounts, and track transactions without needing dozens of separate gateway integrations.

## Overview
- **Category:** money-moves
- **Price:** Free
- **Tags:** payments, alipay, wechat-pay, unionpay, ecommerce, billing

## Description

You're dealing with payments across China—WeChat Pay, Alipay, UnionPay—and you don't want your agent talking to three different backends. Ping++ gives your AI client one endpoint for all that complexity. It lets your agent handle the full payment lifecycle: starting a charge, tracking it down later, and issuing refunds, all without needing dozens of specific gateway integrations. You focus on the business logic; we handle the network plumbing.

When you need to process payments, you'll use `create_charge` to initiate a new request. Just toss in the required order number, the amount, and the payment channel type. It kicks off the transaction right away. If you later need detailed info on that specific charge—maybe verifying if it went through or what the status is—you pull up those details using `retrieve_charge` with just its ID. Need to see everything that's happened over the last few days? You hit up `list_charges`; this gives you a paginated list of all charges tied to your account, so you can sort through every transaction without running into limits.

Managing customers is just as important. If you get a brand-new buyer, you run `create_customer` to log them right into the Ping++ system for proper tracking. You can always check out what records you've got with `list_customers`, which gives you an overview of every profile stored. When your agent needs all the deep details on one specific person, they use `retrieve_customer` and just provide the customer ID. It pulls the full profile history.

Handling money coming back is simple too. If a charge needs to be reversed for any reason, you don't care which payment channel was used originally; you just run `create_refund`. You submit that refund request using an existing charge ID, and it processes the return regardless of how the original funds moved.

This setup lets your agent manage every aspect of a transaction flow. It covers everything from initial payments to refunds, all while keeping track of who's buying what. The ability to list charges or retrieve customer profiles means you always have full visibility into past and pending transactions. You don't gotta juggle multiple APIs; it's all under one roof. This makes running e-commerce operations or financial services in China way cleaner. Your agent just talks to the MCP server, and we make sure the money moves across WeChat Pay, Alipay, and UnionPay smoothly.

## Tools

### create_charge
Initiates a new payment request using required details like order number, amount, and channel type.

### create_customer
Adds a brand-new customer record to the Ping++ system for tracking purposes.

### create_refund
Processes and submits a refund request against an existing charge ID.

### list_charges
Fetches a paginated list of all charges associated with your account.

### list_customers
Retrieves a list of all customer profiles stored in the system.

### retrieve_charge
Gets specific, detailed information about one existing charge using its ID.

### retrieve_customer
Retrieves the full profile details for a single customer by their ID.

## Prompt Examples

**Prompt:** 
```
List the last 5 successful charges for my Ping++ app.
```

**Response:** 
```
Here are your last 5 incoming charges across all payment channels. Three originated from WeChat Pay (wx_lite) and two from Alipay. Total amount processing: 12500 CNY.
```

**Prompt:** 
```
Create a new refund of 100 CNY for charge ID ch_xyz789.
```

**Response:** 
```
I've successfully created the refund for charge `ch_xyz789` (Amount: 10000 cents). The status is currently marked as 'pending' with the downstream payment channel.
```

**Prompt:** 
```
Show me the details for customer ID cus_12345.
```

**Response:** 
```
Customer `cus_12345` was created on Oct 12. They have two saved payment methods bound, including one UnionPay source, and an empty balance.
```

## Capabilities

### Process Payments
Use `create_charge` to request payments using specified order IDs and amounts across supported payment channels.

### Manage Customers
Create new customer profiles or list existing ones using `create_customer`, `list_customers`, and `retrieve_customer`.

### Handle Refunds
Process refunds for specific charges with the `create_refund` tool, regardless of which payment channel was used.

### Track Transactions
List or retrieve detailed information on past and pending payments using `list_charges` and `retrieve_charge`.

## Use Cases

### Handling a Failed Order
A user's payment fails on WeChat Pay. Your agent runs `retrieve_charge` first to get the error code, then uses that context to ask the user for an alternate method. Finally, it calls `create_charge` again with the new details, solving the billing failure in three steps.

### Auditing Revenue Streams
You need to report on all revenue from last week. Instead of logging into multiple merchant dashboards, your agent runs `list_charges`. This pulls a consolidated list and identifies which channels (Alipay vs. UnionPay) contributed the most money.

### Customer Onboarding
A new user signs up. Your agent first calls `create_customer` to establish their profile, then uses that ID when running `create_charge`. This ensures all future payments are correctly bound to a tracked account.

### Batch Reconciliation
The finance team needs to verify 50 customer accounts. Instead of logging in individually, the agent runs `list_customers`, gets the IDs, and then uses those IDs with `retrieve_customer` to pull all necessary billing details for reconciliation.

## Benefits

- One API for all payments. Stop building separate integrations for WeChat Pay, Alipay, and UnionPay. Ping++ lets your agent manage them through a single interface.
- Full refund control. Don't need to learn specific gateway APIs to reverse money. Just use `create_refund` on the charge ID, and we handle the rest.
- Customer data consolidation. Use `list_customers` or `retrieve_customer` to track profiles and saved payment methods across multiple channels in one place.
- Comprehensive billing visibility. The `list_charges` tool gives you a history of every transaction—successful, failed, pending—across all connected networks.
- Charge creation is simple. `create_charge` handles the complex initial request flow, taking required inputs like order number and amount to initiate payment.

## How It Works

The bottom line is, it lets your AI client treat multiple payment systems like one unified service layer.

1. Subscribe to the Ping++ server and grab your Secret API Key from the developer dashboard.
2. Inject the server into your AI client. Your agent now sees all 7 payment tools available.
3. Instruct your agent: 'Create a refund of 100 CNY for charge ID ch_xyz.' The agent executes `create_refund` and reports the status back to you.

## Frequently Asked Questions

**How do I list charges using the create_charge tool?**
`list_charges` is the correct tool for seeing history. You use it to get a general record of all transactions, while `create_charge` only initiates a new payment.

**Is Ping++ better than integrating Alipay and WeChat Pay separately?**
Yes. Using Ping++ means you connect your agent once. It unifies the management layer, so you don't write redundant code for different gateways.

**Can I use retrieve_customer to check if a payment was successful?**
No. `retrieve_customer` only gives profile data (like saved methods). For transaction status, you must use `retrieve_charge` with the specific charge ID.

**How do I process refunds using the create_refund tool?**
You need a valid charge ID. The agent runs `create_refund(charge_id=...)`. Ping++ then submits the refund request to the correct payment channel for processing.

**What specific data must I provide when calling the `create_charge` tool?**
You must supply several core parameters, including the order number, amount, and payment channel. The API requires these fields to categorize the charge correctly across all supported networks.

**If I use `retrieve_charge`, how do I determine why a payment failed?**
The response status code tells you the failure reason immediately. Look for specific error codes in the body that detail if the issue was insufficient funds, an invalid order ID, or network refusal.

**How do I authenticate my AI client when using `list_charges`?**
You use your secret API key, which you get from the developer dashboard. Pass this key in the request header for every call to validate access and maintain system security.

**How often should I run `list_customers` for proper customer synchronization?**
You should run this tool periodically—maybe nightly or before a large batch of operations. This keeps your agent's view of customer profiles current and accurate across all platforms.

**Which API Key do I use?**
You must use your Secret Key (Live or Test mode). Do not use the Publishable Key as it lacks permission to perform backend actions across the Ping++ network.

**How do payment channels differ?**
Each channel (e.g. `alipay_web`, `wx_pub`, `upacp`) corresponds to a specific environment (Web, WeChat Official Account, UnionPay App). Provide the appropriate channel string when creating a charge.

**Does this handle RSA Signatures automatically?**
For core operations covered by the standard MCP, API keys are sufficient. Operations requiring dedicated RSA enterprise signing may need custom webhook verifications.