Implement WHMCS Addon Dashboard with API for stats and integrate billing provider logic
This commit is contained in:
@@ -17,7 +17,7 @@ describe('phase 9 api contract', () => {
|
||||
join(process.cwd(), 'src', 'billing/billing.service.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(billingSource.includes('isWhmcsBilling'));
|
||||
assert.ok(billingSource.includes('isExternalBilling'));
|
||||
|
||||
const serversSource = readFileSync(
|
||||
join(process.cwd(), 'src', 'servers/servers.service.ts'),
|
||||
|
||||
40
apps/api/test/whmcs-addon.test.js
Normal file
40
apps/api/test/whmcs-addon.test.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
describe('whmcs addon module contract', () => {
|
||||
it('documents addon dashboard API and PHP module', () => {
|
||||
const controller = readFileSync(
|
||||
join(process.cwd(), 'src', 'integrations/whmcs/whmcs-integration.controller.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(controller.includes("'dashboard/stats'"));
|
||||
|
||||
const addonMain = readFileSync(
|
||||
join(process.cwd(), '..', '..', 'integrations/whmcs/modules/addons/hexagamecloud/hexagamecloud.php'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(addonMain.includes('hexagamecloud_config'));
|
||||
assert.ok(addonMain.includes('hexagamecloud_page_dashboard'));
|
||||
assert.ok(addonMain.includes('HexaGameCloudEventPoller'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('stripe fallback contract', () => {
|
||||
it('documents optional stripe webhook and billing provider', () => {
|
||||
const provider = readFileSync(
|
||||
join(process.cwd(), 'src', 'billing/billing-provider.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(provider.includes('isExternalBilling'));
|
||||
assert.ok(provider.includes("'stripe'"));
|
||||
|
||||
const webhook = readFileSync(
|
||||
join(process.cwd(), 'src', 'billing/stripe/stripe-webhook.service.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(webhook.includes('isStripeBilling'));
|
||||
assert.ok(webhook.includes('ignored'));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user