Nova Checkout
Stripe Checkout integration for subscriptions with per-seat quantity and AU/NZ routing
by Nova Strategic · github.com/kbrookes/nova-checkout · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kbrookes/nova-checkout/archive/refs/heads/main.zipDeclares an update source (kbrookes/Nova-Checkout), so updates arrive through the plugin's own updater.
Readme
Nova Checkout
A WordPress plugin that provides Stripe Checkout integration for subscriptions with per-seat quantity and AU/NZ routing.
Features
- Stripe Checkout Integration: Uses Stripe Checkout (not Elements) for a seamless payment experience
- Subscription Mode: Creates subscriptions with two line items (plan + support), each with quantity based on number of users
- AU/NZ Routing: Automatically routes to the correct Stripe account based on customer country
- Per-Seat Pricing: Supports quarterly and annual billing with per-user pricing
- Webhook Support: Handles Stripe webhook events for subscription lifecycle management
- REST API: Exposes
/wp-json/nova/v1/checkoutendpoint for form submissions - Git Updater Compatible: Designed to work with Git Updater
Requirements
- PHP 8.1 or higher
- WordPress 6.0 or higher
- Composer
- Stripe account(s) for AU and/or NZ
Installation
Via Git Updater (Recommended)
- Install and activate the Git Updater plugin
- Go to Settings → Git Updater → Install Plugin
- Enter the GitHub repository URL
- Click Install Plugin
Manual Installation
-
Clone this repository into your WordPress plugins directory:
cd wp-content/plugins git clone https://github.com/yourusername/nova-checkout.git -
Install dependencies:
cd nova-checkout composer install --no-dev -
Activate the plugin in WordPress admin
Configuration
1. Stripe API Keys
Go to Settings → Nova Checkout and configure:
- Australia Secret Key: Your Stripe secret key for AU account
- Australia Publishable Key: Your Stripe publishable key for AU account
- New Zealand Secret Key: Your Stripe secret key for NZ account
- New Zealand Publishable Key: Your Stripe publishable key for NZ account
2. Price IDs
Configure Stripe Price IDs for each combination of country and billing period:
Australia:
- AU Quarterly Plan Price ID
- AU Quarterly Support Price ID
- AU Annual Plan Price ID
- AU Annual Support Price ID
New Zealand:
- NZ Quarterly Plan Price ID
- NZ Quarterly Support Price ID
- NZ Annual Plan Price ID
- NZ Annual Support Price ID
3. URLs
- Success URL: Where customers are redirected after successful checkout
- Cancel URL: Where customers are redirected if they cancel checkout
4. Webhook Configuration
- Copy the webhook URL shown in the settings page:
/wp-json/nova/v1/webhook - In your Stripe dashboard (for both AU and NZ accounts):
- Go to Developers → Webhooks
- Click Add endpoint
- Paste the webhook URL
- Select events to listen for:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
Usage
REST API Endpoint
Endpoint: POST /wp-json/nova/v1/checkout
Required Parameters:
country(string): "AU" or "NZ"billing_period(string): "quarterly" or "annual"users(integer): Number of users (1-1000)
Optional Parameters:
email(string): Customer email addresscompany_name(string): Company namecustomer_name(string): Customer name
Example Request:
fetch('/wp-json/nova/v1/checkout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
country: 'AU',
billing_period: 'quarterly',
users: 5,
email: 'customer@example.com',
company_name: 'Acme Corp',
customer_name: 'John Doe'
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Redirect to Stripe Checkout
window.location.href = data.url;
}
});
Success Response:
{
"success": true,
"session_id": "cs_test_...",
"url": "https://checkout.stripe.com/c/pay/cs_test_..."
}
Error Response:
{
"code": "checkout_failed",
"message": "Country is required.",
"data": {
"status": 400
}
}
Bricks Builder Integration
-
Create a form in Bricks Builder with the following fields:
- Country (select: AU/NZ)
- Billing Period (select: quarterly/annual)
- Number of Users (number input)
- Email (email input)
- Company Name (text input)
- Customer Name (text input)
-
Add a submit button with custom JavaScript:
document.querySelector('#your-form').addEventListener('submit', async (e) => {
e.preventDefault();
const formData = {
country: document.querySelector('[name="country"]').value,
billing_period: document.querySelector('[name="billing_period"]').value,
users: parseInt(document.querySelector('[name="users"]').value),
email: document.querySelector('[name="email"]').value,
company_name: document.querySelector('[name="company_name"]').value,
customer_name: document.querySelector('[name="customer_name"]').value
};
try {
const response = await fetch('/wp-json/nova/v1/checkout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formData)
});
const data = await response.json();
if (data.success) {
window.location.href = data.url;
} else {
alert('Error: ' + (data.message || 'Something went wrong'));
}
} catch (error) {
alert('Error: Unable to process checkout');
}
});
Webhook Events
The plugin handles the following Stripe webhook events:
checkout.session.completed: Fired when checkout is completedcustomer.subscription.created: Fired when subscription is createdcustomer.subscription.updated: Fired when subscription is updatedcustomer.subscription.deleted: Fired when subscription is cancelledinvoice.payment_succeeded: Fired when invoice payment succeedsinvoice.payment_failed: Fired when invoice payment fails
Custom Event Handling
You can hook into webhook events using WordPress actions:
// Handle checkout completion
add_action('nova_checkout_completed', function($session) {
$email = $session['customer_email'];
$subscription_id = $session['subscription'];
// Your custom logic here
// e.g., send welcome email, create user account, etc.
});
// Handle subscription updates
add_action('nova_checkout_subscription_updated', function($subscription) {
$status = $subscription['status'];
// Your custom logic here
});
Development
Install Development Dependencies
composer install
Code Quality Tools
# PHP Lint
composer run-script lint
# PHP CodeSniffer
composer run-script phpcs
# PHP CodeSniffer Auto-fix
composer run-script phpcbf
# PHPStan
composer run-script phpstan
# Security Audit
composer run-script audit
CI/CD
The plugin includes GitHub Actions workflow that runs on every push and pull request:
- PHP Lint (PHP 8.1, 8.2, 8.3)
- PHPCS (WordPress Coding Standards)
- PHPStan (Level 8)
- PHPCPD (Duplicate code detection)
- Composer Security Audit
Versioning
This plugin follows Semantic Versioning. When releasing a new version:
- Update version in
nova-checkout.phpheader - Update
NOVA_CHECKOUT_VERSIONconstant - Create a git tag:
git tag -a v1.0.0 -m "Version 1.0.0" - Push tag:
git push origin v1.0.0
Git Updater will automatically detect the new version.
Security
- All inputs are sanitized and validated
- Stripe API keys are never logged or exposed
- Webhook signature verification should be implemented in production
- Follows WordPress and PHP security best practices
Support
For issues, questions, or contributions, please use the GitHub repository.
License
GPL v2 or later
Credits
Developed by Siiteable