The "card on file" functionality does not allow for adding (and in one case removing) cards.

I'm testing on a Commerce Kickstart 2.x installation.
Have all permissions in place.
Have tried both: "stripe.js" and "checkout".
Payments themselves work and card is added to the cards list in user profile when put in on payment.

Common:

  • in user/%uid/cards there is no add new card button

stripe.js:

  • There's an edit and delete button for the existing cards (that have been collected from successful checkouts.
  • Edit only includes the editing of name and date (maybe that's intended and is not really the main issue).
  • When visiting user/%uid/cards/add there's a redirect loop and the page never loads

checkout:

  • There's no edit button but not even a delete possibility (not being able to delete a card is an issue)
  • When visiting user/%uid/cards/add I get 403 access denied

Any solutions or ideas?
I really need the card on file functionality or some alternative, where the customers can add their cards, and charge them through the system when services have been fully provided. Also for orders I intend to skip the payment on order placement, so the payment can be postponed until orders have been completely fulfilled.

Best,

Alari

CommentFileSizeAuthor
#6 2674858-form_card_data-5.patch706 bytestorgospizza
#2 CaptureLOG.PNG167.64 KBAlluuu

Comments

Alluuu created an issue. See original summary.

Alluuu’s picture

StatusFileSize
new167.64 KB

Ok, I managed to trace the redirect loop in Chrome and it's following:

redirect loop capture

It seems that the /users/%uid/cards/add is 302 redirecting to itself

Alluuu’s picture

Component: User interface » Code

I was able to get rid of the redirect loop for when using stripe.js but not "checkout"

Updating commerce_cardonfile to the 7.2.x--dev version removes the loop issue, but not the 403 checkout issue.

Alluuu’s picture

I've stumbled upon another issue with adding a card from /user/%uid/cards/add, where there is an error thrown:

Undefined index: card in commerce_stripe_cardonfile_create_form()

on line 875, which is:

874  // Create a billing profile object and add the address form.
875  $profile = commerce_customer_profile_new('billing', $form_state['card']->uid);
876  $form_state['commerce_customer_profile'] = $profile;
877  $form['commerce_customer_profile'] = array();
878  field_attach_form('commerce_customer_profile', $profile, $form['commerce_customer_profile'], $form_state);
Alluuu’s picture

There's a mistake with
$form_state['card']->uid);
where it should be
$form_state['card_data']->uid);
It's been changed to card_data everywhere else, but for that line has been missed.

torgospizza’s picture

Status: Active » Needs review
StatusFileSize
new706 bytes

Nice catch. Here is a one-line patch for that particular typo/bug.

wizonesolutions’s picture

Title: Card on file - can't manage or add cards » Card on file - can't manage or add cards with Stripe.js integration method

@Alluuu @torgosPizza I can't reproduce the 403 that torgosPizza's patch is supposed to cause. What are the proper steps? I clicked the "Add card" link with integration method set to Stripe.js.

Editing/adding isn't implemented for Checkout, and that's why the operations do not show up, @Alluuu. Known issue. I am going to work on implementing those, but I will open a separate issue for that (and I am updating the title a bit here).

sebastien m.’s picture

Patch #6 works perfectly for me with Stripe.js integration method.
Can you flag this issue as "Reviewed by community" and create another issue dedicated for "checkout" method support and linking them together ?

Thanks

wizonesolutions’s picture

@Sebastien @Actualys: This patch includes Stripe Checkout support. Did you test that?

sebastien m.’s picture

@wizonesolutions, the #6 patch only fixes a typo error when registering a card on user profile.
Why do you say that it includes Stripe Checkout support ?
What I have to check ?

wizonesolutions’s picture

@Sebastien @Actualys Whoops! Sorry, I confused this one for #2703577: Add Card on File management for Stripe Checkout integration method

torgospizza’s picture

@Sebastien: Thanks! Go ahead and mark this RTBC if it worked for you. (I would but I wrote the patch...)

torgospizza’s picture

This is a super simple patch so I'm just going to RTBC it myself.

  • torgosPizza authored b409d5e on 7.x-1.x
    Issue #2674858 by torgosPizza: Card on file - can't manage or add cards...
torgospizza’s picture

Status: Needs review » Fixed

Setting to fixed but please let me know if anyone runs into further trouble with Card on File support.

Status: Fixed » Closed (fixed)

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