Right now it is up to integrating modules to check to see if the customer requested use of a card on file during the checkout process. Since we already have a charge callback, can we not centralize the detection of card on file selection and directly invoke the charge callback from Card on File? This would remove the requirement for all integrating developers to trap this in their own submit handlers.

Comments

torgosPizza’s picture

This sounds like a good idea, and would probably allow us to add a new feature which I'm keen to create: a "Buy now" button that uses a user's default card on file (or allows them to change the card) that can be placed on a Product page, thereby circumventing the checkout process entirely. Similar to how services like Amazon, iTunes, etc. work. It makes sense since a user has already entered this information that we should make the purchasing as frictionless as possible.

torgosPizza’s picture

what can we do to get this done? I would suspect a hook_form_alter that adds a function to the submit handler array for checkout submit. Then in that submit callback we check if a CoF selection was made, and if so, fire the charge call back using the card_id from the form.

Does that sound right? Hopefully it's that simple!