Skip to content

Paddle Driver (PaymentsPaddle)

PaymentsPaddle (trk/processwire-payments-paddle, v0.1.0) is the official Paddle Billing v2 Merchant of Record (MoR) driver for Payments. It registers lazily via 'paymentsDriver' => true with driver key paddle.

Repository: github.com/trk/PaymentsPaddle

Terminal window
composer require trk/processwire-payments-paddle
php vendor/bin/wire module:install PaymentsPaddle --json

Configure an instance in Setup -> Payments -> Gateways by selecting Paddle (Merchant of Record).

Setting Key Required Recommended Storage Purpose
api_key Yes $env:PADDLE_API_KEY Paddle Billing v2 Bearer API key (PaddleHttpClient routes live api.paddle.com vs. sandbox sandbox-api.paddle.com with Paddle-Version: 1).
client_side_token Optional Plaintext or $env: Token for Paddle.js overlay checkout.
webhook_secret Yes (Live) $env:PADDLE_WEBHOOK_SECRET Notification secret (pdl_ntfset_...) verified by PaddleSignatureVerifier.
default_tax_category Optional e.g., standard or saas Default Paddle tax category for dynamically priced transactions.
default_checkout_url Optional HTTPS URL Default hosted checkout return URL.

Capabilities & Merchant of Record Semantics

Section titled “Capabilities & Merchant of Record Semantics”

Totoglu\PaymentsPaddle\PaddleGateway implements PaymentGatewayInterface, SubscriptionGatewayInterface, QuantitySubscriptionGatewayInterface, MeteredSubscriptionGatewayInterface, WebhookGatewayInterface, InvoiceGatewayInterface, and TransactionStatusGatewayInterface.

  • Merchant of Record (isMerchantOfRecord = true): Paddle calculates global VAT/sales tax (handlesTaxCalculation), issues legal tax invoices (handlesInvoicing, resolved via GET /transactions/{id}/invoice), and handles buyer currency conversion (handlesCurrencyConversion).
  • Checkout & Refunds: Creates hosted/overlay transactions via POST /transactions and issues full or partial refunds via POST /adjustments distributed across details.line_items. Because MoR transactions settle directly, separate manual capture() and void() throw WireException by design.
  • Subscriptions & Metered Charges: Supports switchPlan() and updateSubscriptionQuantity() (PATCH /subscriptions/{id}), pauseSubscription(), resumeSubscription(), cancelSubscription(), reactivateSubscription() (clearing scheduled_change), customerPortalUrl() (POST /customers/{id}/portal-sessions), and reportUsage() (POST /subscriptions/{id}/charge using meter_price_map).

PaddleSignatureVerifier validates the Paddle-Signature header timestamp tolerance (DEFAULT_TOLERANCE_SECONDS = 300) and HMAC-SHA256 digests in constant time, supporting rotated secrets.

Next steps