Re: Custom events for payment methods

> On Oct 5, 2017, at 1:53 PM, Rouslan Solomakhin <rouslan@google.com> wrote:
> 
> Can this be accomplished via feature detection on the PaymentRequest object? For example, in current implementation in Chrome, the merchant can compare the event endpoints to "undefined" to determine whether the current browser supports these features:
> 
> <Screenshot from 2017-10-05 16:51:35.png>
> ​
> Would this work?

Yes, I think this would work.

I referred to this as distasteful earlier because I’m concerned that the event names I choose might conflict with future standardized Payment Request event names, in particular because “payment method” is an overloaded term between Apple Pay JS and Payment Request. I could avoid conflicts with a prefix, though (e.g. “applepaypaymentmethodselected” instead of “paymentmethodselected”).

In a world where payment method data objects can’t be event targets, though, this is likely the best approach.

Thanks,
Andy

Received on Friday, 6 October 2017 00:08:31 UTC