In the commerce_cardonfile settings at admin/commerce/config/cardonfile are currently not respected by this module. The UI of COF has a setting called "Card on file storage method" with these three options:

  • Show a checkbox letting customers opt-in to storing their card on file.
  • Show a checkbox letting customers opt-out of storing their card on file.
  • Do not show a checkbox and always store their card on file.

But no matter what you choose, the user has not opportunity to opt out of COF.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nyleve101’s picture

Has anyone else experienced this issue and resolved it for the Drop-in UI? I'm using Commerce recurring so the card always has to be saved.

Any help or feedback is greatly appreciated.

swelljoe’s picture

I had the same problem. I think the attached patch will fix it (I'm still wrapping my head around the way this works, and I'm not even sure how to test it yet). I think, if I'm understanding how things work, and how the formapi works, this patch changes it to make the cardonfile_save method call always happen if you've configured it to "required", and it does not display the checkbox. And, I think the checkbox still functions correctly. Again, I'm not sure how to test this yet, since I have some other stuff not working right in my shopping cart, which prevents testing. At least, I know it removes the checkbox when set to "required", I don't know if it actually saves card data correctly.

swelljoe’s picture

As an update, I think the patch I submitted works as intended. I've since made a bunch of other changes to accommodate $0 payments and to fix a bug in name storage so I'm not sure if I made any other changes to make the card on file storage method option work, but it's working on my local install.

I dunno the process for getting such a thing committed.

Lukas von Blarer’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.24 KB

You should file separate issues for each bug and upload a patch for each. As far as I can tell you already created them.

Regarding your patch: There are coding standards issues. For example this line:

if (!empty($payment_method['settings']['cardonfile']) && !empty($user->uid)) { if ($storage !== 'required') {

This doesn't meet coding standards. I attached a patch that fixes this.

andyg5000’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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