Re: [w3c/browser-payment-api] canMakePayment() might be in the wrong place? (#403)

I feel like my question needs more context although I'm still asking myself if this problem is specific to our platform or more generally the `canMakePayment` design, apologize again if it's the former.

At Shopify, we have the concept of `Cart` and `Checkout`. A `Checkout` gets created when the customer is done reviewing his cart (he his on the summary page and finally clicks on checkout which redirects him to the classic form).
A `Cart` doesn't have a notion of currency or even taxes, one of the reason we need to wait for the checkout to be created to instantiate PaymentRequest.

If you navigate to https://paymentrequest.myshopify.com/cart (add product first to your cart), and click on checkout, you should see the PaymentRequest slate opening. The PaymentRequest object gets instantiated right when you click on the "Checkout" button (we make couple requests first to create the checkout, and retrieve back the data).
We also can't create the checkout when the user lands on the summary page as it would be a waste of resources if the user finally decide to **not** checkout.

Let's say we wanted to perform some `canMakePayment` logic even before the customer clicks on the checkout button, because the checkout is not yet created, we would have no other choice but to instantiate a PaymentRequest instance with dummy data.

I believe this notion of Cart and Checkout is not specific to Shopify but most e-commerce platform.

-- 
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/browser-payment-api/issues/403#issuecomment-297752806

Received on Thursday, 27 April 2017 15:41:40 UTC