Re: [w3c/payment-handler] What happens when clearing site data? (#236)

> So yeah, looks like we need to change the API to make this "credential" storage. We should decouple PaymentInstruments from a SW registration, and then link them together somehow... don't know what that would be yet.. like:
> 
> await navigator.paymentInstruments.set("visa1", cardDetails);
> 
> const reg = await navigator.serviceWorker.ready;
> reg.claimPaymentHandlingStuffNamingIsHard();
> @rsolomakhin, thoughts?

I support your opinion, but I have a question.

As far as I know, when clearing site data, all registered SW will be removed as well. Then, even if PaymentInstruments store is independent on SW life cycle, users will still have to revisit the third-party payment site to re-register SW. (If there is no SW, how can PaymentInstruments map with SW?)

1. Visit https://hellopay.com
2. Click `register` button and then register SW and instruments (including asking a permission)
3. Clear all site data (At this time, all SW will be removed except instruments data)
4. Visit https://merchant.com
5. Request payment using `PaymentRequest`
6. Instruments will appear on payment sheet.
7. User selects one of the instruments and then click `pay` button
8. What happen? Who can receive `PaymentRequestEvent`?

If I'm missing something, please correct me.

Thank you.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-handler/issues/236#issuecomment-348161057

Received on Thursday, 30 November 2017 14:27:08 UTC