Payment type restrictions.

Is there any way to restrict payment types for a client? Like say prevent a client from paying via ACH, or Credit card (or even block all online payments altogether). Either on a per client or per invoice basis would work…

No, we support setting min/max limit for a payment type but they apply to all clients/invoices.

Would you be interested in a pull request to add support? I haven’t written the code out yet, but it would also require extending the schema with a table like whats at the bottom of this post. Then add a check to the payments so if an invoice exists in that table with is_blocked set to 1 it doesn’t show up on the list of payment types for that invoice. Could do a similar table per client and check that as well. It would be extendable to also support a whitelist of payment types later by only allowing the payment types that exist in the table with is_blocked set to 0. I left is_blocked nullable on the thought you might want to indicate the restriction should follow whatever the default is, though might be better to make it not nullable and just delete the restriction instead in that instance. The table name is also a little verbose, if you’re interested in the pull request I’d love to a better naming scheme for it. The backticks for the sql scheme got a little jumbled, sorry not terribly familiar with wordpress but that should give you the basic idea.

CREATE TABLE invoices_payment_type_restrictions ( id int(10) unsigned NOT NULL AUTO_INCREMENT, invoice_id int(10) unsigned NOT NULL, payment_type_id int(10) unsigned NOT NULL, is_blocked tinyint(1) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY invoices_payment_type_restrictions_invoice_id_payment_type_id (invoice_id,payment_type_id`), CONSTRAINT invoices_payment_type_restrictions_invoice_id_foreign FOREIGN KEY (invoice_id) REFERENCES invoices (id) ON DELETE CASCADE, CONSTRAINT invoices_payment_type_restrictions_payment_type_id_foreign FOREIGN KEY (payment_type_id) REFERENCES payment_types (id) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Sorry, I don’t think we’d be able to merge it.