Getting StartedIntroduction

Introduction

Add PayLexer payments to any WordPress plugin with an add-on, built on the PayLexer plugin's developer API.

PayLexer lets a WordPress site take payments across many gateways. An add-on is a small plugin that connects someone else's plugin (a booking, forms or course plugin) to PayLexer. It uses the merchant's existing PayLexer connection, so it holds no keys and never sees gateway credentials.

The API ships with the PayLexer plugin, so it is only available while that plugin is active. If your plugin can run without PayLexer, guard its calls with function_exists( 'paylexer_api_version' ).

How a payment flows

Your plugin asks PayLexer for a hosted checkout, sends the shopper there, and settles the order when PayLexer's signed webhook arrives. The webhook, not the browser callback, is the source of truth.

Fulfil orders from the payment_completed event. PayLexer verifies the webhook signature before your hook runs, so you never handle a secret. See the Webhooks guide.

Where to start

Install the starter

Both options create the same starter plugin, and both need Composer installed. Replace acme-pay with your plugin's slug.

With Composer

composer create-project paylexer/wordpress-starter acme-pay

With WP-CLI (also needs WP-CLI)

wp package install paylexer/wp-cli-paylexer
wp paylexer scaffold acme-pay

Build the add-on

Look up the API

Find every function, hook and browser call in the API reference.