W3C home > Mailing lists > Public > public-payments-wg@w3.org > October 2017

Re: Custom events for payment methods

From: Rouslan Solomakhin <rouslan@google.com>
Date: Wed, 4 Oct 2017 16:56:04 -0400
Message-ID: <CAMMzaWEzNc89j2HfP5C2HFELPCG4Hnuaz45PaDKvDHxmvWGMsw@mail.gmail.com>
To: Andy Estes <aestes@apple.com>, Eiji Kitamura <agektmr@google.com>, Zach Koch <zkoch@google.com>
Cc: Web Payments Working Group <public-payments-wg@w3.org>
Eiji: You wrote https://github.com/GoogleChrome/appr-wrapper. How did you
deal with "validatemerchant" and "paymentmethodselected" events?

On Wed, Oct 4, 2017 at 3:44 PM, Andy Estes <aestes@apple.com> wrote:

> Hi folks,
> In Apple Pay JS, there are two events that do not have equivalents in the
> Payment Request API (validatemerchant and paymentmethodselected). A
> PaymentRequest implementation that supports Apple Pay needs to account for
> these events, and I can think of two ways to do this:
> 1. Make the “data” object in the PaymentMethodData dictionary be an event
> target for Apple Pay. Unfortunately the spec requires this object to be
> JSON-stringified then re-parsed before being passed to the payment handler,
> but I suppose an implementation could keep around a reference to the
> original object for the purposes of firing events. If the spec didn’t
> require JSON round-tripping for all payment method objects, this is
> unquestionably the option I’d choose.
> 2. Fire payment method-specific events on the PaymentRequest object with
> prefixed names (e.g. applepayvalidatemerchant and
> applepaypaymentmethodselected). This seems distasteful, but simpler.
> I’m wondering if anyone else has encountered this issue when implementing
> a payment method, and if so, how they went about solving it. Is there a
> recommended way for extending PaymentRequest with payment method-specific
> events?
> Thanks,
> Andy
Received on Wednesday, 4 October 2017 20:56:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 4 October 2017 20:56:28 UTC