GitHub template for building payment service provider (PSP) integrations for Spryker Commerce OS
A production-ready template for building PSP payment modules for Spryker. Clone it, rename it, implement your PSP-specific logic, and ship a complete payment integration.
This repository serves three distinct use cases - choose your workflow below:
You are: A developer building a PSP integration for a single Spryker project
Your situation:
- Working directly in project codebase (
src/Pyz/namespace) - Don't need to publish as separate composer package
- Want fastest path to implementation
Quick command:
git clone https://github.com/spryker-community/payment-template.git /tmp/payment-template
cd /tmp/payment-template
php rename.php adyen --project-path=/path/to/your-spryker-projectDocumentation: Follow IMPLEMENTATION.md for PSP-specific implementation (assuming you are working in Pyz namespace).
You are: A partner/agency developer creating a reusable payment module for multiple projects
Your situation:
- Building package in custom namespace (e.g.,
Acme,MyCompany) - Will publish as composer package (public or private)
- Need proper versioning and distribution
Quick command:
# Use GitHub template or manual clone (see Quick Start below)
php rename.php adyen --namespace=Acme --in-placeDocumentation: Follow IMPLEMENTATION.md for PSP-specific implementation, then publish to Packagist or private repository.
You are: A project developer integrating an existing PSP module into your Spryker project
Your situation:
- Installing pre-built PSP module via composer
- Need to configure and register plugins
Quick command:
composer require your-org/adyenDocumentation: Follow INTEGRATION.md for installation, configuration, and plugin registration.
- Spryker Eco layer architecture (Shared, Client, Yves, Zed)
- Single module pattern (all logic in one place)
- Production-grade infrastructure code
- Authorize β Capture β Cancel flow
- Synchronous and asynchronous authorization
- Payment method filtering based on PSP availability
- OMS integration with state machines
- Credit Card payment form stub
- Invoice payment form stub
- Easy to customize or add more payment methods
PaymentTemplateCreditCard01.xml- Credit card payment flowPaymentTemplateInvoice01.xml- Invoice payment flow- Includes states: new, processing, authorized, captured, failed, canceled
- Webhook endpoint infrastructure
- Payload logging to database
- Route provider for webhook URLs
- Pre-configured payment method CSV files
- Glossary translations (English, German)
- Store assignments
- Ready-to-use import configuration
- All TODO comments guide implementation
- Automated rename script for quick module setup
- Clear separation: infrastructure vs PSP-specific code
Choose your workflow based on your use case:
For single-project integration in your Pyz namespace:
# Clone template to temporary location
git clone https://github.com/spryker-community/payment-template.git /tmp/payment-template
cd /tmp/payment-template
# Integrate into your project (auto-uses Pyz namespace)
php rename.php adyen --project-path=/path/to/your-spryker-project
# Files are copied to:
# /path/to/project/src/Pyz/Zed/Adyen/
# /path/to/project/src/Pyz/Yves/Adyen/
# /path/to/project/src/Pyz/Client/Adyen/
# /path/to/project/src/Pyz/Shared/Adyen/
# Clean up template directory
rm -rf /tmp/payment-template
# Go to your project and commit
cd /path/to/your-spryker-project
git add src/Pyz
git commit -m "Add Adyen payment integration"Using custom project namespace?
php rename.php adyen --namespace=MyCompany --project-path=/path/to/projectNext: Follow IMPLEMENTATION.md to implement PSP-specific logic.
For building a package to use across multiple projects:
# 1. On GitHub: Click "Use this template" β "Create a new repository"
# Name it after your PSP (e.g., "adyen", "stripe")
# 2. Clone your new repository
git clone https://github.com/your-org/adyen.git
cd adyen
# 3. Rename with your namespace (in-place)
php rename.php adyen --namespace=Acme --in-place
# Module updated:
# - Namespace: Acme
# - Package name: acme/adyen
# - Directory: Already named "adyen"
# 4. Commit and push
git add .
git commit -m "Rename from PaymentTemplate to Adyen"
git push# 1. Clone template
git clone https://github.com/spryker-community/payment-template.git
cd payment-template
# 2. Create module with custom namespace (creates new directory)
php rename.php adyen --namespace=Acme
# New directory created: ../acme/adyen/
# - Namespace: Acme
# - Package name: acme/adyen
# 3. Initialize repository
cd ../acme/adyen
git init
git add .
git commit -m "Initial commit: Adyen payment module"Next: Follow IMPLEMENTATION.md and publish to Packagist or private repository.
# Install via composer
composer require your-org/adyen
# Or for private packages
composer config repositories.adyen vcs https://github.com/your-org/adyen
composer require your-org/adyenNext: Follow INTEGRATION.md for plugin registration and configuration.
Spryker/
βββ Shared/
β βββ YourPsp/
β βββ YourPspConfig.php # Payment method keys, provider name
β βββ YourPspConstants.php # Configuration constants
β βββ Transfer/ # Transfer object definitions
βββ Client/
β βββ YourPsp/
β βββ Api/ # PSP API communication layer
β βββ Authorization/ # Authorization endpoint
β βββ Capture/ # Capture endpoint
β βββ Cancel/ # Cancel endpoint
β βββ PaymentMethods/ # Available methods endpoint
βββ Yves/
β βββ YourPsp/
β βββ Form/ # Payment forms (Credit Card, Invoice)
β βββ Plugin/ # Checkout workflow integration plugins
β βββ Controller/ # Notification controllers
βββ Zed/
βββ YourPsp/
βββ Business/
β βββ Payment/ # Payment operations
β βββ Oms/ # OMS command/condition handlers
β βββ Notification/ # Webhook processing
βββ Communication/
β βββ Plugin/ # Checkout, Payment, OMS plugins
β βββ Controller/ # Gateway controller
βββ Persistence/
βββ Propel/Schema/ # Database schema
βββ YourPspRepository.php
βββ YourPspEntityManager.php
- TODO-Driven Development: All PSP-specific code has TODO comments with implementation guidance
- Status Constant Consistency: Status constants must match across OMS commands, conditions, and config
- Webhook as Source of Truth: Payment state updates primarily through webhooks
- Security First: Webhook signature validation, credential management, sensitive data masking
Note: Implementation steps are the same regardless of workflow. Direct project integration (Pyz namespace) is faster since you skip packaging and versioning concerns.
-
Configuration
- Define payment status constants
- Add API credentials configuration
-
Transfer Objects
- Add PSP-specific fields to transfer schemas
-
Database Schema
- Add PSP-specific columns
- Generate and run migrations
-
API Client
- Implement request/response mappers for each endpoint
- Add authentication headers
- Implement error handling
-
Business Logic
- Implement OMS command handlers (authorize, capture, cancel)
- Implement OMS condition checkers
- Implement webhook processing
- Implement payment method filtering
-
Forms
- Customize payment forms for your PSP
- Add PSP-specific fields and validation
-
Testing
- Write integration tests
- Test with PSP sandbox
- IMPLEMENTATION.md - Implementation guide for module developers
- INTEGRATION.md - Installation guide for project developers
This is a community-maintained template. Contributions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details
- Open an issue: GitHub Issues
- Refer to Spryker documentation: docs.spryker.com
- Consult your payment provider's documentation
- Contact your payment provider's support team
Built a module using this template? Let us know by opening a PR to add your module to this list!
Ready to start? Choose your path: