JSPM

  • Created
  • Published
  • Downloads 48
  • Score
    100M100P100Q95752F
  • License MIT

The first open-source payment SDK designed specifically for AI agents and chatbots

Package Exports

  • shora-ai-payment-sdk
  • shora-ai-payment-sdk/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shora-ai-payment-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿš€ Shora AI Payment SDK

Commerce infrastructure for the AI era

npm version GitHub stars License: MIT TypeScript

The first open-source payment SDK designed specifically for AI agents and chatbots

๐Ÿ“– Documentation โ€ข ๐ŸŽฎ Live Demo โ€ข ๐Ÿ’ฌ Discord โ€ข ๐Ÿฆ Twitter

โšก Quickstart (30 seconds)

# Install the SDK
npm install shora-ai-payment-sdk

# Or with yarn
yarn add shora-ai-payment-sdk
import ShoraSDK from 'shora-ai-payment-sdk';

// Initialize with your API key
const shora = new ShoraSDK({
  apiKey: 'your_api_key_here',
  environment: 'sandbox' // or 'production'
});

// Create a payment session for your AI agent
const session = await shora.createPaymentSession({
  amount: 2999, // $29.99 in cents
  currency: 'USD',
  description: 'AI Agent Subscription',
  customer: {
    email: 'user@example.com',
    name: 'John Doe'
  }
});

console.log('Payment URL:', session.payment_url);

๐Ÿ“ฆ NPM Package

Install: npm install shora-ai-payment-sdk
Import: import ShoraSDK from 'shora-ai-payment-sdk'
TypeScript: Full TypeScript support included

Basic Usage

import ShoraSDK from 'shora-ai-payment-sdk';

const shora = new ShoraSDK({
  apiKey: process.env.SHORA_API_KEY,
  environment: 'sandbox'
});

// Your AI agent is ready to process payments!

๐ŸŽฎ Live Demo

Try it now: demo.shora.co

  • ๐Ÿค– AI Chatbot Integration - See how AI agents process payments
  • ๐Ÿ’ณ Real Payment Flow - Complete checkout experience
  • ๐Ÿ”ง Developer Tools - API explorer and code examples
  • ๐Ÿ“Š Analytics Dashboard - Transaction monitoring

๐Ÿš€ Why Shora?

Feature Traditional SDKs Shora SDK
AI Agent Ready โŒ โœ… Built for AI
Mandate Management โŒ โœ… Agent Authorization
Token-based Payments โŒ โœ… Secure Tokens
Real-time Webhooks โŒ โœ… Instant Notifications
Multi-currency Limited โœ… Global Support
Open Source โŒ โœ… MIT License

โœจ Features

๐Ÿค– AI Agent Features

  • Mandate Management: Create, activate, and cancel payment mandates for AI agents
  • Token Generation: Secure payment tokens with TTL for agent transactions
  • Checkout Sessions: Complete shopping cart management for AI agents
  • Payment Processing: Token-based payments with PSP routing and failover
  • Agent Integration: Direct integration with AI agents and chatbots

๐Ÿ”’ Enterprise Features

  • Multi-tenant Support: Isolated data per organization
  • Audit Logs: Complete transaction audit trail
  • Custom Webhooks: Real-time payment event notifications
  • Rate Limiting: Tier-based API access control
  • OAuth2 + API Key: Hybrid authentication system

๐ŸŒ Global Support

  • Multi-currency: USD, EUR, TRY, GBP, and more
  • Turkish PSPs: PayTR, ฤฐyzico, Papara integration
  • Global PSPs: Stripe, PayPal, Adyen support
  • Real-time: Instant payment confirmations

๐ŸŽฏ Use Cases

๐Ÿค– AI Chatbots & Agents

// AI agent processes payment
const payment = await shora.agents.pay({
  token: agentToken,
  amount: 150.00,
  currency: 'USD',
  description: 'AI Service Subscription'
});

๐Ÿ›’ E-commerce Integration

// E-commerce checkout
const session = await shora.createPaymentSession({
  amount: 9999, // $99.99
  currency: 'USD',
  customer: { email: 'customer@example.com' },
  items: [
    { name: 'Premium Plan', price: 9999, quantity: 1 }
  ]
});

๐Ÿ”„ Subscription Management

// Recurring payments
const mandate = await shora.agents.createMandate({
  agent_id: 'subscription-bot',
  max_amount: 5000.00,
  currency: 'USD',
  expires_at: '2025-12-31T23:59:59Z'
});

๐Ÿš€ Getting Started

1. Get Your API Key

Free Tier: Get started for free

  • 100 transactions/month
  • Sandbox environment
  • Basic support

Pro Tier: Upgrade to Pro

  • 10,000 transactions/month
  • Production environment
  • Priority support
  • Advanced features

2. Install the SDK

npm install shora-ai-payment-sdk

3. Initialize and Start Building

import ShoraSDK from 'shora-ai-payment-sdk';

const shora = new ShoraSDK({
  apiKey: process.env.SHORA_API_KEY,
  environment: 'sandbox'
});

// Your AI agent is ready to process payments!

๐Ÿ“š API Reference

๐Ÿค– Agent Payment Endpoints

Endpoint Method Description
/v2/agents/mandates POST Create payment mandate
/v2/agents/tokens POST Generate payment token
/v2/agents/checkout-sessions POST Create checkout session
/v2/agents/pay POST Process payment
/v2/agents/mandates/{id} GET Get mandate details
/v2/agents/payments/{id} GET Get payment details

๐Ÿ’ณ Payment Endpoints

Endpoint Method Description
/v2/payments/sessions POST Create payment session
/v2/payments/process POST Process payment
/v2/payments/refund POST Refund payment
/v2/transactions/{id} GET Get transaction details
/v2/transactions GET List transactions

๐Ÿ”— Webhook Endpoints

Endpoint Method Description
/v2/webhooks POST Create webhook
/v2/webhooks/{id}/test POST Test webhook
/v2/webhooks/events GET List webhook events

๐Ÿ’ก Example Usage

Basic Payment Flow

// 1. Create payment session
const session = await shora.createPaymentSession({
  amount: 2999, // $29.99
  currency: 'USD',
  description: 'AI Service Subscription',
  customer: {
    email: 'user@example.com',
    name: 'John Doe'
  }
});

// 2. Process payment
const payment = await shora.processPayment({
  sessionId: session.id,
  paymentMethod: 'card',
  cardToken: 'tok_1234567890'
});

// 3. Handle webhook
app.post('/webhook', (req, res) => {
  const event = req.body;
  if (event.type === 'payment.completed') {
    console.log('Payment completed:', event.data);
  }
});

AI Agent Integration

// AI agent creates mandate
const mandate = await shora.agents.createMandate({
  agent_id: 'chatbot-123',
  max_amount: 1000.00,
  currency: 'USD',
  expires_at: '2025-12-31T23:59:59Z'
});

// Generate secure token
const token = await shora.agents.generateToken({
  mandate_id: mandate.id,
  amount: 150.00,
  currency: 'USD'
});

// Process payment with token
const payment = await shora.agents.pay({
  token: token.value,
  amount: 150.00,
  currency: 'USD'
});

๐ŸŽฎ Demo & Examples

Live Demo

Try it now: demo.shora.co

Local Demo

# Clone the repository
git clone https://github.com/shoraco/shora-ai-payment-sdk
cd shora-ai-payment-sdk

# Install dependencies
npm install

# Run the demo
npm run demo

Demo Features

  1. ๐Ÿค– AI Chatbot - Interactive payment flow
  2. ๐Ÿ’ณ Payment Processing - Real payment simulation
  3. ๐Ÿ”” Webhook Handling - Real-time notifications
  4. ๐Ÿ“Š Analytics - Transaction monitoring
  5. ๐Ÿ”ง Developer Tools - API explorer

๐Ÿข Enterprise Features

๐Ÿ” Advanced Security

  • OAuth2 + API Key: Hybrid authentication system
  • Multi-tenant: Isolated data per organization
  • Audit Logs: Complete transaction audit trail
  • Rate Limiting: Tier-based API access control

๐Ÿ“Š Analytics & Monitoring

  • Real-time Dashboard: app.shora.cloud
  • Transaction Analytics: Revenue tracking and insights
  • Webhook Management: Custom event notifications
  • Performance Monitoring: API response times and uptime

๐ŸŒ Global Infrastructure

  • Multi-currency: USD, EUR, TRY, GBP, and more
  • Turkish PSPs: PayTR, ฤฐyzico, Papara integration
  • Global PSPs: Stripe, PayPal, Adyen support
  • Cloudflare CDN: Worldwide low-latency access

๐Ÿ’ฐ Pricing

Plan Price Transactions Features
Free $0/month 100/month Sandbox, Basic Support
Pro $99/month 10,000/month Production, Priority Support, Analytics
Enterprise $499/month 100,000/month Custom Integration, SLA, Dedicated Support

Get started: app.shora.cloud/signup

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Agent      โ”‚โ”€โ”€โ”€โ–ถโ”‚  Shora SDK     โ”‚โ”€โ”€โ”€โ–ถโ”‚  Shora Core    โ”‚
โ”‚   (Chatbot)     โ”‚    โ”‚                 โ”‚    โ”‚  (Payment      โ”‚
โ”‚                 โ”‚    โ”‚  Mandate        โ”‚    โ”‚   Processing)   โ”‚
โ”‚                 โ”‚    โ”‚  Management     โ”‚    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚   Turkish PSPs  โ”‚
                       โ”‚   (PayTR,       โ”‚
                       โ”‚    ฤฐyzico,      โ”‚
                       โ”‚    Papara)      โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Security

  • Token-based Authentication: Secure payment tokens with TTL
  • Mandate Validation: AI agent authorization verification
  • PCI Compliance: No PCI data exposure
  • Rate Limiting: Built-in request rate limiting
  • Webhook Security: HMAC signature verification

Development

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Shora Core API access

Local Development

# Install dependencies
npm install

# Copy environment file
cp env.example .env

# Start development server
npm run dev

# Run tests
npm test

# Run demo
npm run demo

Enterprise Development

# Run all tests
npm run test

# Run load tests
npm run test:load

# Run security tests
npm run test:security

# Run linting
npm run lint

# Build for production
npm run build

Environment Variables

SHORA_API_KEY=your_api_key_here
SHORA_BASE_URL=https://api.shora.cloud
SHORA_WEBHOOK_SECRET=your_webhook_secret

License

MIT License - see LICENSE file for details.

Support

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Roadmap

  • Webhook handling for payment events
  • Multi-currency support
  • Advanced fraud detection
  • Real-time payment status updates
  • Integration with popular AI frameworks

๐Ÿš€ Community & Support

๐Ÿ“š Resources

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support


โญ Star this repository if you find it helpful!

GitHub stars GitHub forks

Made with โค๏ธ by the Shora Team


Shora AI Payment SDK - Commerce infrastructure for the AI era