Skip to content

WHMCS hook billed wrong customer

General Discussion by rudi3 2 replies 114 views
8 #1

My WHMCS Hook actually billed the wrong Customer yesterday and actually I do not understand why because the Hook is supposed to run after Invoice Creation and actually assign the correct Items to the correct Customer but actually it assigned a Contabo VPS to a completely different Customer who did not even order anything or? Has anyone seen this Behavior before or? I am running WHMCS 8.7 with a custom Post invoice creation hook and actually the Log shows everything normal but actually the Invoice is wrong or?

#2

Regards. I see this before in cPanel systems. Make a server up with race condition maybe? Two invoices create same time, hook read wrong ID. Check your database log for same timestamp entries. You can add lock or check invoice ID match customer ID before process. Regards.

siesta first, deploy later
#3

This is classic race condition. Two requests hit same time, hook grab stale data from session. You need idempotency key, check if invoice already processed before running again. WHMCS dont protect you from this. Add unique constraint on your custom table too!

çok ucuz, çok hızlı

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft