Vai al contenuto
Contenuto principale
plugin-billing

Hostwebo Billing — Database Schema

Hostwebo Billing — Database Schema # Tutte le tabelle prefisso wp_hwbi_ (o {wpdb->prefix}hwbi_). Schema completo creato al primo activate via Installer::install_schema(). Tabelle # wp_hwbi_plans # Catalogo prodotti (h…

Aggiornato 18 Mag 2026 min di lettura

Hostwebo Billing — Database Schema

Tutte le tabelle prefisso wp_hwbi_* (o {wpdb->prefix}hwbi_*). Schema completo creato al primo activate via Installer::install_schema().

Tabelle

wp_hwbi_plans

Catalogo prodotti (hosting, domini, addon, pacchetti crediti AI).

ColonnaTipoNote
idBIGINT PK
slugVARCHAR(64) UNIQUEidentificatore univoco (wp-starter, domain-com-yearly)
nameVARCHAR(128)nome leggibile
descriptionTEXTtesto descrittivo (può contenere markdown)
product_typeVARCHAR(32)hostingdomainaddoncredit_pack
categoryVARCHAR(32)cloud_ecowpecommerce
billing_periodVARCHAR(16)monthlyquarterlyannualbiennialtriennialone_time
price_eur_excl_taxDECIMAL(10,2)prezzo senza IVA
price_eur_incl_taxDECIMAL(10,2)prezzo con IVA (per display front-end)
tax_rateDECIMAL(5,2)IVA % (default 22.00)
setup_fee_excl_taxDECIMAL(10,2)setup fee opzionale
trial_daysINTgiorni trial gratuito
stripe_product_idVARCHAR(64) NULLprod_xxx (popolato da Fase B sync)
stripe_price_idVARCHAR(64) NULLprice_xxx
paypal_plan_idVARCHAR(64) NULLP-xxx
plesk_service_planVARCHAR(128) NULLslug Plesk service plan
cloudlinux_packageVARCHAR(64) NULL
features_jsonLONGTEXT NULLarray di bullet feature
metadata_jsonLONGTEXT NULLmetadata libero (es. upmind_pid per audit migrazione)
is_active, is_featuredTINYINT(1)
sort_orderINTordinamento UI
Indici: uniq_slug, idx_active_sort, idx_product_type, idx_category.

wp_hwbi_orders

Ogni ordine = un transaction. Può generare 1+ subscriptions o solo provisioning one-shot.

ColonnaTipoNote
idBIGINT PK
order_numberVARCHAR(32) UNIQUEformato HWB-2026-000001
user_idBIGINT NULL
statusVARCHAR(32)pending_paymentpaidprovisioningactivesuspendedcancelledrefundedfailed
payment_gatewayVARCHAR(32) NULLstripepaypalmanualupmind_legacy
payment_referenceVARCHAR(255) NULLstripe_session_id / paypal_order_id
total_excl_tax, tax_amount, total_incl_taxDECIMAL(10,2)
currencyCHAR(3)EUR
customer_snapshotLONGTEXTsnapshot dati cliente al checkout
billing_addressLONGTEXT
coupon_code, discount_amount
affiliate_idBIGINT NULLFK affiliates
metadata_jsonLONGTEXT NULL
paid_at, provisioned_at, cancelled_atDATETIME

wp_hwbi_order_items

Line items per ordine. Permette ordini multi-prodotto (es. hosting + dominio).

wp_hwbi_subscriptions

Abbonamenti ricorrenti. Sync con Stripe/PayPal Subscription IDs.

ColonnaNote
id, user_id, order_id, plan_id
statustrialactivepast_duesuspendedcancelledexpired
stripe_subscription_id, paypal_subscription_idSync con gateway
plesk_subscription_id, plesk_account_idSync con Plesk
current_period_start, current_period_end, next_renewal_at
cancel_at, cancelled_at, cancellation_reason

wp_hwbi_invoices

Fatture italiane SDI-compatibili.

ColonnaNote
invoice_numberUNIQUE — formato 2026/0001 (sequenziale per anno)
invoice_year, invoice_seqUNIQUE composite
customer_snapshot, supplier_snapshot, line_items_snapshotImmutabili al momento emissione
pdf_relative_pathpath al PDF generato
sdi_transmission_id, sdi_status, sdi_response_jsonSync con Aruba per fattura elettronica B2B

wp_hwbi_payments

Audit trail di ogni pagamento ricevuto. Idempotency garantita.

ColonnaNote
webhook_event_idUNIQUE — dedup pagamenti
gateway, gateway_reference
amount_excl_tax, tax_amount, amount_incl_tax
statuspendingsucceededfailedrefunded
raw_event_jsondump dell’evento per debug

wp_hwbi_provisioning_jobs

Coda worker per orchestrare azioni su Plesk / domain provider.

ColonnaNote
job_typecreate_plesk_subscriptionsuspendreactivatecancelrenewupdate_plan
statuspendingrunningdonefailedcancelled
payload, resultJSON
attempts, max_attemptsexponential backoff

wp_hwbi_coupons

Codici sconto. CRUD in Fase B+.

wp_hwbi_affiliates + wp_hwbi_affiliate_commissions

Programma referral. Fase I.

wp_options usate dal plugin

OptionDefaultNote
hwbi_db_version1.0.0versione schema corrente
hwbi_billing_v2_enabledfalsemaster toggle V2
hwbi_upmind_enabledtruemaster toggle Upmind legacy
hwbi_billing_modeupmind_onlyenum modalità runtime
hwbi_v2_beta_users''CSV user_id beta tester
hwbi_stripe_publishable_key''
hwbi_stripe_secret_key''
hwbi_stripe_webhook_secret''
hwbi_paypal_client_id''
hwbi_paypal_secret''
hwbi_paypal_webhook_id''
hwbi_paypal_modesandboxsandboxlive
hwbi_aruba_sdi_username''Fase F
hwbi_aruba_sdi_password''Fase F
hwbi_aruba_sdi_endpoint''
hwbi_legal_dataarrayragione sociale, P.IVA, REA, IBAN, PEC, codice SDI, …
hwbi_order_counter_2026intcounter atomico per order_number
hwbi_invoice_counter_2026intcounter atomico per invoice_number
Tutti autoload=false per non rallentare le request che non toccano billing.

Migrazione

Schema versione gestita da Installer::maybe_upgrade() con version_compare( $current, HWBI_DB_VERSION ). Idempotente via dbDelta.

Questa guida ti è stata utile?

Il tuo feedback ci aiuta a tenere la documentazione utile e aggiornata.

Continua a leggere