This patch alters the admin payment terminal form on the order payment tab to enable payment transactions from the customers card on file data.

This has been tested with commerce_authnet-7.x-1.x

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DigitalFrontiersMedia’s picture

Adding this patch to commerce_cardonfile-7.x-2.x-dev and commerce_authnet-7.x-1.1 results in:

Notice: Undefined index: payment_method in commerce_cardonfile_form_commerce_payment_order_transaction_add_form_alter() (line 754 of .../sites/all/modules/commerce_cardonfile/commerce_cardonfile.module).

Currently no cards on file--not sure if that is partly of cause.

Testing sanity check with something like:

$payment_method = isset($form_state['payment_method']) ? $form_state['payment_method']:null;

Will report back with modified patch if exact nature isolated.

richm’s picture

I tried this patch and got the same error, even though there already was a card on file.

Has anyone had any success in resolving this?

DigitalFrontiersMedia’s picture

It's been a while, but yeah, I think I got this working. I'm pretty busy but will try to remember to look for it around the end of next week and post back here. Remind me if I haven't reported back by this time next week and nobody else has piped up.

richm’s picture

Hi DigitalFrontiersMedia,

Unfortunately, no one else has responded. If you could locate and post your solution, it would be much appreciated.

Thanks in advance!

DigitalFrontiersMedia’s picture

Hi richm & Tim,

My apologies for very late response. Yes, I did get this working. The answer was pretty much as I outlined in #1 above.
If you applyandyg5000's patch, then simply go to line 754 of /sites/all/modules/commerce_cardonfile/commerce_cardonfile.module and change it from
$payment_method = $form_state['payment_method'];
to
$payment_method = isset($form_state['payment_method']) ? $form_state['payment_method']:null;

If you need me to re-roll a patch instead, let me know.

Cheers,
Stephen

Tim Bozeman’s picture

@DigitalFrontiersMedia Thank you!

Rerolled with DigitalFrontiersMedia's changes. If there's a card on file it shows up on the payment terminal.

WillsCreative’s picture

Is there a way to make it so when you use a new credit card (one not on file) it stores it for future use?

scottAtRoot802’s picture

#6 patch works great. This is exactly what I needed.

merauluka’s picture

Awesome! Love this feature.

#6 patch applied against latest dev (7.x-2.0-beta5+3-dev) successfully.

Thanks all.

DigitalFrontiersMedia’s picture

Status: Needs review » Reviewed & tested by the community

Can we call this RTBC?

mglaman’s picture

Issue tags: +commerce-sprint
thejacer87’s picture

Issue summary: View changes
FileSize
131.19 KB
120.35 KB

hey guys, the patch in #6 applied cleanly. And it looks like it should work. except I get an error when I submit it. I am using the Commerce Stripe Payment Gateway and I have it working with card on file for regular checkouts.

The one error is what I would expect when not entering the Card number. But the "missing required param: number" I have no idea where it's coming from. I searched my entire project for the string "missing required param" and came up empty.

edit: definitely a commerce_stripe issue. Thanks for patch guys. It definitely work for me. +1 for RTBC

torgosPizza’s picture

What more needs to happen to get this committed?

mglaman’s picture

+++ b/commerce_cardonfile.module
@@ -702,6 +702,92 @@ function commerce_cardonfile_commerce_checkout_form_submit($form, &$form_state)
+  $payment_method = isset($form_state['payment_method']) ? $form_state['payment_method']:null;

: NULL

Fixed for commit.

  • mglaman committed 52f59d8 on 7.x-2.x authored by Tim Bozeman
    Issue #2212475 by Tim Bozeman, thejacer87, mglaman: Add card on file...
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

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