@joyida/payme
v0.2.0
Published
Zero-dependency, fully typed client SDK for Payme Merchant API - Integrate Payme payments into your Bun backend with JSON-RPC 2.0
Maintainers
Readme
@joyida/payme
Zero-dependency, fully typed SDK for Payme Merchant API and Subscribe API
Integrate Payme payments and card tokenization into your Bun application with JSON-RPC 2.0 protocol.
Features
- 🚀 Zero dependencies
- 💪 Fully typed with TypeScript
- 📦 JSON-RPC 2.0 protocol
- 🔒 Type-safe payment operations
- 💳 Card tokenization (Subscribe API)
- 🧾 Receipt management (Subscribe API)
- 🌍 Localized error messages (RU, UZ, EN)
- ✅ Built-in validation
- 📦 ESM + CommonJS support
- ⚡ Optimized for Bun runtime
- 📦 Bundle size < 15KB
Installation
bun add @joyida/paymeQuick Start
Merchant API (Payment Processing)
import { PaymeMerchant } from '@joyida/payme';
const payme = new PaymeMerchant({
secretKey: 'your_secret_key',
});
// Check if payment is possible
const check = await payme.checkPerformTransaction({
amount: 500000, // 5000 so'm (in tiyin)
account: { order_id: 'ORD-123' }
});
if (check.allow) {
console.log('Payment allowed');
}Subscribe API (Card Tokenization)
import { PaymeSubscribe } from '@joyida/payme';
// Client-side mode (for card tokenization)
const subscribe = new PaymeSubscribe({
merchantId: 'your_merchant_id'
}, 'client');
// Create card token
const result = await subscribe.cardsCreate({
card: {
number: '8600069195406311',
expire: '0399'
},
save: true
});
console.log(result.card.token); // Use for paymentsDocumentation
Live docs: joyida.github.io/payme (after GitHub Pages is enabled; see below)
Source / edit locally → — bun run docs:dev
- Getting started · Configuration · Authentication
- Merchant API · Subscribe API
- Error handling · Validation · Error code examples
- Payment flow · Card tokenization · Testing
Bundle Size
- ~8.8KB minified (CommonJS)
- ~25KB minified (ESM)
- ~3KB gzipped
- Zero dependencies
Requirements
- Bun >= 1.3.9 (required; this package is tested and supported only on Bun)
Links
License
MIT © Joyida Team
Support
Made with ❤️ for Uzbekistan developers
