ecommerce-common
Cross-Platform E-Commerce Plugin Patterns
Overview
E-commerce plugins share a common set of concerns regardless of the target platform. Payment processing, shipping integration, product data modeling, checkout customization, security compliance, and testing strategies follow consistent architectural patterns whether the plugin targets WooCommerce, Shopify, Magento, PrestaShop, or any other platform. This skill provides the foundational patterns that apply universally, enabling faster development and more robust implementations by reusing proven approaches.
Apply these patterns before diving into platform-specific APIs. Each section below describes the core concept and links to detailed reference files for implementation guidance.
Payment Gateway Integration
Payment processing is the most critical and most regulated area of e-commerce plugin development. Every payment gateway plugin must implement four core lifecycle operations:
- Authorize -- Place a hold on funds without capturing them. Store the authorization token for later capture or void.
- Capture -- Collect previously authorized funds. Support partial captures when the gateway allows it.
- Refund -- Return captured funds to the customer. Support partial and full refunds with reason codes.
- Void -- Cancel an authorization before capture. Must be idempotent to handle network retries safely.