Re: Custom events for payment methods

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:


​
Would this work?
​

On Thu, Oct 5, 2017 at 1:33 PM, Andy Estes <aestes@apple.com> wrote:

>
>
> On Oct 4, 2017, at 1:56 PM, Rouslan Solomakhin <rouslan@google.com> wrote:
>
> Eiji: You wrote https://github.com/GoogleChrome/appr-wrapper. How did you
> deal with "validatemerchant" and "paymentmethodselected" events?
>
>
> Not to speak for Eiji, but I did look into this myself recently.
>
> It looks like appr-wrapper will forward these events to the PaymentRequest
> object if its client has added “onvalidatemerchant” or
> “onpaymentmethodselected” properties.
>
> There’s also a declarative mechanism for handling merchant validation,
> where the client specifies their merchant identifier and validation
> endpoint in the payment method data dictionary and the wrapper
> automatically performs a POST fetch with the Apple validation URL
> JSON-encoded in the HTTP body.
>
> This is a clever solution, but I don’t think this can be the only way we
> do merchant validation. The declarative approach might require existing
> Apple Pay JS clients to make server-side changes to their validation
> endpoint, and I’d like to make it as easy as possible for them to migrate
> to Payment Request.
>
> Andy
>

Received on Thursday, 5 October 2017 20:54:23 UTC