It doesn’t matter about whether money has been taken from your account. What matters is the settlement. If trade doesn’t settle before the shareholder record date, you will not be on the list.
You can buy up until today, the day before the Ex-dividend date. The ex-dividend date is usually the day before the record date. Anyone who purchases on the record date or even worst the ex-dividend date wouldn’t be receiving any dividend.