This framework is in BETA stage. It’s recommended for connectors with rollout dates at least 3 months away to allow time for investigation and prioritization of any new scenarios.
What is the Payment Provider Framework?
The VTEX Payment Provider Framework is a powerful toolkit for building payment connectors that integrate with the VTEX e-commerce platform. It implements the Payment Provider Protocol and provides all the infrastructure you need to process payments securely and efficiently. Built on VTEX IO, the framework handles the complexity of payment processing, allowing you to focus on integrating with your specific payment gateway.Key features
Payment Provider Protocol
Complete implementation of VTEX’s standardized payment protocol with automatic route generation and type-safe interfaces
Multiple payment methods
Support for credit cards, debit cards, bank invoices, and custom payment methods with flexible configuration
Secure Proxy for PCI compliance
Process card payments without PCI certification by routing sensitive data through VTEX’s secure proxy
Split payment support
Built-in capabilities for payment splitting across multiple recipients on authorization or capture
OAuth configuration flow
Streamlined authentication setup with optional OAuth support for merchant onboarding
Async payment handling
Retry mechanism for asynchronous payment flows with automatic callback management
VBase persistence
Integrated state management using VTEX VBase for storing payment data and transaction history
Type-safe development
Full TypeScript support with comprehensive type definitions for all protocol entities
How it works
The framework provides an abstractPaymentProvider class that you extend with your custom implementation. Each payment operation (authorize, cancel, refund, settle) is implemented as a method that receives strongly-typed request objects and returns response objects.
node/connector.ts
PaymentProviderService automatically sets up all required routes and handles protocol compliance:
node/index.ts
Payment flow overview
Here’s how a typical payment transaction flows through your connector:Customer places order
The customer completes checkout and submits payment information through the VTEX storefront
Payment authorization
VTEX Gateway calls your connector’s
/payments endpoint with an AuthorizationRequest containing payment detailsProcess with gateway
Your connector communicates with your payment gateway to authorize the transaction
Return response
Your connector returns an
AuthorizationResponse indicating approval, denial, or pending statusSupported payment methods
Configure which payment methods your connector accepts inpaymentProvider/configuration.json:
paymentProvider/configuration.json
Architecture benefits
Built on VTEX IO: Leverage the full VTEX IO platform with automatic scaling, monitoring, and deployment pipelines. Type safety: TypeScript interfaces ensure your implementation matches the protocol specification, catching errors at compile time. Security by default: Sensitive card data is tokenized and routed through Secure Proxy, keeping your connector PCI compliant without certification. State management: VBase integration provides reliable persistence for async operations and transaction tracking. Extensibility: Add custom routes, clients, and middleware while maintaining protocol compliance.Get started
Prerequisites
Set up your development environment and install required tools
Quick start
Build your first payment connector in minutes
API reference
Explore the complete API documentation
Testing guide
Learn how to test your connector with the VTEX test suite
Community and support
Join the VTEX developer community for help and updates:- GitHub: vtex-apps/payment-provider-example
- Developer Portal: developers.vtex.com
- Help Center: Payment Provider Protocol documentation