From saudi-skills
Integrate Moyasar payment gateway for Saudi Arabia. Covers web (hosted form, custom UI), iOS, Android, Flutter, React Native. Supports cards, Mada, Apple Pay, Samsung Pay, STC Pay. Use when building checkout, payment processing, or payment links.
How this skill is triggered — by the user, by Claude, or both
Slash command
/saudi-skills:moyasarThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Saudi Arabia's primary payment gateway.
Saudi Arabia's primary payment gateway.
Amounts: Always in halalas (1 SAR = 100 halalas). Minimum: 100.
API Keys:
| Key | Prefix | Use |
|---|---|---|
| Publishable | pk_test_ / pk_live_ | Client-side only |
| Secret | sk_test_ / sk_live_ | Server-side only |
Payment Statuses: initiated → paid | failed | authorized → captured → refunded | voided
When status === 'failed', check source.message and source.response_code:
| Code | Reason |
|---|---|
14 | Invalid Card Number |
51 | Insufficient Funds |
54 | Expired Card |
55 | Incorrect PIN |
82 | CVV Validation Error |
96 | System Error |
See errors.md for full error list with English/Arabic translations.
Never trust the client. After payment, Moyasar redirects to your callback_url with status. But users can manipulate URLs, close browsers, or have network issues.
┌─────────────────────────────────────────────────────────────────┐
│ CLIENT SERVER │
│ │
│ 1. User pays via Moyasar ───────────────────────────────────► │
│ │
│ 2. Redirect to callback_url?id=xxx&status=paid │
│ → Show success/failure message (OK for UX) │
│ → But do NOT grant access or confirm purchase yet │
│ │
│ 3. VERIFY before fulfilling: │
│ Option A: Fetch payment │
│ Option B: Webhook │
│ │
│ 4. Grant access / confirm ◄──────────────────────────────── │
│ only after server verifies │
└─────────────────────────────────────────────────────────────────┘
Option A - Fetch Payment (simpler, synchronous):
// On callback, verify with Moyasar API
const payment = await fetch(`https://api.moyasar.com/v1/payments/${id}`, {
headers: { 'Authorization': `Basic ${btoa(process.env.MOYASAR_SECRET_KEY + ':')}` }
}).then(r => r.json());
if (payment.status === 'paid' && payment.amount === expectedAmount) {
// Safe to fulfill
}
Option B - Webhooks (recommended for reliability):
See web.md for complete guide.
Two approaches:
| Approach | Use When |
|---|---|
| Hosted Form | Quick integration, PCI compliance handled |
| Custom UI | Need full design control, willing to handle tokenization |
Quick start (Hosted Form):
<script src="https://cdn.moyasar.com/mpf/1.14.0/moyasar.js"></script>
<link rel="stylesheet" href="https://cdn.moyasar.com/mpf/1.14.0/moyasar.css">
<div class="mysr-form"></div>
<script>
Moyasar.init({
element: '.mysr-form',
amount: 10000,
currency: 'SAR',
description: 'Order #123',
publishable_api_key: process.env.MOYASAR_PUBLISHABLE_KEY,
callback_url: 'https://yoursite.com/callback',
methods: ['creditcard', 'applepay', 'stcpay'],
metadata: { order_id: '123' } // Link payment to your order
});
</script>
| Platform | Reference | Package |
|---|---|---|
| iOS | ios.md | MoyasarSdk (SPM/CocoaPods) |
| Android | android.md | com.github.Moyasar:moyasar-android-sdk |
| Flutter | flutter.md | moyasar (pub.dev) |
| React Native | react-native.md | react-native-moyasar-sdk |
See api.md for:
| File | When to Read |
|---|---|
| web.md | Building web checkout (hosted form, custom UI, Apple Pay, STC Pay) |
| ios.md | iOS app integration |
| android.md | Android app integration |
| flutter.md | Flutter app integration |
| react-native.md | React Native app integration |
| api.md | Server-side operations (verify, refund, capture, tokens, invoices) |
| webhooks.md | Setting up payment webhooks |
| errors.md | Error codes with English/Arabic translations |
| test-data.md | Test cards, STC Pay Testing, Apple Pay Testing |
order_id to link payment back to your systemsecret_token in request bodygiven_id (UUID) when creating payment to prevent duplicate charges on retry/.well-known/apple-developer-merchantid-domain-associationnpx claudepluginhub khaled-harthi/saudi-skills --plugin payment-skillsGuides developers through integrating Paymob payment gateway. Covers Intention API, Unified Checkout, Pixel SDK, HMAC validation, webhooks, subscriptions, and regional endpoints for Egypt, KSA, UAE, Oman.
Expert-level Payme payment system integration skill for Uzbekistan's Payme Business platform. Use this skill whenever the user mentions Payme, Paycom, payment integration in Uzbekistan, Merchant API, Subscribe API, to'lov tizimi, to'lov integratsiyasi, Payme checkout, Payme kassa, online to'lov, plastik karta to'lovi, chek yaratish, tranzaksiya, or any payment-related development for Uzbek market. Also trigger when user asks about JSON-RPC payment APIs, fiscalization (fiskalizatsiya), IKPU codes, or O'zbekiston to'lov tizimlari. This skill covers both Merchant API (server-to-server) and Subscribe API (card tokenization + receipts), sandbox testing, error handling, and production deployment. Trigger even for partial mentions like "payme", "paycom", "checkout.paycom.uz", or "merchant api" in any language (Uzbek, Russian, English).
Integrates Stripe, PayPal, and Square for checkout flows, subscriptions, webhooks, and PCI compliance. Use when implementing payment or billing features.