Re: Custom events for payment methods

> On Oct 4, 2017, at 1:56 PM, Rouslan Solomakhin <rouslan@google.com> wrote:
> 
> Eiji: You wrote https://github.com/GoogleChrome/appr-wrapper <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 17:33:48 UTC