A plugin for Payload to connect Square and Payload.
In the plugins array of your Payload config, call the plugin with options:
import{buildConfig}from'payload/config'importsquarePluginfrom'plugin-square'// @TODO Update to be correctimport{Environment}from"square";constconfig=buildConfig({plugins: [squarePlugin({squareAccessToken: process.env.SQUARE_ACCESS_TOKEN,squareEnvironment: process.env.SQUARE_EVIRONMENTaskeyoftypeofEnvironment,}),],})exportdefaultconfig| Option | Type | Default | Description |
|---|---|---|---|
webhooks | object | function | undefined | Either a function to handle all webhooks events, or an object of Square webhook handlers, keyed to the name of the event |
sync | array | undefined | An array of sync configs |
logs | boolean | false | When true, logs sync events to the console as they happen |
* An asterisk denotes that a property is required.
The following custom endpoints are automatically opened for you:
| Endpoint | Method | Description |
|---|---|---|
/api/square/webhooks | POST | Handles all Square webhook events |