Endpoints and front end

Updated

AJAX, admin-post and query endpoints

EndpointAuthPurpose
wp_ajax(_nopriv)_wpinterface_paddle_woo_order_statusOrder key (order_id, order_key)Poll payment; Billing API check
wp_ajax_wpinterface_paddle_woo_test_connectionNonce wpinterface_paddle_woo_admin, manage_woocommerceTest the saved credentials of the current mode
wp_ajax_wpinterface_paddle_woo_setup_webhookSame; Billing only; webhook URL must be https://Create or update the notification destination, save its secret, record the events as synced
wp_ajax_wpinterface_paddle_woo_sync_orderNonce wpinterface_paddle_woo_admin, edit_shop_ordersCheck payment with Paddle
admin-post wpinterface_paddle_woo_licenseNonce wpinterface_paddle_woo_license, manage_woocommerceActivate or deactivate the license
admin-post wpinterface_paddle_woo_dismiss_welcomeNonce of the same name, manage_woocommerceDismiss the Lite-to-Pro notice
?wpinterface-paddle-invoice={id}&key={order_key}Order key or ownerRedirect to a fresh Billing invoice
?wpinterface-paddle-update-payment={subscription}&_wpnonce=…Nonce + ownerRedirect to Paddle’s update-payment page

Billing_Driver::setup_webhook() looks for a destination whose URL equals Settings::webhook_url(). It updates it (keeping events another plugin subscribed) or creates one (description “WooCommerce ({host})”), and writes the secret into billing_{env}_webhook_secret. The response asks the page to reload so a stale form can’t overwrite the new secret.

Scripts

Checkout::register_scripts() registers Paddle.js from Paddle’s CDN (wpinterface-paddle-woo-js-v2 or -v1) and wpinterface-paddle-woo-core (paddle-core.js). wpinterface-paddle-woo-checkout (paddle-checkout.js and checkout.css) is enqueued on checkout pages except order-received, including the receipt page, when the gateway is enabled and configured; wpinterface-paddle-woo-blocks comes through the blocks integration.

wpinterfacePaddleWooConfig keys: api, mode, sandbox ('1' / '0'), theme, locale, gateway, ajaxUrl, statusAction, i18n, and token (Billing client-side token) or vendor (Classic vendor ID). No secrets are ever included.

paddle-core.js exposes window.wpinterfacePaddleWoo = { config, ready, pay, cancel, inline }. pay( details, onPaid, frameTarget ) returns a promise resolving to { paid: true } after the status poll, or { paid: false } when the buyer closes the checkout. cancel() closes the open checkout unless a payment is in flight.

Was this page helpful?