- From: Marcos Cáceres <notifications@github.com>
- Date: Thu, 10 May 2018 00:41:37 -0700
- To: w3c/payment-request <payment-request@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 10 May 2018 07:42:01 UTC
Hmmm... having spec'ed this out, now I don't know if I like this design anymore 😓 Doesn't feel right that the only thing that changes `.methodName` and `.methodData` is this event. Maybe this should switch back to having special event for this, as per https://github.com/w3c/payment-request/issues/662#issuecomment-359038775 The name `paymentmethodchange` is also super ambiguous tho, because it's really a "Instrument change" of a payment method. So, I I'm kind thinking "instrumentchange" is more appropriate as an event name. I think I'd like to change this to: ```JS PaymentMethodChangeEvent : PaymentRequestUpdateEvent { readonly attribute DOMString methodName; readonly attribute object? methodDetails; } ``` So that: ```JS request.oninstrumentchange = ev => { const { type: cardType } = ev.methodDetails; if (ev.methodName === "https://apple.com/apple-pay") { switch (cardType) { case "store": // do Apple Pay specific handling for store card... break; } } // finally... ev.updateWith(newStuff); }; ``` @aestes wdty? -- 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/payment-request/pull/695#issuecomment-387978220
Received on Thursday, 10 May 2018 07:42:01 UTC