Re: [w3c/webpayments-payment-apps-api] Revisiting payment app filtering (#96)

Reading the comments above, I sense that there is a bit of confusion around the two different pieces of functionality that can be used to check the ability to make a payment. Let me just try to make things clear:

1. `canHandle()` / "config based filter": This is the mechanism which we should be discussing in this issue. We may implement it as code or as config, but the purpose is the same: This mechanism allows the mediator to ask a payment app whether it can handle a given payment method. The mediator will most likely make use of this mechanism in two cases:
    1. as part of calculating the answer to `PaymentRequest.canMakePayment()`.
    2. to figure out which payment apps/methods to display when the merchant has called `PaymentRequest.show()`.
2. The second mechanism is the `PaymentRequest.canMakePayment()` function. While it will most likely call into the `canHandle()` mechanism above, it is not exactly the same thing. This function is likely to be called while the page is loading, as part of constructing a pay button on the merchant's page.

The speed requirements on these two mechanisms are different. Since `PaymentRequest.canMakePayment()` most likely is called during page load, it's not a big deal if it talks to a server and returns an answer slowly, since it happens at a time when everything else is slowly being constructed as well. `canHandle()` on the other hand, may be invoked by the `PaymentRequest.show()` function, at a time when user interface is being shown to the user, and a list of payment options is being populated before the eyes of the user. This situation calls for a snappier response.

The Apple Pay methods mentioned above, are equivalent to the `PaymentRequest.canMakePayment()` function, *not* to the `canHandle()` function. The fact that these Apple Pay methods might be asynchronous and may talk to the server, does *not* influence the speed requirements on the `canHandle()` filtering mechanism.

-- 
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/webpayments-payment-apps-api/issues/96#issuecomment-277186226

Received on Friday, 3 February 2017 07:58:14 UTC