Follow-up to #2674858: Card on file - can't manage or add cards with Stripe.js integration method

Problem/Motivation

The "card on file" functionality does not allow for managing cards when using the checkout integration type.

This is due to it being necessary to provide an update callback in order for the View handler that loads the contextual links to realize the user actually has access to the delete operation: see #2323561: No Operations appear on .

Stripe's API itself looks like it will allow us simply to save the customer's card using the charge token. See https://stripe.com/docs/charges#saving-credit-card-details-for-later

Proposed resolution

I'm going to try to implement this, at least for adding and deleting. Not sure what we can do in terms of updating — perhaps allow them to replace the card, or just have a dummy callback so that everything else will still show up.

To the extent possible, I'm just going to look at what the module does in the payment pane and just try to copy that.

Remaining tasks

- Review and test patch.

User interface changes

- Card-on-file management will be possible for the Stripe Checkout integration method, but the UI will basically be the same as with Stripe.js.

API changes

None.

Comments

wizonesolutions created an issue. See original summary.

wizonesolutions’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Category: Task » Feature request
Status: Active » Needs review
StatusFileSize
new13.53 KB

Pushed to get this done today. Here is the patch!

I basically just copy-paste-changed the code from commerce_stripe_submit_form(). Wasn't comfortable actually refactoring commerce_stripe_submit_form() since it's kind of an important function. But I left notes with some recommendations on where reuse could occur.

Same with commerce_stripe.js, where I repurposed and fixed up the code to open Commerce Stripe.

Works great! Saves the card, no errors or warnings.

And stripe.js still works if set.

wizonesolutions’s picture

Issue summary: View changes

  • wizonesolutions authored 51655e8 on 7.x-1.x
    Issue #2703577 by wizonesolutions: Add Card on File management for...
torgospizza’s picture

Status: Needs review » Fixed

Tested and working for me. Committed to 7.x-1.x.

Status: Fixed » Closed (fixed)

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