Plugin Basics¶
Getting Started¶
A nxtbn plugin is essentially a Python file with plugin metadata in its header. It’s recommended to organize your plugin’s files within a directory for better organization.
Creating a New Plugin¶
To create a new plugin, follow these steps:
Navigate to the
nxtbn/plugins/sources/
directory in your nxtbn installation.Create a new directory named after your plugin (e.g.,
plugin-name
).Open the newly created plugin directory.
Inside the directory, create two Python files:
__init__.py
andyour_plugin_name.py
.
Example (Unix Command Line)¶
cd nxtbn/plugins/sources
mkdir xpay
touch xpay/__init__.py
touch xpay/somename_xpay.py
Initialization (Example __init__.py
)¶
metadata = {
"plugin_name": "xpay", # Must be unique to your plugin
"plugin_type": "PAYMENT_PROCESSOR", # Plugin type
"plugin_uri": "https://example.com",
"version": "1.0.0",
"author": "John Doe",
"author_uri": "http://example.com",
"description": "Plugin to handle payments via xpay.",
"license": "MIT",
"nxtbn_version_compatibility": ">=1.0.0"
}
from .somename_xpay import SomePaymentGateway
plugin = SomePaymentGateway
__all__ = ['plugin']