Weave Code
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

Cashier Paddle Laravel Package

laravel/cashier-paddle

Laravel Cashier Paddle adds a fluent Laravel interface for Paddle subscriptions, handling common billing boilerplate like subscription creation and management, plan swaps, quantities, pauses, cancellations, and grace periods.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Seamless Laravel Integration: Designed as a Cashier extension, it inherits Laravel’s Eloquent-based billing patterns, ensuring consistency with existing Laravel applications (e.g., User model subscriptions via hasOne relationships).
  • Paddle Abstraction: Encapsulates Paddle’s API complexity (webhooks, subscriptions, invoices) behind a fluent interface, reducing custom integration effort.
  • Event-Driven Hooks: Leverages Laravel’s event system (e.g., SubscriptionCreated, InvoicePaid) for extensibility, aligning with modern Laravel architectures.
  • Database Agnostic: Works with Laravel’s query builder, supporting all supported databases (MySQL, PostgreSQL, SQLite).

Integration Feasibility

  • Low-Coupling Design: Minimal invasive changes required; integrates via Cashier facade or service provider binding.
  • Webhook Handling: Requires Paddle webhook endpoint setup (Laravel routes + middleware) but provides a PaddleWebhookHandler trait for validation.
  • Testing Support: Includes Laravel’s testing helpers (e.g., actingAs, assertPaid) and mockable HTTP clients for CI/CD pipelines.
  • Multi-Tenant Ready: Supports scoping subscriptions to tenants via Laravel’s globalScope or package-specific middleware.

Technical Risk

  • Paddle API Dependencies: Risk of breaking changes if Paddle alters its API (e.g., deprecated endpoints, new auth requirements). Mitigate via:
    • Semantic versioning adherence (package follows Laravel’s release cadence).
    • Community-driven updates (264 stars, active maintainers).
  • Webhook Reliability: Misconfigured webhooks or rate limits may disrupt billing flows. Requires:
    • Idempotency testing for webhook retries.
    • Monitoring (e.g., Laravel Horizon for failed job tracking).
  • Legacy System Gaps: May not cover niche Paddle features (e.g., custom tax rules). Requires:
    • Direct Paddle API fallback for unsupported use cases.
    • Feature gap documentation in the README.

Key Questions

  1. Subscription Model: Does the app use Eloquent models for subscriptions, or is a custom table preferred? (Cashier assumes users table with stripe_id; Paddle uses paddle_customer_id.)
  2. Webhook Security: How will Paddle webhook signatures be validated? (Package provides PaddleWebhookHandler but requires HMAC setup.)
  3. Multi-Currency: Does the app need multi-currency support? (Paddle handles this natively; package may need extension.)
  4. Offline Payments: Are there manual payment methods (e.g., bank transfers) requiring custom flows?
  5. Audit Logging: Are there compliance requirements for subscription changes? (Package lacks built-in audit trails; may need Laravel logging middleware.)
  6. Performance: Will high subscription volumes stress the database? (Cashier’s subscriptions table may need indexing for user_id + status.)

Integration Approach

Stack Fit

  • Laravel Ecosystem: Optimized for Laravel 10+ (PHP 8.1+), leveraging:
    • Eloquent: Subscription models inherit Billable trait.
    • Queues: Async webhook processing via Laravel queues.
    • Testing: Pest/PHPUnit support with Cashier assertions.
  • Paddle Compatibility: Requires:
    • Paddle merchant account (sandbox/testing recommended pre-launch).
    • Paddle API keys (stored in .env or Laravel vault).
  • Third-Party Tools:
    • Stripe Alternative: Direct replacement for laravel/cashier-stripe if migrating from Stripe.
    • Payment Gateways: Works alongside other Cashier drivers (e.g., cashier-mollie) via Laravel’s service container.

Migration Path

  1. Preparation:
    • Add Paddle merchant account and API keys to .env.
    • Install package: composer require laravel/cashier-paddle.
    • Publish config: php artisan vendor:publish --provider="Laravel\CashierPaddle\CashierPaddleServiceProvider".
  2. Model Integration:
    • Add use Laravel\CashierPaddle\Billable; to user model.
    • Migrate stripe_id column to paddle_customer_id (or add new column).
  3. Webhooks:
    • Route Paddle webhooks to PaddleWebhookHandler (e.g., POST /paddle/webhook).
    • Configure Paddle dashboard with your webhook URL.
  4. Testing:
    • Use Paddle sandbox for integration tests.
    • Test edge cases: failed payments, subscription swaps, cancellations.
  5. Go-Live:
    • Switch from sandbox to live Paddle API.
    • Monitor webhook delivery and subscription statuses.

Compatibility

  • Laravel Versions: Tested on Laravel 10+ (PHP 8.1+). May require polyfills for older versions.
  • Database: Supports all Laravel-supported databases but assumes subscriptions table exists (created via php artisan migrate if using Cashier).
  • PHP Extensions: Requires cURL and OpenSSL for API calls.
  • Caching: Leverages Laravel’s cache for rate-limiting (configurable in config/cashier.php).

Sequencing

  1. Phase 1: Core Subscriptions
    • Implement newSubscription() and subscription() methods.
    • Test basic flows: create, pause, cancel, resume.
  2. Phase 2: Webhooks
    • Set up webhook routes and handlers.
    • Validate signature and process events (e.g., subscription_canceled).
  3. Phase 3: Advanced Features
    • Add coupon/pricing logic via Paddle\Paddle facade.
    • Implement custom invoice PDFs or dunning management.
  4. Phase 4: Monitoring
    • Log webhook failures to Sentry/Laravel logs.
    • Set up alerts for high cancellation rates.

Operational Impact

Maintenance

  • Updates: Follow Laravel’s release schedule (package aligns with Cashier updates).
    • Minor updates: Composer auto-update.
    • Major updates: Test Paddle API compatibility (e.g., breaking changes in v2026).
  • Dependency Management:
    • Monitor laravel/cashier and paddle/sdk-php for breaking changes.
    • Use composer why-not to audit dependency conflicts.
  • Documentation:
    • Maintain internal runbooks for:
      • Webhook troubleshooting (e.g., retry logic).
      • Paddle API rate limits (e.g., 60 requests/minute).

Support

  • Debugging Tools:
    • Enable Paddle debug mode (config/cashier.php['debug'] = true).
    • Use Paddle::debug() to log API requests/responses.
  • Common Issues:
    • Webhook Failures: Retry logic via Laravel queues; monitor failed_jobs table.
    • Subscription Sync: Run php artisan cashier:sync to reconcile database with Paddle.
    • Payment Retries: Configure Paddle’s retry settings (e.g., 3 attempts).
  • Vendor Lock-In: Mitigate by:
    • Abstracting Paddle-specific logic behind interfaces.
    • Documenting custom Paddle features for future migrations.

Scaling

  • Database:
    • Index subscriptions table on user_id, status, and trial_ends_at.
    • Consider read replicas for high-traffic subscription queries.
  • Webhooks:
    • Use Laravel Horizon for queue-based processing.
    • Scale horizontally if webhook volume exceeds PHP-FPM limits.
  • API Rate Limits:
    • Cache Paddle API responses (e.g., customer data) with Cache::remember.
    • Implement exponential backoff for retries.
  • Multi-Region:
    • Deploy Paddle webhook handlers in the same region as Paddle’s API endpoints (e.g., EU for GDPR compliance).

Failure Modes

Failure Scenario Impact Mitigation
Paddle API downtime Failed subscription updates Queue retries with exponential backoff; notify admins via Slack/PagerDuty.
Webhook delivery failures Unprocessed subscription events Monitor failed_jobs; implement dead-letter queue for webhooks.
Database corruption Inconsistent subscription states Use Laravel’s database transactions; backup subscriptions table.
Paddle API breaking changes Package incompatibility Test against Paddle’s sandbox pre-release; have fallback to direct API calls.
High cancellation volume Revenue loss Implement cancellation grace periods; analyze churn trends.
Payment fraud Chargebacks Use Paddle’s fraud detection tools; log disputes in Laravel.

Ramp-Up

  • Onboarding Time: 2–5 days for basic integration (longer for custom features).
    • Team Skills: Requires familiarity with Laravel Eloquent, queues, and webhooks.
    • Training:
      • Walkthrough of CashierPaddle facade methods (
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4