shora-ai-payment-sdk
Version:
The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible
82 lines • 2.17 kB
TypeScript
import { AxiosInstance } from 'axios';
export interface PaymentRequest {
amount: number;
currency: string;
description?: string;
customer?: {
email: string;
name?: string;
};
metadata?: Record<string, any>;
}
export interface PaymentResponse {
id: string;
status: 'pending' | 'completed' | 'failed' | 'cancelled';
amount: number;
currency: string;
payment_url?: string;
created_at: string;
updated_at: string;
}
export interface ACPCheckoutRequest {
amount: number;
currency: string;
description?: string;
customer?: {
email: string;
name?: string;
metadata?: Record<string, any>;
};
metadata?: Record<string, any>;
agent_id?: string;
business_id?: string;
product_id?: string;
quantity?: number;
shipping_address?: {
line1: string;
line2?: string;
city: string;
state?: string;
postal_code: string;
country: string;
};
}
export interface ACPCheckoutResponse {
checkout_id: string;
status: 'pending' | 'completed' | 'failed' | 'cancelled';
amount: number;
currency: string;
checkout_url: string;
expires_at: string;
created_at: string;
updated_at: string;
agent_id?: string;
business_id?: string;
payment_token?: string;
}
export declare class PaymentService {
private client;
private circuitBreaker;
private cache;
constructor(client: AxiosInstance);
/**
* Create a payment session for regular payments
*/
createPaymentSession(request: PaymentRequest): Promise<PaymentResponse>;
/**
* Process a payment using a payment session
* Enhanced with retry logic for reliability
*/
processPayment(sessionId: string, paymentMethod: string, cardToken?: string): Promise<PaymentResponse>;
/**
* Create an ACP-compatible checkout session
*/
createACPCheckout(request: ACPCheckoutRequest): Promise<ACPCheckoutResponse>;
/**
* Perform a health check on the API
*/
healthCheck(): Promise<{
status: string;
}>;
}
//# sourceMappingURL=payments.d.ts.map