We have a unique situation with a special promotion with American Express. We will be promoting products with them linking back to our Drupal 6/Ubercart 6.x-2.10 website and they want those products to only be bought using Amex. I have looked into contrib modules that will force a user to only use amex for payment but I haven't been able to find that. Conditional Payment came closest but I don't think that functionality is built into that module. Can anyone recommend a module based solution for this? If not are there any online resources for a code based solution?

Much thanks.

Comments

jkiff created an issue. See original summary.

TR’s picture

Status: Active » Fixed

This requires custom code, but it's not very difficult.

All Amex card numbers start with 34 or 37 (see https://en.wikipedia.org/wiki/Bank_card_number) so you can use a hook_form_alter() to add your own validation function for the credit card entry textfield. Your validation function would check the first two digits of the entered card number to verify it's an Amex card, if not then set an appropriate error message. I suggest you also add text to the payment pane letting the customer know in advance that only Amex can be used. Optionally, you can run this validation/add this text conditionally, say only when the customer reached your website via the promotion link, or only when one of your promotion products is in the cart.

Additionally, I strongly recommend that you upgrade to the latest D6 Drupal and Ubercart. Better yet, upgrade to D7 because D6 will be obsolete/unsupported in a few months.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.