Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Save token in session #109

Open
colinmollenhour opened this issue May 22, 2017 · 1 comment
Open

Save token in session #109

colinmollenhour opened this issue May 22, 2017 · 1 comment

Comments

@colinmollenhour
Copy link
Contributor

colinmollenhour commented May 22, 2017

I can't think of any great reason why the token shouldn't be saved in the user's checkout session data instead of just on the user's page. Currently if the user goes back to any of the previous checkout steps their payment data is lost and they have to re-enter it again. I propose that the token, CC type, CC expiration, CC last 4 and length of CVV be saved in the checkout session so when the payment step is loaded if a token is already present a new one will not be required. To support this for the iframe method when loading the payment step with session data present rather than try to populate the fields with masked data the form could just be hidden and a link could be displayed that when clicked would display the form and if it is not clicked then the existing token is used.

screenshot

Edit: For a little bit of extra caution the token could be cleared if the shipping address is updated. This way if the session is hijacked the token cannot be used to place an order to a different address. Also, if the token is in the session just expose a flag like "session_has_token" to the UI rather then rendering the token into a hidden field.

@colinmollenhour colinmollenhour changed the title Save token is session Save token in session May 22, 2017
@slogsdon
Copy link
Contributor

Hi @colinmollenhour! Thanks for bringing this suggestion.

From a high level, I don't see any issues with this sort of workflow, but we would want to ensure there aren't any problems during checking with the token stored in the checkout session. Also, we would probably want to expose this functionality behind a feature flag to ensure the current checkout experience is the default (at least at first).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants