Hooks reference

Updated

Filters and actions for customizing the plugin, plus the EDD hooks it relies on.

Filters

wpinterface_paddle_billing_transaction

Change the Billing POST /transactions body. Arguments: $body, $order, $purchase_data, $subscription.

functions.php

add_filter( 'wpinterface_paddle_billing_transaction', function ( $body, $order, $purchase_data, $subscription ) {
    // Example: use a SaaS tax category for subscriptions only.
    if ( $subscription ) {
        foreach ( $body['items'] as &$item ) {
            $item['price']['product']['tax_category'] = 'saas';
        }
    }
    return $body;
}, 10, 4 );

Keep the order references

Keep custom_data.edd_order_id and custom_data.edd_site; the webhook relies on them.

Change the Classic generate_pay_link fields. Arguments: $fields, $order, $purchase_data, $subscription. Keep passthrough, and do not set discountable or quantity_variable to 1 (the amount check would refuse the payment).

wpinterface_paddle_webhook_base_url

The base URL Paddle should call (default: the REST URL). Use it for tunnels in local development or for reverse proxies.

functions.php

add_filter( 'wpinterface_paddle_webhook_base_url', function () {
    return 'https://example.trycloudflare.com/';
} );

Actions

  • wpinterface_paddle_billing_webhook (array $event, bool $sandbox): after a verified Billing event was handled.
  • wpinterface_paddle_classic_webhook (array $fields, bool $sandbox): after a verified Classic webhook was handled.

functions.php

add_action( 'wpinterface_paddle_billing_webhook', function ( $event, $sandbox ) {
    if ( 'subscription.updated' === $event['event_type'] ) {
        // Sync seat counts, CRM, analytics…
    }
}, 10, 2 );

EDD and EDD Recurring hooks the plugin uses

edd_payment_gateways, edd_enabled_payment_gateways_before_sort (hides the gateway when unusable), wpinterface_paddle_cc_form, edd_checkout_error_checks, edd_gateway_paddle, edd_payment_confirm_paddle, edd_after_submit_refund_table, edd_refund_order, edd_payment_details_transaction_id-paddle, edd_view_order_details_sidebar_after, edd_order_receipt_after, edd_gateway_settings_url_paddle, edd_recurring_gateway, edd_subscription_card_top, edd_subscription_completed, edd_subscription_post_renew (priority 11, temporary), edd_subscription_renewal_expiration (priority 20, temporary), edd_recurring_customer_update_uri_paddle, edd_recurring_create_subscription_args.

Was this page helpful?