Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Payment Core Bundle Laravel Package

jms/payment-core-bundle

Symfony bundle providing a unified API for processing payments across multiple providers. Includes persistence for payments/transactions, retryable transaction management, encryption of sensitive data, and built-in support for many backends with easy extensibility.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Abstraction Layer: Provides a unified API for multiple payment gateways (Stripe, Mollie, PayPal, etc.), reducing vendor lock-in and simplifying future migrations.
    • Symfony Integration: Deeply integrated with Symfony’s ecosystem (Doctrine ORM, Dependency Injection, Forms, Console), making it a natural fit for Symfony-based applications.
    • Persistence & Encryption: Built-in support for storing payment data (e.g., transactions, refunds) with optional encryption (via defuse/php-encryption), addressing compliance (PCI DSS) and security concerns.
    • Transaction Management: Retry logic and exception handling for payment operations, improving reliability.
    • Extensibility: Supports custom payment backends and encryption providers, allowing tailored solutions.
  • Cons:

    • Legacy Codebase: Last release in 2019 with no recent updates, raising concerns about long-term maintenance and compatibility with modern Symfony (6.x/7.x) or PHP (8.x).
    • Deprecated Dependencies: Relies on mcrypt (deprecated in PHP 7.2) and lacks explicit PHP 8.x support, which could introduce compatibility risks.
    • Limited Adoption: No dependents (0) suggests niche usage or potential abandonment. The 194 stars may reflect historical relevance rather than active community support.
    • Symfony Version Lag: Officially supports up to Symfony 4, but untested on newer versions (5.x/6.x/7.x) may require manual fixes.

Integration Feasibility

  • Symfony Stack Compatibility:

    • Works seamlessly with Symfony 2.3–4.x. For Symfony 5/6/7, expect minor adjustments (e.g., autowiring, configuration syntax) based on changelogs.
    • Requires Doctrine ORM for persistence (not Doctrine DBAL), which may limit use in non-Doctrine projects.
    • PHP 5.6+ required; PHP 8.x may need polyfills or patches for deprecated functions (e.g., mcrypt).
  • Database Schema:

    • Introduces its own entities (e.g., Payment, Transaction, Refund) for storing payment data. Requires schema migrations or manual table creation.
    • Encryption adds overhead for sensitive fields (e.g., card numbers), impacting query performance.
  • Payment Gateway Support:

    • Supports 10+ gateways (Stripe, Mollie, PayPal, etc.) via third-party bundles, but these may also be outdated. Verify active maintenance of gateway bundles.
    • Custom gateways require implementing PaymentPluginInterface, which is documented but may need testing.

Technical Risk

  • High:

    • Deprecation Risks: mcrypt removal in PHP 8.x and lack of recent updates could break production systems. Migration to defuse/php-encryption is recommended but untested in modern setups.
    • Symfony Version Drift: Untested on Symfony 5/6/7; potential BC breaks in DI, forms, or Doctrine integrations.
    • Security: Encryption is optional by default, which may violate PCI DSS requirements. Misconfiguration could expose sensitive data.
    • Performance: Persistence of all transactions/refunds could bloat the database over time. Consider archiving strategies.
    • Testing: No recent releases or CI updates suggest limited QA for edge cases (e.g., retries, refunds, webhooks).
  • Mitigation:

    • Fork and Maintain: If adopting, fork the repo to apply PHP 8.x/Symfony 6.x patches proactively.
    • Isolate Dependencies: Use Docker or VMs to test compatibility before production deployment.
    • Audit Gateways: Verify third-party bundles (e.g., jms/payment-stripe-bundle) are actively maintained.
    • Backup Schema: Document current payment workflows before migration to avoid data loss.

Key Questions

  1. Symfony Version:
    • Is Symfony 5/6/7 support critical? If yes, budget time for manual testing/fixes.
  2. Payment Gateways:
    • Which gateways are needed? Are their bundles actively maintained?
  3. Compliance:
    • Does the encryption setup meet PCI DSS requirements? If not, can defuse/php-encryption be configured securely?
  4. Data Retention:
    • How will transaction data be archived/pruned to avoid database bloat?
  5. Fallbacks:
    • What’s the plan for payment failures (e.g., retries, manual overrides)?
  6. Team Skills:
    • Does the team have experience with Symfony bundles and payment integrations?
  7. Alternatives:
    • Have modern alternatives (e.g., Laravel Cashier, Omnipay) been evaluated for lower risk?

Integration Approach

Stack Fit

  • Symfony Projects:
    • Best Fit: Ideal for Symfony 2.3–4.x applications needing multi-gateway payment support with minimal code duplication.
    • Partial Fit: Symfony 5/6/7 projects may require patches for autowiring, configuration, or PHP 8.x compatibility.
  • Non-Symfony Projects:
    • Not Recommended: Tight coupling with Symfony components (e.g., Forms, DI) makes porting to Laravel/Drupal difficult.
  • Tech Stack Requirements:
    • PHP 5.6+ (PHP 8.x may need adjustments).
    • Doctrine ORM (not DBAL) for persistence.
    • Composer for dependency management.
    • Database: Supports MySQL, PostgreSQL, SQLite (via Doctrine).

Migration Path

  1. Assessment Phase:
    • Audit current payment workflows (e.g., gateways, data storage, error handling).
    • Verify Symfony/PHP version compatibility; create a compatibility matrix.
  2. Setup:
    • Install via Composer:
      composer require jms/payment-core-bundle
      
    • Configure config/packages/jms_payment_core.yaml (see docs).
    • Set up encryption (if needed) with defuse/php-encryption:
      composer require defuse/php-encryption
      bin/console jms:payment:generate-encryption-key
      
  3. Database Migration:
    • Run Doctrine migrations to create payment tables:
      bin/console doctrine:migrations:diff
      bin/console doctrine:migrations:migrate
      
    • Alternatively, manually import SQL schema from Resources/doc/schema.sql.
  4. Gateway Integration:
    • Install required gateway bundles (e.g., jms/payment-stripe-bundle).
    • Configure gateway-specific settings in config/packages/jms_payment_*.yaml.
  5. Application Integration:
    • Replace custom payment logic with the bundle’s API (e.g., PluginController, PaymentService).
    • Update forms to use ChoosePaymentForm for gateway selection.
    • Implement webhook handlers for async events (e.g., payment confirmations).
  6. Testing:
    • Test all payment flows (capture, refund, void) with sandbox/gateway APIs.
    • Verify encryption/decryption of sensitive data.
    • Load-test transaction persistence under high volume.

Compatibility

  • Symfony:
    • 2.3–4.x: Full support; minimal configuration.
    • 5.x/6.x/7.x: Partial support; expect issues with autowiring, configuration, or PHP 8.x deprecations.
  • PHP:
    • 5.6–7.4: Officially supported.
    • 8.x: Untested; may require patches for mcrypt removal or JIT issues.
  • Gateways:
    • Third-party bundles (e.g., Stripe, Mollie) may have their own compatibility constraints.
  • Doctrine:
    • Requires ORM (not DBAL). Custom repositories or queries may need adjustments.

Sequencing

  1. Phase 1: Proof of Concept (2–4 weeks)
    • Set up the bundle in a staging environment with 1–2 gateways.
    • Test basic flows (capture, refund) and encryption.
    • Validate performance with expected transaction volumes.
  2. Phase 2: Parallel Migration (4–8 weeks)
    • Run old and new payment systems side-by-side.
    • Gradually migrate endpoints/controllers to use the bundle’s API.
    • Monitor for regressions or data inconsistencies.
  3. Phase 3: Cutover (1–2 weeks)
    • Disable legacy payment logic.
    • Update monitoring/dashboards to track bundle-specific metrics (e.g., transaction success rates).
  4. Phase 4: Optimization (Ongoing)
    • Tune database indexes for payment tables.
    • Implement archiving for old transactions.
    • Monitor gateway bundle updates for security patches.

Operational Impact

Maintenance

  • Pros:
    • Centralized Logic: Payment code is consolidated in one bundle, reducing duplication.
    • Gateway Agnostic: Switching gateways involves minimal code changes (e.g., config updates).
    • Documentation: Readme and guides cover setup, encryption, and common use cases.
  • Cons:
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/command-executor-lib
tagixo/document-builder
tagixo/page-builder
tagixo/mail-builder
tagixo/form-builder
primix/primix
tagixo/core
alesima/laravel-azure-service-bus
tomshaw/shopcart
likyly/laravel
darthsoup/shoppingcart
tdt/core
labyrinthe/connect-php
encore2/laravel-admin2
cboxdk/laravel-console-kit
shapecode/doctrine-dbal-datetimeutc
gilads-otiannoh254/inertia-protocol
dakiquang/laravel-oauth-refresh-lock
woda/laravel-worktrees
dalefranks/ramasite