Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Securely save payment info locally [$150] #6

Open
cassidyjames opened this issue Mar 24, 2017 · 16 comments
Open

Securely save payment info locally [$150] #6

cassidyjames opened this issue Mar 24, 2017 · 16 comments

Comments

@cassidyjames
Copy link
Contributor

We should find a way to securely and optionally save payment info on the local machine.


There is a bounty on this issue on Bountysource


There is a $150 open bounty on this issue. Add to the bounty at Bountysource.

@danirabbit
Copy link
Member

danirabbit commented Mar 24, 2017

Shouldn't we instead make use of Stripe's customer feature? If we create customers instead we can do things like subscriptions or list previous purchases from other machines

@cassidyjames
Copy link
Contributor Author

cassidyjames commented Mar 24, 2017 via email

@danirabbit danirabbit changed the title Securely save payment info locally Securely save payment info locally [$100] Apr 25, 2017
@cassidyjames
Copy link
Contributor Author

cassidyjames commented May 16, 2017

I'll have to (have @btkostner) look at the API a bit more, but after discussing this on Slack and in-person with @bencates, I think the way forward is:

  • Add a "Save this payment info" checkbox to the payment dialog
  • If checked, save the customer and card ID we get back from Stripe after the payment in the GNOME Keyring
  • For subsequent payments, if there is a customer and card ID saved locally, use those instead of creating a new token.

@cassidyjames
Copy link
Contributor Author

We will likely also need a way to not used a saved payment method in case the card has changed or whatever. In other app stores I see something like

|-----------------------------------|
|             AppCenter             |
|               Vocal               |
|                                   |
| [x] Use saved card ending in 1234 |
|                                   |
|             [ Cancel ] [ Pay $5 ] |
-------------------------------------

... and then un-checking the card would swap that line out with our existing "new card" entries.

@danirabbit
Copy link
Member

some things worth noting:

  • We should use libsecret and not GNOME keyring specifically.

  • We should save information in a new keyring, not the login keyring.

@btkostner
Copy link

Couple things to note:

  • Stripe only takes the customer ID, not a source ID if you are charging a customer. This means that we can't do any check against the source ID.
  • While using libsecret on the client is great for security, it still offers no security for the server. This means we have a non expiring, non disableable (without deleting the customer completly) random string being the only thing from stopping someone charging an unlimited amount of money to someone's account.
  • We need to figure out how to send libsoup data in the POST body. Right now we are using GET parameters, which are not protected with https, and visible to everyone.
  • This won't be able to share accounts between computers. Each computer will have it's own purchase history.

The difference right now, the token we get from stripe expires if it's not used, and is a single use only token.

@danirabbit
Copy link
Member

I think point 2 is kind of moot because this would be the same case if your credentials were hijacked. "Unlimited" is also quiet some hyperbole since Stripe has fraud detection and will block large transactions. If I'm not mistaken, this customer ID is tied to our store as well right? So it's not as if this token can be used to do anything other than purchase apps which can already be downloaded for free.

I think we need to be clear that the intention here is not to create a multi-device account or establish purchase history. The only goal is to allow users to purchase again on the same device without having to re-enter their credentials.

@KedarBrooks
Copy link

Posted a pull request for this bounty (#354)

@Lewiscowles1986
Copy link

Lewiscowles1986 commented Feb 9, 2018

Just a note

We need to figure out how to send libsoup data in the POST body. Right now we are using GET parameters, which are not protected with https, and visible to everyone.

From a "sniff the network packet" point of view a GET request (with parameters) is safe. I used to believe the same thing (oh it's unsafe, it must be sent unencrypted) but apparently, you cannot sniff get params over the network. While it is less secure than post because it can often be trapped by web-logs, browser add-ons etc, it is not transparently transmitted. Because I'm assuming this is transmitted from a local machine it should if you use libsecret be safe for users.

Coming from elementary/houston#588 (I think I'll close that issue, it makes more sense to do locally)

How would it be possible to transfer this if a user were to upgrade from current release to the next major distro-release?

@Garbee
Copy link

Garbee commented Mar 2, 2018

A thought on the suggested UX, there should probably be "use saved card ending in XXXX" entries with a "Use new card" option at the end when clicked would trigger the form showing up. It's not exactly intuitive that unchecking a saved card feature would show the new form. Also, confusing if multiple cards are saved. Checkboxes tend to indicate multiple choice not singular. So a radio control system seems more adept for this scenario.

@danirabbit
Copy link
Member

Gonna punt this feature since we're already end of April

@razcakappa
Copy link

razcakappa commented May 12, 2018

Instead of using the StripAPI to store and retrieve card data, what if we store card details as secret items in a secret collection on a keyring instead? libsecret-1 library supports this method.

On UI, upon selecting a saved card from a saved card list , particular card details can be retrieved and feed to the payment form (StripeDialog).

@Garbee
Copy link

Garbee commented May 12, 2018

@razcakappa That isn't feasible since then Elementary is liable for PCI compliance. As I understand it, you can't store the CVC code in the same place as the rest of the card information. At least, not as a place that also intends to charge from that information.

Taking advantage of stripe's tokenizing removes almost all PCI concerns.

@danirabbit danirabbit changed the title Securely save payment info locally [$100] Securely save payment info locally [$150] Jul 29, 2018
@ghost
Copy link

ghost commented Aug 14, 2018

So despite the title, the real issue is to let StripeAPI store the payment info and just store the Stripe customer ID and limited card info (last 4 digits and unique Stripe ID) locally, along with creating the actual input form for sending the new card info to Stripe or using the already stored Customer Stripe info. Is that correct?

Just trying to understand the scope of the issue.

@cassidyjames
Copy link
Contributor Author

@terndrup that sounds correct to me. I can aid with the UX/implementation of the UI for re-using card info as well.

@danirabbit danirabbit transferred this issue from elementary/appcenter Apr 19, 2020
@davidmhewitt
Copy link
Member

Worth pointing out that I have a functional prototype of this that came out of the time freed up by the (postponed) AppCenter for everyone sprint:

The libelementary-account-testing branch in conjunction with
https://github.com/davidmhewitt/elementary-account-api and https://github.com/davidmhewitt/elementary-account-api

This isn't production ready code or design yet, but hopefully we can continue this when the in-person sprint gets rescheduled.

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

No branches or pull requests

8 participants