ahsanatha

Mayar Payment Integration

開發程式設計v1.0.0
作者:ahsanatha更新於 2026-05-18mayar-payment@clawhub_ahsanatha/mayar-payment
後端開發指令碼工具#Payment#Wallet#WhatsApp

據 AlphaMoat 統計,截至 2026-09,Mayar Payment Integration 累計下載 3,038 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 3,703 位,在「開發程式設計」分類(577 個)中排名第 469 位。

累計安裝
101
累計下載
3038
星標
-
全站排名
#3,703
全站前 73% · 「開發程式設計」前 82%
平台累計安裝累計下載星標評論
ClawHub ↗1013038--
SkillHub ↗1013028-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

工作流需要 Mayar API token,並可能處理客戶姓名、聯絡資訊、金額及交易狀態。令牌不應寫入命令引數或提交到程式碼庫;建立付款請求、傳送訊息或確認履約前,應核對客戶、金額、授權和付款狀態,並保護客戶隱私。

資料釋出於 2026-10-29

可以用來做什麼

  • 概述建立付款連結和檢查交易狀態的流程。
  • 梳理訂閱或印尼付款方式的整合需求。
  • 設計向客戶傳送付款訊息前的授權與隱私檢查。

什麼時候用

  • 需要接入 Mayar.id 發票或付款連結流程時。
  • 需要查詢交易或訂閱狀態時。
  • 涉及客戶資料、API token、真實付款或 WhatsApp 訊息時,先確認最小許可權、金額、收件人及支付結果。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

總結 Mayar Payment 的發票、交易跟蹤和訊息功能,並列出憑據與客戶資料保護要求。
為建立付款連結和傳送客戶訊息設計一份不執行交易的確認清單。

月度資料趨勢

累計下載3038
1826247731282026-03 · 累計下載 19162026-05 · 累計下載 26032026-07 · 累計下載 28972026-08 · 累計下載 29582026-09 · 累計下載 303826-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093038—-
2026-082958+2.1%-
2026-072897—-
2026-052603—-
2026-031916—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

5.5 KB · ClawHub v1.0.0
---
name: mayar-payment
description: Mayar.id payment integration for generating invoices, payment links, and tracking transactions via MCP. Use when needing to: (1) Create payment invoices/links for customers, (2) Track payment status and transactions, (3) Generate WhatsApp-friendly payment messages, (4) Handle Indonesian payment methods (bank transfer, e-wallet, QRIS), (5) Manage subscriptions/memberships, or (6) Automate payment workflows for e-commerce, services, or digital products.
---

# Mayar Payment Integration

Integrate Mayar.id payment platform via MCP (Model Context Protocol) for Indonesian payment processing.

## Prerequisites
展開全部(共 235 行)

1. **Mayar.id account** - Sign up at https://mayar.id
2. **API Key** - Generate from https://web.mayar.id/api-keys
3. **mcporter configured** - MCP must be set up in Clawdbot

## Setup

### 1. Store API Credentials

```bash
mkdir -p ~/.config/mayar
cat > ~/.config/mayar/credentials << EOF
MAYAR_API_TOKEN="your-jwt-token-here"
EOF
chmod 600 ~/.config/mayar/credentials
```

### 2. Configure MCP Server

Add to `config/mcporter.json`:

```json
{
  "mcpServers": {
    "mayar": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.mayar.id/sse",
        "--header",
        "Authorization:YOUR_API_TOKEN_HERE"
      ]
    }
  }
}
```

Replace `YOUR_API_TOKEN_HERE` with actual token.

### 3. Test Connection

```bash
mcporter list mayar
```

Should show 15+ available tools.

## Core Workflows

### Create Invoice with Payment Link

**Most common use case:** Generate payment link for customer.

```bash
mcporter call mayar.create_invoice \
  name="Customer Name" \
  email="[email protected]" \
  mobile="\"628xxx\"" \
  description="Order description" \
  redirectURL="https://yoursite.com/thanks" \
  expiredAt="2026-12-31T23:59:59+07:00" \
  items='[{"quantity":1,"rate":500000,"description":"Product A"}]'
```

**Returns:**
```json
{
  "id": "uuid",
  "transactionId": "uuid", 
  "link": "https://subdomain.myr.id/invoices/slug",
  "expiredAt": 1234567890
}
```

**Key fields:**
- `mobile` - MUST be string with quotes: `"\"628xxx\""`
- `expiredAt` - ISO 8601 format with timezone
- `items` - Array of `{quantity, rate, description}`
- `redirectURL` - Where customer goes after payment

### WhatsApp Integration Pattern

```javascript
// 1. Create invoice
const invoice = /* mcporter call mayar.create_invoice */;

// 2. Format message
const message = `
✅ *Order Confirmed!*

*Items:*
• Product Name
  Rp ${amount.toLocaleString('id-ID')}

*TOTAL: Rp ${total.toLocaleString('id-ID')}*

💳 *Pembayaran:*
${invoice.data.link}

⏰ Berlaku sampai: ${expiryDate}

Terima kasih! 🙏
`.trim();

// 3. Send via WhatsApp
message({
  action: 'send',
  channel: 'whatsapp',
  target: customerPhone,
  message: message
});
```

### Check Payment Status

```bash
# Get latest transactions (check if paid)
mcporter call mayar.get_latest_transactions page:1 pageSize:10

# Get unpaid invoices
mcporter call mayar.get_latest_unpaid_transactions page:1 pageSize:10
```

Filter by status: `"created"` (unpaid) → `"paid"` (success).

### Other Operations

```bash
# Check account balance
mcporter call mayar.get_balance

# Get customer details
mcporter call mayar.get_customer_detail \
  customerName="Name" \
  customerEmail="[email protected]" \
  page:1 pageSize:10

# Filter by time period
mcporter call mayar.get_transactions_by_time_period \
  page:1 pageSize:10 \
  period:"this_month" \
  sortField:"createdAt" \
  sortOrder:"DESC"
```

## Common Patterns

### Multi-Item Invoice

```javascript
items='[
  {"quantity":2,"rate":500000,"description":"Product A"},
  {"quantity":1,"rate":1000000,"description":"Product B"}
]'
// Total: 2M (2×500K + 1×1M)
```

### Subscription/Recurring

Use membership tools:

```bash
mcporter call mayar.get_membership_customer_by_specific_product \
  productName:"Premium Membership" \
  productLink:"your-product-link" \
  productId:"product-uuid" \
  page:1 pageSize:10 \
  memberStatus:"active"
```

### Payment Confirmation Flow

**Option A: Webhook** (Real-time)
- Register webhook URL with Mayar
- Receive instant payment notifications
- Best for production

**Option B: Polling** (Simpler)
- Poll `get_latest_transactions` every 30-60s
- Check for new payments
- Best for MVP/testing

## Troubleshooting

**404 on payment link:**
- Link format: `https://your-subdomain.myr.id/invoices/slug`
- Check dashboard for correct subdomain
- Default may be account name

**Invalid mobile number:**
- Mobile MUST be string: `"\"628xxx\""` (with escaped quotes)
- Format: `628xxxxxxxxxx` (no + or spaces)

**Expired invoice:**
- Default expiry is `expiredAt` timestamp
- Customer can't pay after expiration
- Create new invoice if needed

## Reference Documentation

- **API Details:** See [references/api-reference.md](references/api-reference.md)
- **Integration Examples:** See [references/integration-examples.md](references/integration-examples.md)
- **MCP Tools Reference:** See [references/mcp-tools.md](references/mcp-tools.md)

## Production Checklist

- [ ] Use production API key (not sandbox)
- [ ] Setup webhook for payment notifications
- [ ] Error handling for failed invoice creation
- [ ] Store invoice IDs for tracking
- [ ] Handle payment expiration
- [ ] Customer database integration
- [ ] Receipt/confirmation automation

## Environments

**Production:**
- Dashboard: https://web.mayar.id
- API Base: `https://api.mayar.id/hl/v1/`

**Sandbox (Testing):**
- Dashboard: https://web.mayar.club
- API Base: `https://api.mayar.club/hl/v1/`

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。