Hi, first forgive my english :)
Well, I've been asked to evaluate a method to enable specific payment method depending on the customer which is doing the checkout.
Moreover, the parameter to check is not a default customer data.
Another thing for a complete description: this parameter is the number of days for which the customer is allowed to delay the payment. The payment itslef will be accomplished through bank (something similar bank wire transfer, but not completely, here is named Ricevuta Bancaria, that stands for Bank Receipt and usually has this temporal expiration: 30 days, 60 days, 90 days, 120 days...
This means that the customer receive a communication from his bank saying that he'll must pay the amount due at expiration date and he reply with his authorization to make the payment).
Ok all this just to explain, it doesn't involve Zen Cart.
So, now, before starting to work on it, I'd just like to hear from you if what I thought is right.
Well, I'll create a new table where to store customer ID and the value of this parameter (30 or 60 or 90 ...).
For my need this table will not be managed inside Zen Cart administration, but with an external bridge with the client software (once again, this is not important, I could easily create a managent tool in ZC admin, but the client asked for first solution).
Ok, here comes the core of my question:
In the payment method (that I'll create specifically) is ok to write, after
a code that query my new table and if find a match with user who is checking out, then enable the method (and after will retrieve the parameter value to print the right expiration time), otherwise disable the method?
$this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
Another question is, in this point of the payment method file, it should be available the customer id (in the session, I believe), no?