SDK Reference
The Vexor SDK provides a comprehensive set of methods to handle payments, subscriptions, and account connections across multiple payment platforms. This reference covers all available methods and initialization options.
Installation
Initialization
There are three ways to initialize a Vexor instance:
- Using the constructor - Direct instantiation with configuration parameters
- Using Vexor.init() - Static initialization method
- Using Vexor.fromEnv() - Initialize from environment variables
Available Methods
Payment Processing
- vexor.pay() - Create payment checkouts
- vexor.subscribe() - Create subscription checkouts
- vexor.refund() - Process refunds
- vexor.portal() - Create billing portal sessions
Merchant Management
- vexor.connect() - Connect merchant accounts
Webhooks
- vexor.webhook() - Handle platform webhooks
Most methods support both a generic interface and platform-specific shortcuts (e.g., vexor.pay.stripe()
, vexor.pay.mercadopago()
, vexor.pay.paypal()
, vexor.pay.talo()
).
Supported Platforms
The SDK currently supports the following payment platforms:
- Stripe
- MercadoPago
- PayPal
- Square
- Talo
Each platform may have specific features and requirements. Refer to the individual method documentation for platform-specific details.
Type Safety
The SDK is written in TypeScript and provides full type definitions for all methods and responses. This ensures type safety and better developer experience with IDE autocompletion.
Remember to keep your secret keys secure and never expose them in client-side code. Use environment variables and server-side implementations for sensitive operations.